summaryrefslogtreecommitdiff
path: root/src/mainboard/sifive
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/sifive')
-rw-r--r--src/mainboard/sifive/hifive-unleashed/romstage.c18
1 files changed, 18 insertions, 0 deletions
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 <cbmem.h>
#include <console/console.h>
+#include <console/streams.h>
+#include <console/uart.h>
#include <program_loading.h>
+#include <soc/clock.h>
+#include <soc/sdram.h>
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();
}