mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-09 02:51:21 +00:00
feat(stm32mp1): update console management for SP_min
Use stm32mp_uart_console_setup() in SP_min setup. Adapt the function stm32mp_uart_console_setup() for BL32 (no reset, add CONSOLE_FLAG_RUNTIME under DEBUG. Change-Id: Ib2d35c8d285dafb680aa218872ad679cbf43d0ed Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
parent
86240942fa
commit
aafff04354
2 changed files with 10 additions and 23 deletions
|
@ -134,6 +134,7 @@ int stm32mp_unmap_ddr(void)
|
||||||
STM32MP_DDR_MAX_SIZE);
|
STM32MP_DDR_MAX_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(IMAGE_BL2)
|
||||||
static void reset_uart(uint32_t reset)
|
static void reset_uart(uint32_t reset)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -152,6 +153,7 @@ static void reset_uart(uint32_t reset)
|
||||||
|
|
||||||
mdelay(1);
|
mdelay(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int stm32mp_uart_console_setup(void)
|
int stm32mp_uart_console_setup(void)
|
||||||
{
|
{
|
||||||
|
@ -169,13 +171,17 @@ int stm32mp_uart_console_setup(void)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(IMAGE_BL2)
|
||||||
if (dt_set_stdout_pinctrl() != 0) {
|
if (dt_set_stdout_pinctrl() != 0) {
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
stm32mp_clk_enable((unsigned long)dt_uart_info.clock);
|
stm32mp_clk_enable((unsigned long)dt_uart_info.clock);
|
||||||
|
|
||||||
|
#if defined(IMAGE_BL2)
|
||||||
reset_uart((uint32_t)dt_uart_info.reset);
|
reset_uart((uint32_t)dt_uart_info.reset);
|
||||||
|
#endif
|
||||||
|
|
||||||
clk_rate = stm32mp_clk_get_rate((unsigned long)dt_uart_info.clock);
|
clk_rate = stm32mp_clk_get_rate((unsigned long)dt_uart_info.clock);
|
||||||
|
|
||||||
|
@ -186,6 +192,9 @@ int stm32mp_uart_console_setup(void)
|
||||||
|
|
||||||
console_flags = CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH |
|
console_flags = CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH |
|
||||||
CONSOLE_FLAG_TRANSLATE_CRLF;
|
CONSOLE_FLAG_TRANSLATE_CRLF;
|
||||||
|
#if !defined(IMAGE_BL2) && defined(DEBUG)
|
||||||
|
console_flags |= CONSOLE_FLAG_RUNTIME;
|
||||||
|
#endif
|
||||||
console_set_scope(&console, console_flags);
|
console_set_scope(&console, console_flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <drivers/generic_delay_timer.h>
|
#include <drivers/generic_delay_timer.h>
|
||||||
#include <drivers/st/bsec.h>
|
#include <drivers/st/bsec.h>
|
||||||
#include <drivers/st/etzpc.h>
|
#include <drivers/st/etzpc.h>
|
||||||
#include <drivers/st/stm32_console.h>
|
|
||||||
#include <drivers/st/stm32_gpio.h>
|
#include <drivers/st/stm32_gpio.h>
|
||||||
#include <drivers/st/stm32_iwdg.h>
|
#include <drivers/st/stm32_iwdg.h>
|
||||||
#include <drivers/st/stm32mp1_clk.h>
|
#include <drivers/st/stm32mp1_clk.h>
|
||||||
|
@ -36,8 +35,6 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
static entry_point_info_t bl33_image_ep_info;
|
static entry_point_info_t bl33_image_ep_info;
|
||||||
|
|
||||||
static console_t console;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Interrupt handler for FIQ (secure IRQ)
|
* Interrupt handler for FIQ (secure IRQ)
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
@ -115,8 +112,6 @@ static void stm32mp1_etzpc_early_setup(void)
|
||||||
void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||||
u_register_t arg2, u_register_t arg3)
|
u_register_t arg2, u_register_t arg3)
|
||||||
{
|
{
|
||||||
struct dt_node_info dt_uart_info;
|
|
||||||
int result;
|
|
||||||
bl_params_t *params_from_bl2 = (bl_params_t *)arg0;
|
bl_params_t *params_from_bl2 = (bl_params_t *)arg0;
|
||||||
#if STM32MP_USE_STM32IMAGE
|
#if STM32MP_USE_STM32IMAGE
|
||||||
uintptr_t dt_addr = STM32MP_DTB_BASE;
|
uintptr_t dt_addr = STM32MP_DTB_BASE;
|
||||||
|
@ -174,24 +169,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||||
panic();
|
panic();
|
||||||
}
|
}
|
||||||
|
|
||||||
result = dt_get_stdout_uart_info(&dt_uart_info);
|
(void)stm32mp_uart_console_setup();
|
||||||
|
|
||||||
if ((result > 0) && (dt_uart_info.status != 0U)) {
|
|
||||||
unsigned int console_flags;
|
|
||||||
|
|
||||||
if (console_stm32_register(dt_uart_info.base, 0,
|
|
||||||
STM32MP_UART_BAUDRATE, &console) ==
|
|
||||||
0) {
|
|
||||||
panic();
|
|
||||||
}
|
|
||||||
|
|
||||||
console_flags = CONSOLE_FLAG_BOOT | CONSOLE_FLAG_CRASH |
|
|
||||||
CONSOLE_FLAG_TRANSLATE_CRLF;
|
|
||||||
#ifdef DEBUG
|
|
||||||
console_flags |= CONSOLE_FLAG_RUNTIME;
|
|
||||||
#endif
|
|
||||||
console_set_scope(&console, console_flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
stm32mp1_etzpc_early_setup();
|
stm32mp1_etzpc_early_setup();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue