board: sama5d4_xplained: enable early debug UART
authorWenyou Yang <wenyou.yang@atmel.com>
Thu, 13 Apr 2017 02:31:18 +0000 (10:31 +0800)
committerSimon Glass <sjg@chromium.org>
Thu, 13 Apr 2017 20:44:52 +0000 (14:44 -0600)
Enable the early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
board/atmel/sama5d4_xplained/sama5d4_xplained.c
configs/sama5d4_xplained_mmc_defconfig
configs/sama5d4_xplained_nandflash_defconfig
configs/sama5d4_xplained_spiflash_defconfig

index 30d4fb73bf2b0493d3711207b0b9b855f4d5e7a5..94ecab28b9989c94a46305c0b0d7946ed61c3205 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
+#include <debug_uart.h>
 #include <lcd.h>
 #include <nand.h>
 #include <version.h>
@@ -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)
 {
index 72c239a0f825674f9b5496dafa95eea8bda34d30..2b95a16fc9c865b05dda5c44d47f0fce70ff9ef0 100644 (file)
@@ -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
index 0f6c2f4964f7bc897a14c5dcca15df303c840176..b0466c2973985920b851d4e7dc6945601f16585b 100644 (file)
@@ -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
index 96816d4472225b46ffa79e67c4fe7d2becb8743a..57dec69b38015a6a7178a1a27062f577d05a654c 100644 (file)
@@ -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