Browse Source

feat(st-uart): manage STM32MP_RECONFIGURE_CONSOLE

If the flag STM32MP_RECONFIGURE_CONSOLE is set in BL32, the UART init
should be skipped if the UART clock is set to zero. This will be used
when configuring the default console, after an early console has been
configured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Icbc640c7bdd6342f9c3ec1586a0d0c64127b18b8
pull/1988/merge
Yann Gautier 2 years ago
committed by Yann Gautier
parent
commit
ea69dcdc73
  1. 6
      drivers/st/uart/aarch32/stm32_console.S

6
drivers/st/uart/aarch32/stm32_console.S

@ -46,10 +46,16 @@ func console_stm32_core_init
cmp r0, #0 cmp r0, #0
beq core_init_fail beq core_init_fail
#if !defined(IMAGE_BL2) #if !defined(IMAGE_BL2)
#if STM32MP_RECONFIGURE_CONSOLE
/* UART clock rate is set to 0 in BL32, skip init in that case */
cmp r1, #0
beq 1f
#else /* STM32MP_RECONFIGURE_CONSOLE */
/* Skip UART initialization if it is already enabled */ /* Skip UART initialization if it is already enabled */
ldr r3, [r0, #USART_CR1] ldr r3, [r0, #USART_CR1]
ands r3, r3, #USART_CR1_UE ands r3, r3, #USART_CR1_UE
bne 1f bne 1f
#endif /* STM32MP_RECONFIGURE_CONSOLE */
#endif /* IMAGE_BL2 */ #endif /* IMAGE_BL2 */
/* Check baud rate and uart clock for sanity */ /* Check baud rate and uart clock for sanity */
cmp r1, #0 cmp r1, #0

Loading…
Cancel
Save