From 1679c42292ecfa3151fae8b7567b4c9d9e83ba75 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sun, 30 Jul 2017 13:06:38 -0700 Subject: drivers/uart: Use baudrate of 115200 by default If TTYS0_BAUD is not configured, then by default use baudrate of 115200. BUG=b:64030366 Change-Id: Ida4c7ae77aba5dfd4ec331e22a54ce43a91bde00 Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/20834 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Aaron Durbin --- src/drivers/uart/util.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/drivers') diff --git a/src/drivers/uart/util.c b/src/drivers/uart/util.c index f0f885d532..882e3ae784 100644 --- a/src/drivers/uart/util.c +++ b/src/drivers/uart/util.c @@ -18,6 +18,8 @@ #include "option_table.h" #endif +#define DEFAULT_BAUDRATE 115200 + unsigned int default_baudrate(void) { #if !defined(__SMM__) && IS_ENABLED(CONFIG_USE_OPTION_TABLE) @@ -33,7 +35,11 @@ unsigned int default_baudrate(void) if (b_index < 8) return baud[b_index]; #endif - return CONFIG_TTYS0_BAUD; + /* + * If TTYS0_BAUD is not configured, then by default use 115200 as the + * baud rate. + */ + return CONFIG_TTYS0_BAUD ? CONFIG_TTYS0_BAUD : DEFAULT_BAUDRATE; } /* Calculate divisor. Do not floor but round to nearest integer. */ -- cgit v1.2.3