aboutsummaryrefslogtreecommitdiff
path: root/src/include/console/uart.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/console/uart.h')
-rw-r--r--src/include/console/uart.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
index 0dccd00d43..3bd390e75b 100644
--- a/src/include/console/uart.h
+++ b/src/include/console/uart.h
@@ -23,6 +23,17 @@
* baudrate generator. */
unsigned int uart_platform_refclk(void);
+#if IS_ENABLED(CONFIG_UART_OVERRIDE_BAUDRATE)
+/* Return the baudrate, define this in your platform when using the above
+ configuration. */
+unsigned int get_uart_baudrate(void);
+#else
+static inline unsigned int get_uart_baudrate(void)
+{
+ return CONFIG_TTYS0_BAUD;
+}
+#endif
+
/* Returns the divisor value for a given baudrate.
* The formula to satisfy is:
* refclk / divisor = baudrate * oversample