Commit 7e87ba25 authored by Yann Gautier's avatar Yann Gautier
Browse files

feat(plat/st): add helper to save boot interface



Some parameters from BootROM boot context can be required after boot.
To save space in SYSRAM, this context can be overwritten during images
load sequence. The needed information (here the boot interface) is
then saved in a local variable.

Change-Id: I5e1ad4630ccf78480f415a0a83939005ae67729e
Signed-off-by: default avatarYann Gautier <yann.gautier@foss.st.com>
parent 91ffc1de
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
/* Functions to save and get boot context address given by ROM code */ /* Functions to save and get boot context address given by ROM code */
void stm32mp_save_boot_ctx_address(uintptr_t address); void stm32mp_save_boot_ctx_address(uintptr_t address);
uintptr_t stm32mp_get_boot_ctx_address(void); uintptr_t stm32mp_get_boot_ctx_address(void);
uint16_t stm32mp_get_boot_itf_selected(void);
bool stm32mp_is_single_core(void); bool stm32mp_is_single_core(void);
bool stm32mp_is_closed_device(void); bool stm32mp_is_closed_device(void);
......
...@@ -28,10 +28,14 @@ unsigned int plat_get_syscnt_freq2(void) ...@@ -28,10 +28,14 @@ unsigned int plat_get_syscnt_freq2(void)
} }
static uintptr_t boot_ctx_address; static uintptr_t boot_ctx_address;
static uint16_t boot_itf_selected;
void stm32mp_save_boot_ctx_address(uintptr_t address) void stm32mp_save_boot_ctx_address(uintptr_t address)
{ {
boot_api_context_t *boot_context = (boot_api_context_t *)address;
boot_ctx_address = address; boot_ctx_address = address;
boot_itf_selected = boot_context->boot_interface_selected;
} }
uintptr_t stm32mp_get_boot_ctx_address(void) uintptr_t stm32mp_get_boot_ctx_address(void)
...@@ -39,6 +43,11 @@ uintptr_t stm32mp_get_boot_ctx_address(void) ...@@ -39,6 +43,11 @@ uintptr_t stm32mp_get_boot_ctx_address(void)
return boot_ctx_address; return boot_ctx_address;
} }
uint16_t stm32mp_get_boot_itf_selected(void)
{
return boot_itf_selected;
}
uintptr_t stm32mp_ddrctrl_base(void) uintptr_t stm32mp_ddrctrl_base(void)
{ {
return DDRCTRL_BASE; return DDRCTRL_BASE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment