From cce37d44a9436f73ef8ceda294f290689151712b Mon Sep 17 00:00:00 2001 From: Yann Gautier <yann.gautier@st.com> Date: Wed, 14 Nov 2018 18:46:15 +0100 Subject: [PATCH] stm32mp1: use MULTI_CONSOLE_API Signed-off-by: Yann Gautier <yann.gautier@st.com> --- plat/st/stm32mp1/bl2_plat_setup.c | 10 ++++++---- plat/st/stm32mp1/platform.mk | 1 + plat/st/stm32mp1/sp_min/sp_min_setup.c | 9 ++++++--- plat/st/stm32mp1/stm32mp1_helper.S | 6 +++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 9f2d8bd0f..d85ae96ef 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 678a8528e..f4a0ca4a7 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 56598c8be..bd4f2ec01 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 b0ea0d8ed..673706eed 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 -- GitLab