board: sama5d4ek: enable early debug UART
authorWenyou Yang <wenyou.yang@atmel.com>
Thu, 13 Apr 2017 02:31:21 +0000 (10:31 +0800)
committerSimon Glass <sjg@chromium.org>
Thu, 13 Apr 2017 20:44:53 +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/sama5d4ek/sama5d4ek.c
configs/sama5d4ek_mmc_defconfig
configs/sama5d4ek_nandflash_defconfig
configs/sama5d4ek_spiflash_defconfig

index f2d0a472e116d2e84105ec77292a484c51eb15db..ffb4a50a72fe7c2ddac217105ffe57257afd8145 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>
@@ -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)
 {
index cf376d00d112db5ce798a8a196c56a00ba7018be..8601d5622b28bbd1fca6dc57a429f9fb4e2765e0 100644 (file)
@@ -56,6 +56,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 3e4c0a32b280e877c75c6923a23cf917faa64831..a9bcabf1825f1828793b67a5bcb1bdea7a9248ee 100644 (file)
@@ -54,6 +54,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 ca3aae37fc23cab02f99afa9e95988ae22dcd1bf..b56fd631f5f9b65138f00d8e05e537e2c13c8a02 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