summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@mailbox.org>2025-10-30 22:23:50 +0100
committerTom Rini <trini@konsulko.com>2025-11-06 11:26:18 -0600
commitbe0e9ac7c8a141fbc52f658fbfdd96cf2c27d0de (patch)
tree3cd8720729a659a427bd7ca9af0fa1565a91020a /common
parent20861863eb3010581b12e9a77eb7958460edaa82 (diff)
spl: fit: Add ability to jump to Linux via OPTEE-OS on ARMv7a
Add support for jumping to Linux kernel through OPTEE-OS on ARMv7a to SPL. This is already supported on ARMv8a, this patch adds the ARMv7a support. Extend the SPL fitImage loader to record OPTEE-OS load address and in case the load address is non-zero, use the same bootm-optee.S code used by the U-Boot fitImage jump code to start OPTEE-OS first and jump to Linux next. Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_fit.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 746c3d2fa28..616df46e1c8 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -550,6 +550,23 @@ static int spl_fit_image_is_fpga(const void *fit, int node)
return !strcmp(type, "fpga");
}
+static void spl_fit_image_record_arm32_optee(const void *fit, int node,
+ struct spl_image_info *spl_image,
+ struct spl_image_info *image_info)
+{
+#if defined(CONFIG_BOOTM_OPTEE) && defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
+ const char *type = fdt_getprop(fit, node, FIT_TYPE_PROP, NULL);
+
+ if (!type)
+ return;
+
+ if (strcmp(type, "tee"))
+ return;
+
+ spl_image->optee_addr = image_info->load_addr;
+#endif
+}
+
static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
{
if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) || CONFIG_IS_ENABLED(OS_BOOT))
@@ -903,6 +920,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
image_info.entry_point != FDT_ERROR)
spl_image->entry_point = image_info.entry_point;
+ spl_fit_image_record_arm32_optee(ctx.fit, node, spl_image,
+ &image_info);
+
/* Record our loadables into the FDT */
if (!CONFIG_IS_ENABLED(FIT_IMAGE_TINY) &&
xpl_get_fdt_update(info) && spl_image->fdt_addr)