]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(st-uart): manage STM32MP_RECONFIGURE_CONSOLE
authorYann Gautier <yann.gautier@foss.st.com>
Tue, 13 Sep 2022 11:55:43 +0000 (13:55 +0200)
committerYann Gautier <yann.gautier@st.com>
Fri, 23 Sep 2022 13:17:43 +0000 (15:17 +0200)
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

drivers/st/uart/aarch32/stm32_console.S

index e467f0987ca2c79755649ab3c32b5d8740c2a5d8..e3e0e67d39efab82db3e505b99b189fa2600727c 100644 (file)
@@ -46,10 +46,16 @@ func console_stm32_core_init
        cmp     r0, #0
        beq     core_init_fail
 #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 */
        ldr     r3, [r0, #USART_CR1]
        ands    r3, r3, #USART_CR1_UE
        bne     1f
+#endif /* STM32MP_RECONFIGURE_CONSOLE */
 #endif /* IMAGE_BL2 */
        /* Check baud rate and uart clock for sanity */
        cmp     r1, #0