From 02d1813e8701752ec6bb23ad0c1e68be2f4b38e4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 18 Jan 2024 09:59:59 +0100 Subject: [PATCH] feat(imx93): optionally take params from BL2 Optionally take params from BL2 to offer more flexibility to BL2 on where and if a BL32 image is expected. This uses imx_bl31_params_parse() to check if arg0 can safely be accessed as a pointer and actually contains a bl_params_t structure. If not, the hardcoded parameter values are used as before. Change-Id: Iec885405efd31a6bf6c0e6c532f8d2f31c023333 Signed-off-by: Sascha Hauer --- plat/imx/imx93/imx93_bl31_setup.c | 4 ++++ plat/imx/imx93/include/platform_def.h | 3 +++ plat/imx/imx93/platform.mk | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plat/imx/imx93/imx93_bl31_setup.c b/plat/imx/imx93/imx93_bl31_setup.c index 8458f6c13..6c9e1fd0c 100644 --- a/plat/imx/imx93/imx93_bl31_setup.c +++ b/plat/imx/imx93/imx93_bl31_setup.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -90,6 +91,9 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, bl33_image_ep_info.args.arg3 = BL32_FDT_OVERLAY_ADDR; bl32_image_ep_info.args.arg3 = BL32_FDT_OVERLAY_ADDR; #endif + + imx_bl31_params_parse(arg0, OCRAM_BASE, OCRAM_SIZE, + &bl32_image_ep_info, &bl33_image_ep_info); } void bl31_plat_arch_setup(void) diff --git a/plat/imx/imx93/include/platform_def.h b/plat/imx/imx93/include/platform_def.h index 7efbf1c63..f0d53cdef 100644 --- a/plat/imx/imx93/include/platform_def.h +++ b/plat/imx/imx93/include/platform_def.h @@ -31,6 +31,9 @@ #define BL31_BASE U(0x204E0000) #define BL31_LIMIT U(0x20520000) +#define OCRAM_BASE U(0x20480000) +#define OCRAM_SIZE U(0xA0000) + /* non-secure uboot base */ /* TODO */ #define PLAT_NS_IMAGE_OFFSET U(0x80200000) diff --git a/plat/imx/imx93/platform.mk b/plat/imx/imx93/platform.mk index f2dfb3272..f506d8b15 100644 --- a/plat/imx/imx93/platform.mk +++ b/plat/imx/imx93/platform.mk @@ -19,7 +19,8 @@ IMX_GIC_SOURCES := ${GICV3_SOURCES} \ plat/common/plat_psci_common.c \ plat/imx/common/plat_imx8_gic.c -BL31_SOURCES += plat/common/aarch64/crash_console_helpers.S \ +BL31_SOURCES += common/desc_image_load.c \ + plat/common/aarch64/crash_console_helpers.S \ plat/imx/imx93/aarch64/plat_helpers.S \ plat/imx/imx93/plat_topology.c \ plat/imx/common/imx_common.c \