diff options
author | Ji Luo <ji.luo@nxp.com> | 2020-02-21 16:32:53 +0800 |
---|---|---|
committer | Jacky Bai <ping.bai@nxp.com> | 2022-05-07 17:33:58 +0800 |
commit | 99349c8ecba910dabbaa72b9be91f3ed762036f5 (patch) | |
tree | 93c827c6345618bcee8b5f3b6ab804be5f3aaa67 /plat/imx | |
parent | ff3acfe3cc1658917376152913a9d1b5b9b8de34 (diff) | |
download | arm-trusted-firmware-99349c8ecba910dabbaa72b9be91f3ed762036f5.tar.gz |
feat(imx8mn): enable Trusty OS for imx8mn
Add trusty support for imx8mn, default load address and
size of trusty are 0xbe000000 and 0x2000000.
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: I63fd5159027d7400b8c6bfc03193dd1330c43140
Diffstat (limited to 'plat/imx')
-rw-r--r-- | plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c index e1bcd5065..7e3a0b622 100644 --- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c +++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c @@ -28,6 +28,8 @@ #include <platform_def.h> #include <plat_imx8.h> +#define TRUSTY_PARAMS_LEN_BYTES (4096*2) + static const mmap_region_t imx_mmap[] = { GIC_MAP, AIPS_MAP, OCRAM_S_MAP, DDRC_MAP, {0}, }; @@ -151,13 +153,18 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, bl33_image_ep_info.spsr = get_spsr_for_bl33_entry(); SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE); -#ifdef SPD_opteed +#if defined(SPD_opteed) || defined(SPD_trusty) /* Populate entry point information for BL32 */ SET_PARAM_HEAD(&bl32_image_ep_info, PARAM_EP, VERSION_1, 0); SET_SECURITY_STATE(bl32_image_ep_info.h.attr, SECURE); bl32_image_ep_info.pc = BL32_BASE; bl32_image_ep_info.spsr = 0; +#ifdef SPD_trusty + bl32_image_ep_info.args.arg0 = BL32_SIZE; + bl32_image_ep_info.args.arg1 = BL32_BASE; +#endif + /* Pass TEE base and size to bl33 */ bl33_image_ep_info.args.arg1 = BL32_BASE; bl33_image_ep_info.args.arg2 = BL32_SIZE; @@ -177,6 +184,10 @@ void bl31_plat_arch_setup(void) (BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE), MT_DEVICE | MT_RW | MT_SECURE); #endif + + /* Map TEE memory */ + mmap_add_region(BL32_BASE, BL32_BASE, BL32_SIZE, MT_MEMORY | MT_RW); + mmap_add(imx_mmap); init_xlat_tables(); @@ -211,3 +222,12 @@ unsigned int plat_get_syscnt_freq2(void) { return COUNTER_FREQUENCY; } + +#ifdef SPD_trusty +void plat_trusty_set_boot_args(aapcs64_params_t *args) +{ + args->arg0 = BL32_SIZE; + args->arg1 = BL32_BASE; + args->arg2 = TRUSTY_PARAMS_LEN_BYTES; +} +#endif |