summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-07-30 13:06:38 -0700
committerMartin Roth <martinroth@google.com>2017-08-04 15:27:50 +0000
commit1679c42292ecfa3151fae8b7567b4c9d9e83ba75 (patch)
treef7c8e1c753f4b52e27b69d9bdf72d2b40c2cb7dd
parentc4f60f33bd4ac3aa1adee05b4e91969c5327b09c (diff)
downloadcoreboot-1679c42292ecfa3151fae8b7567b4c9d9e83ba75.tar.xz
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 <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/20834 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--src/drivers/uart/util.c8
1 files changed, 7 insertions, 1 deletions
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. */