aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2022-02-17 14:28:42 +0100
committerMichal Simek <michal.simek@xilinx.com>2022-02-21 13:20:29 +0100
commit11381fba99dcadf9fa59dec08d78b730042ab134 (patch)
tree5a2b15409061ada8e6070cac6ea4459b209e41bc /board
parent05f0f269b7a6e5c9b65e88bb8b691e28cb49da84 (diff)
downloadu-boot-11381fba99dcadf9fa59dec08d78b730042ab134.zip
u-boot-11381fba99dcadf9fa59dec08d78b730042ab134.tar.gz
u-boot-11381fba99dcadf9fa59dec08d78b730042ab134.tar.bz2
arm64: zynqmp: Fix debug uart initialization
The commit 0dba45864b2a ("arm: Init the debug UART") calls debug_uart_init() from crt0.S but it won't work because SOC is not configured yet. That's why create board_debug_uart_init() which calls psu_init() via new psu_uboot_init() earlier before the first access to UART in SPL. In full U-Boot call psu_uboot_init() only when CONFIG_ZYNQMP_PSU_INIT_ENABLED is enabled. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/878dc2daaa8685346f889989fbfb98b2e44da7fb.1645104518.git.michal.simek@xilinx.com
Diffstat (limited to 'board')
-rw-r--r--board/xilinx/zynqmp/zynqmp.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 3a10ed8..70b3c81 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -313,10 +313,8 @@ static char *zynqmp_get_silicon_idcode_name(void)
}
#endif
-#if defined(CONFIG_BOARD_EARLY_INIT_F)
-int board_early_init_f(void)
+int __maybe_unused psu_uboot_init(void)
{
-#if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED)
int ret;
ret = psu_init();
@@ -336,16 +334,30 @@ int board_early_init_f(void)
/* Delay is required for clocks to be propagated */
udelay(1000000);
-#endif
+
+ return 0;
+}
-#ifdef CONFIG_DEBUG_UART
- /* Uart debug for sure */
- debug_uart_init();
- puts("Debug uart enabled\n"); /* or printch() */
-#endif
+#if !defined(CONFIG_SPL_BUILD)
+# if defined(CONFIG_DEBUG_UART_BOARD_INIT)
+void board_debug_uart_init(void)
+{
+# if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED)
+ psu_uboot_init();
+# endif
+}
+# endif
- return 0;
+# if defined(CONFIG_BOARD_EARLY_INIT_F)
+int board_early_init_f(void)
+{
+ int ret = 0;
+# if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED) && !defined(CONFIG_DEBUG_UART_BOARD_INIT)
+ ret = psu_uboot_init();
+# endif
+ return ret;
}
+# endif
#endif
static int multi_boot(void)