diff options
author | Ji Luo <ji.luo@nxp.com> | 2020-02-21 11:19:49 +0800 |
---|---|---|
committer | Jacky Bai <ping.bai@nxp.com> | 2022-05-07 17:33:58 +0800 |
commit | a18e393339e1d481f4fdf0d621fe4f39ce93a4fe (patch) | |
tree | 678df539df7206eedac77422b7db7d27c41c11f6 /plat/imx/imx8m | |
parent | 99349c8ecba910dabbaa72b9be91f3ed762036f5 (diff) | |
download | arm-trusted-firmware-a18e393339e1d481f4fdf0d621fe4f39ce93a4fe.tar.gz |
feat(imx8mq): enable trusty for imx8mq
Add trusty support for imx8mq, default load address
and size for trusty os will be 0xfe000000 and 0x2000000.
Signed-off-by: Ji Luo <ji.luo@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: I2b35ee525b25b80bf6c9599a0adcc2d9f069aa41
Diffstat (limited to 'plat/imx/imx8m')
-rw-r--r-- | plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 21 | ||||
-rw-r--r-- | plat/imx/imx8m/imx8mq/include/platform_def.h | 7 |
2 files changed, 26 insertions, 2 deletions
diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c index ea46e1c46..58ee7a9cf 100644 --- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c @@ -27,6 +27,8 @@ #include <imx8m_caam.h> #include <plat_imx8.h> +#define TRUSTY_PARAMS_LEN_BYTES (4096*2) + static const mmap_region_t imx_mmap[] = { MAP_REGION_FLAT(GPV_BASE, GPV_SIZE, MT_DEVICE | MT_RW), /* GPV map */ MAP_REGION_FLAT(IMX_ROM_BASE, IMX_ROM_SIZE, MT_MEMORY | MT_RO), /* ROM map */ @@ -146,13 +148,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; @@ -168,6 +175,9 @@ void bl31_plat_arch_setup(void) mmap_add_region(BL_CODE_BASE, BL_CODE_BASE, (BL_CODE_END - BL_CODE_BASE), MT_MEMORY | MT_RO | MT_SECURE); + /* Map TEE memory */ + mmap_add_region(BL32_BASE, BL32_BASE, BL32_SIZE, MT_MEMORY | MT_RW); + mmap_add(imx_mmap); #if USE_COHERENT_MEM @@ -215,3 +225,12 @@ void bl31_plat_runtime_setup(void) { return; } + +#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 diff --git a/plat/imx/imx8m/imx8mq/include/platform_def.h b/plat/imx/imx8m/imx8mq/include/platform_def.h index 6d6a8650e..801c7136e 100644 --- a/plat/imx/imx8m/imx8mq/include/platform_def.h +++ b/plat/imx/imx8m/imx8mq/include/platform_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2022, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -43,8 +43,13 @@ #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 32) #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 32) +#ifdef SPD_trusty +#define MAX_XLAT_TABLES 5 +#define MAX_MMAP_REGIONS 15 +#else #define MAX_XLAT_TABLES 4 #define MAX_MMAP_REGIONS 14 +#endif #define HAB_RVT_BASE U(0x00000880) /* HAB_RVT for i.MX8MQ */ |