From 374d992fc831300377216fd3f7c3137d4b53ab36 Mon Sep 17 00:00:00 2001 From: Philipp Hug Date: Thu, 13 Sep 2018 22:16:36 +0200 Subject: soc/sifive/fu540: Switch clock to 1GHz in romstage Invoke clock_init in romstage for SiFive Unleashed. Change-Id: Ib869762d557e8fdf4c83a53698102df116d80389 Signed-off-by: Philipp Hug Reviewed-on: https://review.coreboot.org/28602 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/mainboard/sifive/hifive-unleashed/romstage.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/mainboard/sifive/hifive-unleashed') diff --git a/src/mainboard/sifive/hifive-unleashed/romstage.c b/src/mainboard/sifive/hifive-unleashed/romstage.c index ea6efb9b6d..9729f86f4a 100644 --- a/src/mainboard/sifive/hifive-unleashed/romstage.c +++ b/src/mainboard/sifive/hifive-unleashed/romstage.c @@ -13,8 +13,13 @@ * GNU General Public License for more details. */ +#include #include +#include +#include #include +#include +#include void main(void) { @@ -22,5 +27,18 @@ void main(void) /* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */ + /* + * Flush console before changing clock/UART divisor to prevent garbage + * being printed. + */ + console_tx_flush(); + + clock_init(); + + // re-initialize UART + #if (IS_ENABLED(CONFIG_CONSOLE_SERIAL)) + uart_init(CONFIG_UART_FOR_CONSOLE); + #endif + run_ramstage(); } -- cgit v1.2.3