stm32mp1: save boot information in backup registers
This will be used by BL33 to get boot device and instance.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Mathieu Belou <mathieu.belou@st.com>
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c
index 6128c5e..125d2cc 100644
--- a/plat/st/stm32mp1/bl2_plat_setup.c
+++ b/plat/st/stm32mp1/bl2_plat_setup.c
@@ -19,6 +19,7 @@
#include <stm32mp1_clk.h>
#include <stm32mp1_dt.h>
#include <stm32mp1_private.h>
+#include <stm32mp1_context.h>
#include <stm32mp1_pwr.h>
#include <stm32mp1_rcc.h>
#include <string.h>
@@ -37,6 +38,9 @@
void bl2_el3_plat_arch_setup(void)
{
+ boot_api_context_t *boot_context =
+ (boot_api_context_t *)stm32mp1_get_boot_ctx_address();
+
/*
* Disable the backup domain write protection.
* The protection is enable at each reset by hardware
@@ -90,5 +94,11 @@
panic();
}
+ if (stm32_save_boot_interface(boot_context->boot_interface_selected,
+ boot_context->boot_interface_instance) !=
+ 0) {
+ ERROR("Cannot save boot interface\n");
+ }
+
stm32mp1_io_setup();
}