diff options
author | Ye Li <ye.li@nxp.com> | 2025-04-28 18:37:36 +0800 |
---|---|---|
committer | Fabio Estevam <festevam@gmail.com> | 2025-05-03 16:55:32 -0300 |
commit | 2f8b24d5cc34e5c4c466a29539e5a01b14423cac (patch) | |
tree | 4680e6a509b5352d1558b8981bf29ea1c5a30344 /arch/arm/mach-imx/imx9/scmi/soc.c | |
parent | 92f724736c8203cdf8cb6d39a2d857e5f944e54a (diff) |
spl: imx: use trampoline buffer to load images to secure region
When SPL loading image to secure region, for example, ATF and tee to
DDR secure region. Because the USDHC controller is non-secure master,
it can't access this region and will cause loading issue.
So use a trampoline buffer in non-secure region, then use CPU to copy the
image from trampoline buffer to destination secure region.
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm/mach-imx/imx9/scmi/soc.c')
-rw-r--r-- | arch/arm/mach-imx/imx9/scmi/soc.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c index 3a5bdddd785..d2b0455bff9 100644 --- a/arch/arm/mach-imx/imx9/scmi/soc.c +++ b/arch/arm/mach-imx/imx9/scmi/soc.c @@ -729,3 +729,21 @@ enum boot_device get_boot_device(void) return boot_dev; } #endif + +bool arch_check_dst_in_secure(void *start, ulong size) +{ + ulong ns_end = CFG_SYS_SDRAM_BASE + PHYS_SDRAM_SIZE; +#ifdef PHYS_SDRAM_2_SIZE + ns_end += PHYS_SDRAM_2_SIZE; +#endif + + if ((ulong)start < CFG_SYS_SDRAM_BASE || (ulong)start + size > ns_end) + return true; + + return false; +} + +void *arch_get_container_trampoline(void) +{ + return (void *)((ulong)CFG_SYS_SDRAM_BASE + PHYS_SDRAM_SIZE - SZ_16M); +} |