From 334794f58400e1a4fccd61dd8066c4f94f4605e7 Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Thu, 13 Apr 2017 10:31:18 +0800 Subject: [PATCH] board: sama5d4_xplained: enable early debug UART MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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/sama5d4_xplained/sama5d4_xplained.c | 13 ++++++++++++- configs/sama5d4_xplained_mmc_defconfig | 6 ++++++ configs/sama5d4_xplained_nandflash_defconfig | 6 ++++++ configs/sama5d4_xplained_spiflash_defconfig | 6 ++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c index 30d4fb73bf..94ecab28b9 100644 --- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c +++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -165,6 +166,7 @@ void lcd_show_board_info(void) #endif /* CONFIG_LCD */ +#ifdef CONFIG_DEBUG_UART_BOARD_INIT static void sama5d4_xplained_serial3_hw_init(void) { at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ @@ -174,12 +176,21 @@ static void sama5d4_xplained_serial3_hw_init(void) at91_periph_clk_enable(ATMEL_ID_USART3); } -int board_early_init_f(void) +void board_debug_uart_init(void) { sama5d4_xplained_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) { diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig index 72c239a0f8..2b95a16fc9 100644 --- a/configs/sama5d4_xplained_mmc_defconfig +++ b/configs/sama5d4_xplained_mmc_defconfig @@ -53,6 +53,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfc00c000 +CONFIG_DEBUG_UART_CLOCK=88000000 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y diff --git a/configs/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig index 0f6c2f4964..b0466c2973 100644 --- a/configs/sama5d4_xplained_nandflash_defconfig +++ b/configs/sama5d4_xplained_nandflash_defconfig @@ -50,6 +50,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfc00c000 +CONFIG_DEBUG_UART_CLOCK=88000000 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y diff --git a/configs/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig index 96816d4472..57dec69b38 100644 --- a/configs/sama5d4_xplained_spiflash_defconfig +++ b/configs/sama5d4_xplained_spiflash_defconfig @@ -52,6 +52,12 @@ CONFIG_PINCTRL=y CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfc00c000 +CONFIG_DEBUG_UART_CLOCK=88000000 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y -- 2.25.1