diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 9f2d8bd0f2c65c1fe402283c0a7b090f3b9730a6..d85ae96efd0c334c8cda369c03f09659f56f1729 100644 --- a/plat/st/stm32mp1/bl2_plat_setup.c +++ b/plat/st/stm32mp1/bl2_plat_setup.c @@ -8,7 +8,6 @@ #include <assert.h> #include <bl_common.h> #include <boot_api.h> -#include <console.h> #include <debug.h> #include <delay_timer.h> #include <desc_image_load.h> @@ -16,11 +15,12 @@ #include <mmio.h> #include <platform.h> #include <platform_def.h> +#include <stm32_console.h> #include <stm32mp1_clk.h> +#include <stm32mp1_context.h> #include <stm32mp1_dt.h> #include <stm32mp1_pmic.h> #include <stm32mp1_private.h> -#include <stm32mp1_context.h> #include <stm32mp1_pwr.h> #include <stm32mp1_ram.h> #include <stm32mp1_rcc.h> @@ -28,6 +28,8 @@ #include <string.h> #include <xlat_tables_v2.h> +static struct console_stm32 console; + void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3) { @@ -137,8 +139,8 @@ void bl2_el3_plat_arch_setup(void) clk_rate = stm32mp1_clk_get_rate((unsigned long)dt_dev_info.clock); - if (console_init(dt_dev_info.base, clk_rate, - STM32MP1_UART_BAUDRATE) == 0) { + if (console_stm32_register(dt_dev_info.base, clk_rate, + STM32MP1_UART_BAUDRATE, &console) == 0) { panic(); } diff --git a/plat/st/stm32mp1/platform.mk b/plat/st/stm32mp1/platform.mk index 678a8528ed660fa4facf791bd1a2f969b16627ea..f4a0ca4a7a234cfdf17846637083203e3c3d1954 100644 --- a/plat/st/stm32mp1/platform.mk +++ b/plat/st/stm32mp1/platform.mk @@ -8,6 +8,7 @@ ARM_CORTEX_A7 := yes ARM_WITH_NEON := yes BL2_AT_EL3 := 1 USE_COHERENT_MEM := 0 +MULTI_CONSOLE_API := 1 STM32_TF_VERSION ?= 0 diff --git a/plat/st/stm32mp1/sp_min/sp_min_setup.c b/plat/st/stm32mp1/sp_min/sp_min_setup.c index 56598c8be7b3d5df3e88be130e9a0fbd4789431b..bd4f2ec01e966aeb1d6d27e99363d69ca8d665b1 100644 --- a/plat/st/stm32mp1/sp_min/sp_min_setup.c +++ b/plat/st/stm32mp1/sp_min/sp_min_setup.c @@ -7,7 +7,6 @@ #include <arch_helpers.h> #include <assert.h> #include <bl_common.h> -#include <console.h> #include <context.h> #include <context_mgmt.h> #include <debug.h> @@ -17,6 +16,7 @@ #include <platform.h> #include <platform_def.h> #include <platform_sp_min.h> +#include <stm32_console.h> #include <stm32mp1_clk.h> #include <stm32mp1_dt.h> #include <stm32mp1_private.h> @@ -30,6 +30,8 @@ ******************************************************************************/ static entry_point_info_t bl33_image_ep_info; +static struct console_stm32 console; + /******************************************************************************* * Interrupt handler for FIQ (secure IRQ) ******************************************************************************/ @@ -112,8 +114,9 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1, result = dt_get_stdout_uart_info(&dt_dev_info); if ((result > 0) && dt_dev_info.status) { - if (console_init(dt_dev_info.base, 0, STM32MP1_UART_BAUDRATE) - == 0) { + if (console_stm32_register(dt_dev_info.base, 0, + STM32MP1_UART_BAUDRATE, &console) == + 0) { panic(); } } diff --git a/plat/st/stm32mp1/stm32mp1_helper.S b/plat/st/stm32mp1/stm32mp1_helper.S index b0ea0d8edd42f7d1761a682560a9f88757abfbe3..673706eed02d17f262c34f0a723f11d264edb1a1 100644 --- a/plat/st/stm32mp1/stm32mp1_helper.S +++ b/plat/st/stm32mp1/stm32mp1_helper.S @@ -149,7 +149,7 @@ func plat_crash_console_init ldr r0, =STM32MP1_DEBUG_USART_BASE ldr r1, =STM32MP1_HSI_CLK ldr r2, =STM32MP1_UART_BAUDRATE - b console_core_init + b console_stm32_core_init endfunc plat_crash_console_init /* --------------------------------------------- @@ -160,7 +160,7 @@ endfunc plat_crash_console_init */ func plat_crash_console_flush ldr r1, =STM32MP1_DEBUG_USART_BASE - b console_core_flush + b console_stm32_core_flush endfunc plat_crash_console_flush /* --------------------------------------------- @@ -176,5 +176,5 @@ endfunc plat_crash_console_flush */ func plat_crash_console_putc ldr r1, =STM32MP1_DEBUG_USART_BASE - b console_core_putc + b console_stm32_core_putc endfunc plat_crash_console_putc