Commit c1868adf6444e8fb600575affb634cad2f2ff8f5
Committed by
Simon Glass
1 parent
adc6b2863e
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
board: at91sam9n12ek: 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: Simon Glass <sjg@chromium.org>
Showing 4 changed files with 31 additions and 0 deletions Side-by-side Diff
board/atmel/at91sam9n12ek/at91sam9n12ek.c
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | #include <asm/arch/at91_rstc.h> |
14 | 14 | #include <asm/arch/at91_pio.h> |
15 | 15 | #include <asm/arch/clk.h> |
16 | +#include <debug_uart.h> | |
16 | 17 | #include <lcd.h> |
17 | 18 | #include <atmel_hlcdc.h> |
18 | 19 | #include <netdev.h> |
19 | 20 | |
20 | 21 | |
... | ... | @@ -162,10 +163,22 @@ |
162 | 163 | } |
163 | 164 | #endif |
164 | 165 | |
166 | +#ifdef CONFIG_DEBUG_UART_BOARD_INIT | |
167 | +void board_debug_uart_init(void) | |
168 | +{ | |
169 | + at91_seriald_hw_init(); | |
170 | +} | |
171 | +#endif | |
172 | + | |
173 | +#ifdef CONFIG_BOARD_EARLY_INIT_F | |
165 | 174 | int board_early_init_f(void) |
166 | 175 | { |
176 | +#ifdef CONFIG_DEBUG_UART | |
177 | + debug_uart_init(); | |
178 | +#endif | |
167 | 179 | return 0; |
168 | 180 | } |
181 | +#endif | |
169 | 182 | |
170 | 183 | int board_init(void) |
171 | 184 | { |
configs/at91sam9n12ek_mmc_defconfig
... | ... | @@ -35,6 +35,12 @@ |
35 | 35 | CONFIG_PINCTRL=y |
36 | 36 | CONFIG_PINCTRL_AT91=y |
37 | 37 | CONFIG_DM_SERIAL=y |
38 | +CONFIG_DEBUG_UART=y | |
39 | +CONFIG_DEBUG_UART_ATMEL=y | |
40 | +CONFIG_DEBUG_UART_BASE=0xfffff200 | |
41 | +CONFIG_DEBUG_UART_CLOCK=132000000 | |
42 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
43 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
38 | 44 | CONFIG_ATMEL_USART=y |
39 | 45 | CONFIG_DM_SPI=y |
40 | 46 | CONFIG_ATMEL_SPI=y |
configs/at91sam9n12ek_nandflash_defconfig
... | ... | @@ -35,6 +35,12 @@ |
35 | 35 | CONFIG_PINCTRL=y |
36 | 36 | CONFIG_PINCTRL_AT91=y |
37 | 37 | CONFIG_DM_SERIAL=y |
38 | +CONFIG_DEBUG_UART=y | |
39 | +CONFIG_DEBUG_UART_ATMEL=y | |
40 | +CONFIG_DEBUG_UART_BASE=0xfffff200 | |
41 | +CONFIG_DEBUG_UART_CLOCK=132000000 | |
42 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
43 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
38 | 44 | CONFIG_ATMEL_USART=y |
39 | 45 | CONFIG_DM_SPI=y |
40 | 46 | CONFIG_ATMEL_SPI=y |
configs/at91sam9n12ek_spiflash_defconfig
... | ... | @@ -35,6 +35,12 @@ |
35 | 35 | CONFIG_PINCTRL=y |
36 | 36 | CONFIG_PINCTRL_AT91=y |
37 | 37 | CONFIG_DM_SERIAL=y |
38 | +CONFIG_DEBUG_UART=y | |
39 | +CONFIG_DEBUG_UART_ATMEL=y | |
40 | +CONFIG_DEBUG_UART_BASE=0xfffff200 | |
41 | +CONFIG_DEBUG_UART_CLOCK=132000000 | |
42 | +CONFIG_DEBUG_UART_BOARD_INIT=y | |
43 | +CONFIG_DEBUG_UART_ANNOUNCE=y | |
38 | 44 | CONFIG_ATMEL_USART=y |
39 | 45 | CONFIG_DM_SPI=y |
40 | 46 | CONFIG_ATMEL_SPI=y |