diff options
author | Jun Nie <jun.nie@linaro.org> | 2021-04-23 11:39:31 +0800 |
---|---|---|
committer | Jun Nie <jun.nie@linaro.org> | 2021-04-23 11:39:31 +0800 |
commit | 9b0958f2b03dab5399a66fb65d620500dd12b824 (patch) | |
tree | 74a5eb41060505e60d52ef3d132f28f21d36b498 | |
parent | 7f4ae63301c7ba85449cd491a4770c19159dc24c (diff) |
plat: imx8m: Add spmc manifest image
Add spmc manifest image loading info
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Change-Id: I480bb5684817681db5b77ccd9214853bcf2b636b
-rw-r--r-- | plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c | 13 | ||||
-rw-r--r-- | plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 8 | ||||
-rw-r--r-- | plat/imx/imx8m/imx8mp/imx8mp_io_storage.c | 13 | ||||
-rw-r--r-- | plat/imx/imx8m/imx8mp/include/platform_def.h | 4 |
4 files changed, 36 insertions, 2 deletions
diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c b/plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c index c40609517..2e39fe6a8 100644 --- a/plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c +++ b/plat/imx/imx8m/imx8mp/imx8mp_bl2_mem_params_desc.c @@ -54,6 +54,19 @@ static bl_mem_params_node_t bl2_mem_params_descs[] = { .next_handoff_image_id = INVALID_IMAGE_ID, }, + /* Fill TOS_FW_CONFIG related information */ + { + .image_id = TOS_FW_CONFIG_ID, + SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP, + VERSION_2, entry_point_info_t, SECURE | NON_EXECUTABLE), + SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY, + VERSION_2, image_info_t, 0), +#ifdef SPD_spmd + .image_info.image_base = SPM_MANIFEST_LOAD_BASE, + .image_info.image_max_size = SPM_MANIFEST_MAX_SIZE, +#endif + .next_handoff_image_id = INVALID_IMAGE_ID, + }, { /* This is a zero sized image so we don't set base or size */ .image_id = BL32_EXTRA2_IMAGE_ID, diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c index d4d958a88..e9f915a2a 100644 --- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c +++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c @@ -153,7 +153,7 @@ 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); -#if defined(SPD_opteed) || defined(SPD_trusty) +#if defined(SPD_opteed) || defined(SPD_trusty) || defined(SPD_spmd) /* 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); @@ -167,7 +167,11 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, #ifdef SPD_trusty bl32_image_ep_info.args.arg0 = BL32_SIZE; bl32_image_ep_info.args.arg1 = BL32_BASE; -#else +#endif +#ifdef SPD_spmd + bl32_image_ep_info.args.arg0 = SPM_MANIFEST_LOAD_BASE; +#endif +#ifdef SPD_trusty /* Make sure memory is clean */ mmio_write_32(BL32_FDT_OVERLAY_ADDR, 0); bl33_image_ep_info.args.arg3 = BL32_FDT_OVERLAY_ADDR; diff --git a/plat/imx/imx8m/imx8mp/imx8mp_io_storage.c b/plat/imx/imx8m/imx8mp/imx8mp_io_storage.c index 7ca5b1338..0f4e43b64 100644 --- a/plat/imx/imx8m/imx8mp/imx8mp_io_storage.c +++ b/plat/imx/imx8m/imx8mp/imx8mp_io_storage.c @@ -77,6 +77,12 @@ static const io_uuid_spec_t bl32_extra2_uuid_spec = { .uuid = UUID_SECURE_PAYLOAD_BL32_EXTRA2, }; +#ifdef SPD_spmd +static const io_uuid_spec_t tos_fw_uuid_spec = { + .uuid = UUID_TOS_FW_CONFIG, +}; +#endif + static const io_uuid_spec_t bl33_uuid_spec = { .uuid = UUID_NON_TRUSTED_FIRMWARE_BL33, }; @@ -155,6 +161,13 @@ static const struct plat_io_policy policies[] = { (uintptr_t)&bl32_extra2_uuid_spec, open_fip }, +#ifdef SPD_spmd + [TOS_FW_CONFIG_ID] = { + &fip_dev_handle, + (uintptr_t)&tos_fw_uuid_spec, + open_fip + }, +#endif [BL33_IMAGE_ID] = { &fip_dev_handle, (uintptr_t)&bl33_uuid_spec, diff --git a/plat/imx/imx8m/imx8mp/include/platform_def.h b/plat/imx/imx8m/imx8mp/include/platform_def.h index 5acf69b43..7c55d949d 100644 --- a/plat/imx/imx8m/imx8mp/include/platform_def.h +++ b/plat/imx/imx8m/imx8mp/include/platform_def.h @@ -53,6 +53,10 @@ #define BL31_LIMIT U(0x990000) #endif +#define SPM_MANIFEST_LOAD_BASE U(0x67000000) +#define SPM_MANIFEST_MAX_SIZE U(0x20000) + + /* non-secure uboot base */ #define PLAT_NS_IMAGE_OFFSET U(0x40200000) #define PLAT_NS_IMAGE_SIZE U(0x00100000) |