]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(qemu): support el3 spmc
authorJens Wiklander <jens.wiklander@linaro.org>
Mon, 17 Jan 2022 08:48:28 +0000 (09:48 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Thu, 8 Dec 2022 14:40:25 +0000 (15:40 +0100)
Introduce additional defines needed when compiling the QEMU platform
with SPMC at EL3.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Change-Id: If6dbe41fa8761637e39579a1f6818dabc769c139

plat/qemu/common/qemu_common.c
plat/qemu/qemu/include/platform_def.h

index 0c184f49bb7bb7933617039a6a65d265a1a8c3db..23ac5813ea32bf09bd083ca4d79dda2e9b2d9cf4 100644 (file)
@@ -10,6 +10,7 @@
 #include <arch_helpers.h>
 #include <common/bl_common.h>
 #include <lib/xlat_tables/xlat_tables_v2.h>
+#include <services/el3_spmc_ffa_memory.h>
 
 #include <plat/common/platform.h>
 #include "qemu_private.h"
@@ -100,7 +101,7 @@ static const mmap_region_t plat_qemu_mmap[] = {
 #if SPM_MM
        MAP_NS_DRAM0,
        QEMU_SPM_BUF_EL3_MMAP,
-#else
+#elif !SPMC_AT_EL3
        MAP_BL32_MEM,
 #endif
        {0}
@@ -167,3 +168,30 @@ int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size)
        return get_mbedtls_heap_helper(heap_addr, heap_size);
 }
 #endif
+
+#if SPMC_AT_EL3
+/*
+ * When using the EL3 SPMC implementation allocate the datastore
+ * for tracking shared memory descriptors in normal memory.
+ */
+#define PLAT_SPMC_SHMEM_DATASTORE_SIZE 64 * 1024
+
+uint8_t plat_spmc_shmem_datastore[PLAT_SPMC_SHMEM_DATASTORE_SIZE];
+
+int plat_spmc_shmem_datastore_get(uint8_t **datastore, size_t *size)
+{
+       *datastore = plat_spmc_shmem_datastore;
+       *size = PLAT_SPMC_SHMEM_DATASTORE_SIZE;
+       return 0;
+}
+
+int plat_spmc_shmem_begin(struct ffa_mtd *desc)
+{
+       return 0;
+}
+
+int plat_spmc_shmem_reclaim(struct ffa_mtd *desc)
+{
+       return 0;
+}
+#endif
index 490c2dc7c3f86eecedc812077a6a550534d5078a..18c57469fb4150264ace011bf0c3c2c667ca3e0a 100644 (file)
 
 #define PLAT_PHY_ADDR_SPACE_SIZE       (1ULL << 32)
 #define PLAT_VIRT_ADDR_SPACE_SIZE      (1ULL << 32)
-#define MAX_MMAP_REGIONS               11
-#define MAX_XLAT_TABLES                        6
+#define MAX_MMAP_REGIONS               (11 + MAX_MMAP_REGIONS_SPMC)
+#define MAX_XLAT_TABLES                        (6 + MAX_XLAT_TABLES_SPMC)
 #define MAX_IO_DEVICES                 4
 #define MAX_IO_HANDLES                 4
 
  */
 #define        PLAT_EVENT_LOG_MAX_SIZE         UL(0x400)
 
+#if SPMC_AT_EL3
+/*
+ * Number of Secure Partitions supported.
+ * SPMC at EL3, uses this count to configure the maximum number of
+ * supported secure partitions.
+ */
+#define SECURE_PARTITION_COUNT         1
+
+/*
+ * Number of Logical Partitions supported.
+ * SPMC at EL3, uses this count to configure the maximum number of
+ * supported logical partitions.
+ */
+#define MAX_EL3_LP_DESCS_COUNT         0
+
+/*
+ * Number of Normal World Partitions supported.
+ * SPMC at EL3, uses this count to configure the maximum number of
+ * supported normal world partitions.
+ */
+#define NS_PARTITION_COUNT             1
+
+#define MAX_MMAP_REGIONS_SPMC          2
+#define MAX_XLAT_TABLES_SPMC           4
+#else
+#define MAX_MMAP_REGIONS_SPMC          0
+#define MAX_XLAT_TABLES_SPMC           0
+#endif
 #endif /* PLATFORM_DEF_H */