diff options
author | Sughosh Ganu <sughosh.ganu@linaro.org> | 2019-10-03 11:45:32 +0530 |
---|---|---|
committer | Sughosh Ganu <sughosh.ganu@arm.com> | 2019-10-03 11:54:45 +0530 |
commit | de3166232a8542c95edf82eb7637479674b80103 (patch) | |
tree | b243774cffe3b2c0d1def31e609c6a362ccfdf48 | |
parent | 44f566b87f3ddb7631ac4b5ff0e49d80bfc4f50e (diff) |
plat: qemu: Assign a region of memory for MM_COMMUNICATE buffermm_variable
The Secure Partition Manager(SPM) carves out a chunk of memory from
the secure memory region as a buffer for MM_COMMUNICATE. This buffer
is used for sharing of data between non-secure and secure worlds, and
the memory is carved out by configuring the trustzone controller(tzc)
appropriately.
However, the qemu platform does not include a tzc, but has hardcoded
memory map for secure and non-secure memory regions. Thus it is not
possible to have this region carved out using the tzc. Work around
this design by allocating a region of non-secure dram memory, starting
from 0xC0000000 for this buffer. Create a mapping for this region and
also update the data structure passed to StandaloneMm to indicate this
region.
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
-rw-r--r-- | plat/qemu/common/qemu_common.c | 4 | ||||
-rw-r--r-- | plat/qemu/qemu/include/platform_def.h | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/plat/qemu/common/qemu_common.c b/plat/qemu/common/qemu_common.c index 70ca3d7b9..9deb5746e 100644 --- a/plat/qemu/common/qemu_common.c +++ b/plat/qemu/common/qemu_common.c @@ -98,7 +98,7 @@ static const mmap_region_t plat_qemu_mmap[] = { const mmap_region_t plat_qemu_secure_partition_mmap[] = { PLAT_ARM_SECURE_MAP_DEVICE, ARM_SP_IMAGE_MMAP, - ARM_SP_IMAGE_NS_BUF_MMAP, + ARM_PLAT_SP_IMAGE_NS_BUF_MMAP, ARM_SP_IMAGE_RW_MMAP, ARM_SPM_BUF_EL0_MMAP, {0} @@ -141,7 +141,7 @@ const secure_partition_boot_info_t plat_qemu_secure_partition_boot_info = { .sp_image_base = ARM_SP_IMAGE_BASE, .sp_stack_base = PLAT_SP_IMAGE_STACK_BASE, .sp_heap_base = ARM_SP_IMAGE_HEAP_BASE, - .sp_ns_comm_buf_base = PLAT_SP_IMAGE_NS_BUF_BASE, + .sp_ns_comm_buf_base = SP_IMAGE_NS_BUF_BASE, .sp_shared_buf_base = PLAT_SPM_BUF_BASE, .sp_image_size = ARM_SP_IMAGE_SIZE, .sp_pcpu_stack_size = PLAT_SP_IMAGE_STACK_PCPU_SIZE, diff --git a/plat/qemu/qemu/include/platform_def.h b/plat/qemu/qemu/include/platform_def.h index 608fe1f67..1c4aabbd2 100644 --- a/plat/qemu/qemu/include/platform_def.h +++ b/plat/qemu/qemu/include/platform_def.h @@ -280,4 +280,14 @@ SECURE_UART_DEVICE_SIZE, \ MT_DEVICE | MT_RW | MT_SECURE | MT_USER) +#define SP_IMAGE_NS_BUF_BASE 0xC0000000UL +#define SP_IMAGE_NS_BUF_SIZE 0x10000UL + +#define ARM_PLAT_SP_IMAGE_NS_BUF_MMAP MAP_REGION2( \ + SP_IMAGE_NS_BUF_BASE, \ + SP_IMAGE_NS_BUF_BASE, \ + SP_IMAGE_NS_BUF_SIZE, \ + MT_RW_DATA | MT_NS | MT_USER, \ + PAGE_SIZE) + #endif /* PLATFORM_DEF_H */ |