From 94cad75a35158f435ecd04bf93ff9d18a3cd34bd Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Wed, 25 Oct 2023 18:41:16 +0200 Subject: [PATCH] refactor(st): replace STM32MP_EARLY_CONSOLE with EARLY_CONSOLE Now that EARLY_CONSOLE is generic, use it instead of the ST flag. Remove stm32mp_setup_early_console() calls as it is done in common TF-A code. Signed-off-by: Yann Gautier Change-Id: Icac29b62a6267303cb5c679d15847c013ead1d23 --- docs/plat/st/stm32mpus.rst | 2 -- plat/st/common/common.mk | 3 --- plat/st/common/include/stm32mp_common.h | 8 -------- plat/st/common/stm32mp_common.c | 6 +++--- plat/st/stm32mp1/bl2_plat_setup.c | 2 -- plat/st/stm32mp1/sp_min/sp_min_setup.c | 2 -- plat/st/stm32mp2/bl2_plat_setup.c | 1 - 7 files changed, 3 insertions(+), 21 deletions(-) diff --git a/docs/plat/st/stm32mpus.rst b/docs/plat/st/stm32mpus.rst index ab6d8fe51..7b4711278 100644 --- a/docs/plat/st/stm32mpus.rst +++ b/docs/plat/st/stm32mpus.rst @@ -54,8 +54,6 @@ Other configuration flags: | Default: stm32mp157c-ev1.dtb - | ``DWL_BUFFER_BASE``: the 'serial boot' load address of FIP, | default location (end of the first 128MB) is used when absent -- | ``STM32MP_EARLY_CONSOLE``: to enable early traces before clock driver is setup. - | Default: 0 (disabled) - | ``STM32MP_RECONFIGURE_CONSOLE``: to re-configure crash console (especially after BL2). | Default: 0 (disabled) - | ``STM32MP_UART_BAUDRATE``: to select UART baud rate. diff --git a/plat/st/common/common.mk b/plat/st/common/common.mk index b9b62c03f..7ef76652e 100644 --- a/plat/st/common/common.mk +++ b/plat/st/common/common.mk @@ -6,7 +6,6 @@ RESET_TO_BL2 := 1 -STM32MP_EARLY_CONSOLE ?= 0 STM32MP_RECONFIGURE_CONSOLE ?= 0 STM32MP_UART_BAUDRATE ?= 115200 @@ -82,7 +81,6 @@ endif $(eval $(call assert_booleans,\ $(sort \ PLAT_XLAT_TABLES_DYNAMIC \ - STM32MP_EARLY_CONSOLE \ STM32MP_EMMC \ STM32MP_EMMC_BOOT \ STM32MP_RAW_NAND \ @@ -104,7 +102,6 @@ $(eval $(call add_defines,\ $(sort \ PLAT_XLAT_TABLES_DYNAMIC \ STM32_TF_VERSION \ - STM32MP_EARLY_CONSOLE \ STM32MP_EMMC \ STM32MP_EMMC_BOOT \ STM32MP_RAW_NAND \ diff --git a/plat/st/common/include/stm32mp_common.h b/plat/st/common/include/stm32mp_common.h index a1ed1addd..41b86ae0a 100644 --- a/plat/st/common/include/stm32mp_common.h +++ b/plat/st/common/include/stm32mp_common.h @@ -77,14 +77,6 @@ uintptr_t get_uart_address(uint32_t instance_nb); /* Setup the UART console */ int stm32mp_uart_console_setup(void); -#if STM32MP_EARLY_CONSOLE -void stm32mp_setup_early_console(void); -#else -static inline void stm32mp_setup_early_console(void) -{ -} -#endif - /* * Platform util functions for the GPIO driver * @bank: Target GPIO bank ID as per DT bindings diff --git a/plat/st/common/stm32mp_common.c b/plat/st/common/stm32mp_common.c index a1d1c4963..6f36011f9 100644 --- a/plat/st/common/stm32mp_common.c +++ b/plat/st/common/stm32mp_common.c @@ -269,8 +269,8 @@ int stm32mp_uart_console_setup(void) return 0; } -#if STM32MP_EARLY_CONSOLE -void stm32mp_setup_early_console(void) +#if EARLY_CONSOLE +void plat_setup_early_console(void) { #if defined(IMAGE_BL2) || STM32MP_RECONFIGURE_CONSOLE plat_crash_console_init(); @@ -278,7 +278,7 @@ void stm32mp_setup_early_console(void) set_console(STM32MP_DEBUG_USART_BASE, STM32MP_DEBUG_USART_CLK_FRQ); NOTICE("Early console setup\n"); } -#endif /* STM32MP_EARLY_CONSOLE */ +#endif /* EARLY_CONSOLE */ /***************************************************************************** * plat_is_smccc_feature_available() - This function checks whether SMCCC diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 798c033c7..bd3903d3e 100644 --- a/plat/st/stm32mp1/bl2_plat_setup.c +++ b/plat/st/stm32mp1/bl2_plat_setup.c @@ -142,8 +142,6 @@ void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg2 __unused, u_register_t arg3 __unused) { - stm32mp_setup_early_console(); - stm32mp_save_boot_ctx_address(arg0); } diff --git a/plat/st/stm32mp1/sp_min/sp_min_setup.c b/plat/st/stm32mp1/sp_min/sp_min_setup.c index 245b2d324..7bfe6ba56 100644 --- a/plat/st/stm32mp1/sp_min/sp_min_setup.c +++ b/plat/st/stm32mp1/sp_min/sp_min_setup.c @@ -116,8 +116,6 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, bl_params_t *params_from_bl2 = (bl_params_t *)arg0; uintptr_t dt_addr = arg1; - stm32mp_setup_early_console(); - /* Imprecise aborts can be masked in NonSecure */ write_scr(read_scr() | SCR_AW_BIT); diff --git a/plat/st/stm32mp2/bl2_plat_setup.c b/plat/st/stm32mp2/bl2_plat_setup.c index a7cce627c..a09598b38 100644 --- a/plat/st/stm32mp2/bl2_plat_setup.c +++ b/plat/st/stm32mp2/bl2_plat_setup.c @@ -18,7 +18,6 @@ void bl2_el3_early_platform_setup(u_register_t arg0 __unused, u_register_t arg2 __unused, u_register_t arg3 __unused) { - stm32mp_setup_early_console(); } void bl2_platform_setup(void)