diff options
author | Silvano di Ninno <silvano.dininno@nxp.com> | 2018-11-19 17:58:06 +0100 |
---|---|---|
committer | Silvano di Ninno <silvano.dininno@nxp.com> | 2018-11-26 09:55:01 +0100 |
commit | 8907cbb2dd9acac6642d592231f6072d6e65677e (patch) | |
tree | 0b9c2067c993df7263cf08507833bedc76fcae92 /plat/imx/imx8qxp | |
parent | 57dd0339d9123e5643d425f2b8d5cfdb839c8c59 (diff) |
TEE-329-3: OP-TEE add share memory
configure OP-TEE Share memory to be accessible by OS.
Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
(cherry picked from commit 0b5eeb7e0dbe50ebd7f3d0ce66047569504e9d52)
Diffstat (limited to 'plat/imx/imx8qxp')
-rw-r--r-- | plat/imx/imx8qxp/imx8qxp_bl31_setup.c | 19 | ||||
-rw-r--r-- | plat/imx/imx8qxp/include/platform_def.h | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/plat/imx/imx8qxp/imx8qxp_bl31_setup.c b/plat/imx/imx8qxp/imx8qxp_bl31_setup.c index 73bc834e..89ee64a3 100644 --- a/plat/imx/imx8qxp/imx8qxp_bl31_setup.c +++ b/plat/imx/imx8qxp/imx8qxp_bl31_setup.c @@ -225,8 +225,14 @@ void imx8_partition_resources(void) if (err) { ERROR("Memreg get info failed, %u\n", mr_tee); } else { - if ((BL32_LIMIT - 1) < end) { - err = sc_rm_memreg_alloc(ipc_handle, &mr, BL32_LIMIT , end); +#ifdef SPD_trusty + reg_start = BL32_LIMIT; +#else + /* Allow share memory to be accessible by OS */ + reg_start = BL32_LIMIT - BL32_SHM_SIZE; +#endif + if ((reg_start -1) < end) { + err = sc_rm_memreg_alloc(ipc_handle, &mr, reg_start , end); if (err) { ERROR("sc_rm_memreg_alloc failed, 0x%lx -- 0x%lx\n", (sc_faddr_t)BL32_LIMIT, end); } else { @@ -275,8 +281,13 @@ void imx8_partition_resources(void) } #ifdef TEE_IMX8 if (mr_tee_atf_same) { - if ((BL32_LIMIT - 1) < end) { - reg_start = BL32_LIMIT; +#ifdef SPD_trusty + reg_start = BL32_LIMIT; +#else + /* Allow share memory to be accessible by OS */ + reg_start = BL32_LIMIT - BL32_SHM_SIZE; +#endif + if ((reg_start -1) < end) { err = sc_rm_memreg_alloc(ipc_handle, &mr, reg_start, end); if (err) { ERROR("sc_rm_memreg_alloc failed, 0x%lx -- 0x%lx\n", reg_start, end); diff --git a/plat/imx/imx8qxp/include/platform_def.h b/plat/imx/imx8qxp/include/platform_def.h index 07e08f83..4b656a79 100644 --- a/plat/imx/imx8qxp/include/platform_def.h +++ b/plat/imx/imx8qxp/include/platform_def.h @@ -31,6 +31,7 @@ #ifdef TEE_IMX8 #define BL32_BASE 0xfe000000 #define BL32_SIZE 0x02000000 +#define BL32_SHM_SIZE 0x00400000 #define BL32_LIMIT 0x100000000 #define PLAT_TEE_IMAGE_OFFSET 0x84000000 #endif |