[PATCH v2 1/2] board: atmel: sama5d2_wlsom1_ek: Fix spurious serial output

Eugen Hristev eugen.hristev at linaro.org
Mon Apr 7 08:39:42 CEST 2025



On 4/4/25 14:39, Fabio Estevam wrote:
> From: Fabio Estevam <festevam at denx.de>
> 
> Currently, there are always some spurious characters showing up
> right before SPL banner is shown:
> 
> RomBOOT
> ���=������
> U-Boot SPL 2025.04-rc5-00023-g9ed4e2c45f25 (Apr 03 2025 - 23:23:17 -0300)
> Trying to boot from MMC1
> 
> <debug_uart>
> ...
> 
> The reason for the spurious characters is that the UART0 clock is
> being enabled too early, prior to adjusting its correct frequency.
> 
> Fix the problem by removing the early UART0 clock enablement in C code.

I am not convinced.
The purpose of this early UART would be to get output *before* the DM
code would enable clocks, pins, etc, for exactly that purpose, early
debug output.
So to remove all this and make the initialization rely on the SPL DM
code would defeat the purpose.

> 
> SPL DM code will adjust the correct UART0 clock frequency and then enable
> it at the appropriate time.
> 
> Signed-off-by: Fabio Estevam <festevam at denx.de>
> ---
> Changes since v1:
> - Make the minimal change to fix the spurious characters. Improve
> the explanation in the commit log.
> 
>  board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c
> index 04de1257eca0..ff5e51ee3926 100644
> --- a/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c
> +++ b/board/atmel/sama5d27_wlsom1_ek/sama5d27_wlsom1_ek.c
> @@ -45,8 +45,6 @@ static void board_uart0_hw_init(void)
>  {
>  	atmel_pio4_set_c_periph(AT91_PIO_PORTB, 26, ATMEL_PIO_PUEN_MASK);	/* URXD0 */
>  	atmel_pio4_set_c_periph(AT91_PIO_PORTB, 27, 0);				/* UTXD0 */
> -
> -	at91_periph_clk_enable(ATMEL_ID_UART0);
>  }
>  
>  void board_debug_uart_init(void)



More information about the U-Boot mailing list