From 22e10be456014400788f80d45fc5f5c0b9d4a81d Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Thu, 13 Apr 2017 10:31:21 +0800 Subject: board: sama5d4ek: enable early debug UART MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable the early debug UART to debug problems when an ICE or other debug mechanism is not available. Signed-off-by: Wenyou Yang Reviewed-by: Andreas Bießmann --- board/atmel/sama5d4ek/sama5d4ek.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'board/atmel') diff --git a/board/atmel/sama5d4ek/sama5d4ek.c b/board/atmel/sama5d4ek/sama5d4ek.c index f2d0a472e1..ffb4a50a72 100644 --- a/board/atmel/sama5d4ek/sama5d4ek.c +++ b/board/atmel/sama5d4ek/sama5d4ek.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -161,6 +162,7 @@ void lcd_show_board_info(void) #endif /* CONFIG_LCD */ +#ifdef CONFIG_DEBUG_UART_BOARD_INIT static void sama5d4ek_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -170,12 +172,21 @@ static void sama5d4ek_serial3_hw_init(void) at91_periph_clk_enable(ATMEL_ID_USART3); } -int board_early_init_f(void) +void board_debug_uart_init(void) { sama5d4ek_serial3_hw_init(); +} +#endif +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#endif return 0; } +#endif int board_init(void) { -- cgit v1.2.1