Commit 22e10be456014400788f80d45fc5f5c0b9d4a81d
Committed by
Simon Glass
1 parent
33034a77a5
Exists in
smarc_8mq_lf_v2020.04
and in
20 other branches
board: sama5d4ek: enable early debug UART
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>
Showing 4 changed files with 30 additions and 1 deletions Side-by-side Diff
board/atmel/sama5d4ek/sama5d4ek.c
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | #include <asm/arch/sama5d3_smc.h> |
| 16 | 16 | #include <asm/arch/sama5d4.h> |
| 17 | 17 | #include <atmel_hlcdc.h> |
| 18 | +#include <debug_uart.h> | |
| 18 | 19 | #include <lcd.h> |
| 19 | 20 | #include <nand.h> |
| 20 | 21 | #include <version.h> |
| ... | ... | @@ -161,6 +162,7 @@ |
| 161 | 162 | |
| 162 | 163 | #endif /* CONFIG_LCD */ |
| 163 | 164 | |
| 165 | +#ifdef CONFIG_DEBUG_UART_BOARD_INIT | |
| 164 | 166 | static void sama5d4ek_serial3_hw_init(void) |
| 165 | 167 | { |
| 166 | 168 | at91_pio3_set_b_periph(AT91_PIO_PORTE, 17, 1); /* TXD3 */ |
| 167 | 169 | |
| 168 | 170 | |
| 169 | 171 | |
| ... | ... | @@ -170,12 +172,21 @@ |
| 170 | 172 | at91_periph_clk_enable(ATMEL_ID_USART3); |
| 171 | 173 | } |
| 172 | 174 | |
| 173 | -int board_early_init_f(void) | |
| 175 | +void board_debug_uart_init(void) | |
| 174 | 176 | { |
| 175 | 177 | sama5d4ek_serial3_hw_init(); |
| 178 | +} | |
| 179 | +#endif | |
| 176 | 180 | |
| 181 | +#ifdef CONFIG_BOARD_EARLY_INIT_F | |
| 182 | +int board_early_init_f(void) | |
| 183 | +{ | |
| 184 | +#ifdef CONFIG_DEBUG_UART | |
| 185 | + debug_uart_init(); | |
| 186 | +#endif | |
| 177 | 187 | return 0; |
| 178 | 188 | } |
| 189 | +#endif | |
| 179 | 190 | |
| 180 | 191 | int board_init(void) |
| 181 | 192 | { |
configs/sama5d4ek_mmc_defconfig
| ... | ... | @@ -56,6 +56,12 @@ |
| 56 | 56 | CONFIG_SPL_PINCTRL=y |
| 57 | 57 | CONFIG_PINCTRL_AT91=y |
| 58 | 58 | CONFIG_DM_SERIAL=y |
| 59 | +CONFIG_DEBUG_UART=y | |
| 60 | +CONFIG_DEBUG_UART_ATMEL=y | |
| 61 | +CONFIG_DEBUG_UART_BASE=0xfc00c000 | |
| 62 | +CONFIG_DEBUG_UART_CLOCK=88000000 | |
| 63 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
| 64 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
| 59 | 65 | CONFIG_ATMEL_USART=y |
| 60 | 66 | CONFIG_DM_SPI=y |
| 61 | 67 | CONFIG_ATMEL_SPI=y |
configs/sama5d4ek_nandflash_defconfig
| ... | ... | @@ -54,6 +54,12 @@ |
| 54 | 54 | CONFIG_SPL_PINCTRL=y |
| 55 | 55 | CONFIG_PINCTRL_AT91=y |
| 56 | 56 | CONFIG_DM_SERIAL=y |
| 57 | +CONFIG_DEBUG_UART=y | |
| 58 | +CONFIG_DEBUG_UART_ATMEL=y | |
| 59 | +CONFIG_DEBUG_UART_BASE=0xfc00c000 | |
| 60 | +CONFIG_DEBUG_UART_CLOCK=88000000 | |
| 61 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
| 62 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
| 57 | 63 | CONFIG_ATMEL_USART=y |
| 58 | 64 | CONFIG_DM_SPI=y |
| 59 | 65 | CONFIG_ATMEL_SPI=y |
configs/sama5d4ek_spiflash_defconfig
| ... | ... | @@ -53,6 +53,12 @@ |
| 53 | 53 | CONFIG_SPL_PINCTRL=y |
| 54 | 54 | CONFIG_PINCTRL_AT91=y |
| 55 | 55 | CONFIG_DM_SERIAL=y |
| 56 | +CONFIG_DEBUG_UART=y | |
| 57 | +CONFIG_DEBUG_UART_ATMEL=y | |
| 58 | +CONFIG_DEBUG_UART_BASE=0xfc00c000 | |
| 59 | +CONFIG_DEBUG_UART_CLOCK=88000000 | |
| 60 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
| 61 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
| 56 | 62 | CONFIG_ATMEL_USART=y |
| 57 | 63 | CONFIG_DM_SPI=y |
| 58 | 64 | CONFIG_ATMEL_SPI=y |