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>
This commit is contained in:
Furquan Shaikh 2017-07-30 13:06:38 -07:00 committed by Martin Roth
parent c4f60f33bd
commit 1679c42292
1 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,8 @@
#include "option_table.h" #include "option_table.h"
#endif #endif
#define DEFAULT_BAUDRATE 115200
unsigned int default_baudrate(void) unsigned int default_baudrate(void)
{ {
#if !defined(__SMM__) && IS_ENABLED(CONFIG_USE_OPTION_TABLE) #if !defined(__SMM__) && IS_ENABLED(CONFIG_USE_OPTION_TABLE)
@ -33,7 +35,11 @@ unsigned int default_baudrate(void)
if (b_index < 8) if (b_index < 8)
return baud[b_index]; return baud[b_index];
#endif #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. */ /* Calculate divisor. Do not floor but round to nearest integer. */