Browse Source

feat(imx8ulp): add OPTEE support

Add opteed support for imx8ulp.

Signed-off-by: Clement Faure <clement.faure@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: Iddf6f164b7146332e99de42fcbbf9c892eb1d994
pull/2000/merge
Clement Faure 3 years ago
committed by Jacky Bai
parent
commit
e7b82a7d2f
  1. 22
      plat/imx/imx8ulp/imx8ulp_bl31_setup.c
  2. 2
      plat/imx/imx8ulp/include/platform_def.h

22
plat/imx/imx8ulp/imx8ulp_bl31_setup.c

@ -30,7 +30,7 @@
MAP_REGION_FLAT(BL31_BASE, BL31_LIMIT - BL31_BASE, MT_MEMORY | MT_RW | MT_SECURE)
#define MAP_BL31_RO \
MAP_REGION_FLAT(BL_CODE_BASE, BL_CODE_END - BL_CODE_BASE, MT_MEMORY | MT_RO | MT_SECURE)
#define MAP_BL32_TOTAL MAP_REGION_FLAT(BL32_BASE, BL32_SIZE, MT_MEMORY | MT_RW)
#define MAP_COHERENT_MEM \
MAP_REGION_FLAT(BL_COHERENT_RAM_BASE, (BL_COHERENT_RAM_END - BL_COHERENT_RAM_BASE), \
MT_DEVICE | MT_RW | MT_SECURE)
@ -85,6 +85,23 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
bl33_image_ep_info.pc = PLAT_NS_IMAGE_OFFSET;
bl33_image_ep_info.spsr = plat_get_spsr_for_bl33_entry();
SET_SECURITY_STATE(bl33_image_ep_info.h.attr, NON_SECURE);
#if defined(SPD_opteed)
/* 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;
/* Pass TEE base and size to bl33 */
bl33_image_ep_info.args.arg1 = BL32_BASE;
bl33_image_ep_info.args.arg2 = BL32_SIZE;
/* Make sure memory is clean */
mmio_write_32(BL32_FDT_OVERLAY_ADDR, 0);
bl33_image_ep_info.args.arg3 = BL32_FDT_OVERLAY_ADDR;
bl32_image_ep_info.args.arg3 = BL32_FDT_OVERLAY_ADDR;
#endif
}
void bl31_plat_arch_setup(void)
@ -94,6 +111,9 @@ void bl31_plat_arch_setup(void)
MAP_BL31_RO,
#if USE_COHERENT_MEM
MAP_COHERENT_MEM,
#endif
#if (defined(SPD_opteed)
MAP_BL32_TOTAL,
#endif
{0},
};

2
plat/imx/imx8ulp/include/platform_def.h

@ -97,6 +97,8 @@
#define BL31_RWDATA_BASE 0x2006d000
#define BL31_RWDATA_LIMIT 0x20070000
#define BL32_FDT_OVERLAY_ADDR 0x9d000000
/* system memory map define */
#define DEVICE0_MAP MAP_REGION_FLAT(DEVICE0_BASE, DEVICE0_SIZE, MT_DEVICE | MT_RW)
#define DEVICE1_MAP MAP_REGION_FLAT(DEVICE1_BASE, DEVICE1_SIZE, MT_DEVICE | MT_RW)

Loading…
Cancel
Save