diff options
author | Ricardo Salveti <ricardo@foundries.io> | 2021-10-20 15:12:06 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-25 17:17:24 -0400 |
commit | 949eb228f3f807feb338d29e9c94d97c22fa98b6 (patch) | |
tree | ca643d9f848a87bd261ec7855598a6a0d14d41c5 /arch/arm/lib | |
parent | d11d1becbd6ab67c4cc0c19bda2886b28c1fdc02 (diff) |
arm: spl: prepare for jumping to OPTEE
Make sure to (if applicable) flush the D-cache, invalidate I-cache,
and disable MMU and caches before jumping to OPTEE.
This fixes the SDP->SPL->OPTEE boot flow on iMX6Q and most likely on
some other ARM SoCs.
Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r-- | arch/arm/lib/spl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c index 8e2bdf3536..4f9b84ba34 100644 --- a/arch/arm/lib/spl.c +++ b/arch/arm/lib/spl.c @@ -77,3 +77,14 @@ void __noreturn jump_to_image_linux(struct spl_image_info *spl_image) } #endif /* CONFIG_ARM64 */ #endif + +#if CONFIG_IS_ENABLED(OPTEE_IMAGE) +void __noreturn jump_to_image_optee(struct spl_image_info *spl_image) +{ + /* flush and turn off caches before jumping to OPTEE */ + cleanup_before_linux(); + + spl_optee_entry(NULL, NULL, spl_image->fdt_addr, + (void *)spl_image->entry_point); +} +#endif |