arm: socfpga: cyclone5: handle debug uart
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 13 Aug 2018 07:33:47 +0000 (09:33 +0200)
committerMarek Vasut <marex@denx.de>
Mon, 13 Aug 2018 13:29:54 +0000 (15:29 +0200)
If CONFIG_DEBUG_UART is enabled, correctly initialize
the debug uart before console is initialized to debug
early boot problems in SPL.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
arch/arm/mach-socfpga/spl_gen5.c

index 0d5526656d82a834b4cf9d5ddfe9b59e267e9625..0e685f6ee5ea5ea38d94f12580f103a0a91e0c6e 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/arch/scu.h>
 #include <asm/arch/nic301.h>
 #include <asm/sections.h>
+#include <debug_uart.h>
 #include <fdtdec.h>
 #include <watchdog.h>
 
@@ -153,6 +154,11 @@ void board_init_f(ulong dummy)
        /* unfreeze / thaw all IO banks */
        sys_mgr_frzctrl_thaw_req();
 
+#ifdef CONFIG_DEBUG_UART
+       socfpga_per_reset(SOCFPGA_RESET(UART0), 0);
+       debug_uart_init();
+#endif
+
        ret = spl_early_init();
        if (ret) {
                debug("spl_early_init() failed: %d\n", ret);