summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/am33xx/board.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-06-23 14:30:23 -0600
committerTom Rini <trini@konsulko.com>2024-07-04 09:25:20 -0600
commit0fd4120fb535b22ca2ba94d9fe04d7e01557e38c (patch)
tree72f1217d388459202909ff806a7baabc1e15e1ee /arch/arm/mach-omap2/am33xx/board.c
parent57c4cd17e6988d9ba4b9184f7b4e66ff0c22108f (diff)
am33xx: Provide a function to set up the debug UART
Since commit 0dba45864b2a ("arm: Init the debug UART") the debug UART is set up in _main() before early_system_init() is called. Add a suitable board_debug_uart_init() function to set up the UART in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/mach-omap2/am33xx/board.c')
-rw-r--r--arch/arm/mach-omap2/am33xx/board.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index 78c1e965c9f..84a60dedd72 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -490,9 +490,6 @@ void early_system_init(void)
*/
save_omap_boot_params();
#endif
-#ifdef CONFIG_DEBUG_UART_OMAP
- debug_uart_init();
-#endif
#ifdef CONFIG_SPL_BUILD
spl_early_init();
@@ -533,3 +530,18 @@ static int am33xx_dm_post_init(void)
return 0;
}
EVENT_SPY_SIMPLE(EVT_DM_POST_INIT_F, am33xx_dm_post_init);
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+ if (u_boot_first_phase()) {
+ hw_data_init();
+ set_uart_mux_conf();
+ setup_early_clocks();
+ uart_soft_reset();
+
+ /* avoid uart gibberish by allowing the clocks to settle */
+ mdelay(50);
+ }
+}
+#endif