Add SCMI support for Juno platform
authorSoby Mathew <soby.mathew@arm.com>
Mon, 14 Nov 2016 12:44:32 +0000 (12:44 +0000)
committerSoby Mathew <soby.mathew@arm.com>
Mon, 5 Jun 2017 12:32:17 +0000 (13:32 +0100)
This patch adds the memory map region for the SCMI payload memory
and maps the Juno core indices to SCMI power domains via the
`plat_css_core_pos_to_scmi_dmn_id_map` array.

Change-Id: I0d2bb2a719ff5b6a9d8e22e91e1625ab14453665
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
include/plat/arm/css/common/css_def.h
plat/arm/board/common/board_css_common.c
plat/arm/board/juno/include/platform_def.h
plat/arm/board/juno/juno_topology.c

index 4c4dece624450458e28034af0df276c55efc0542..0b74cede87a90361de2cb7a198b107f2420e69dc 100644 (file)
                                                CSS_DEVICE_SIZE,        \
                                                MT_DEVICE | MT_RW | MT_SECURE)
 
+#define CSS_MAP_NSRAM                  MAP_REGION_FLAT(                \
+                                               NSRAM_BASE,     \
+                                               NSRAM_SIZE,     \
+                                               MT_DEVICE | MT_RW | MT_SECURE)
+
 /* Platform ID address */
 #define SSC_VERSION_OFFSET                     0x040
 
index 1758a235a9ed0b6ace54a185b6b7fa39dc4e0128..42f754e25af2aa2008ebd2020994e4869983be56 100644 (file)
@@ -49,6 +49,15 @@ const mmap_region_t plat_arm_mmap[] = {
        ARM_MAP_SHARED_RAM,
        V2M_MAP_IOFPGA,
        CSS_MAP_DEVICE,
+#if CSS_USE_SCMI_DRIVER
+       /*
+        * The SCMI payload area is currently in the Non Secure SRAM. This is
+        * a potential security risk but this will be resolved once SCP
+        * completely replaces SCPI with SCMI as the only communication
+        * protocol.
+        */
+       CSS_MAP_NSRAM,
+#endif
        SOC_CSS_MAP_DEVICE,
        {0}
 };
index 8f03826778b738f23424d43849bb593ece101989..68c38ee1c2865dd59e9fd0b70ee83b427675d1bb 100644 (file)
 #endif
 
 #ifdef IMAGE_BL31
-# define PLAT_ARM_MMAP_ENTRIES         5
-# define MAX_XLAT_TABLES               2
+# if CSS_USE_SCMI_DRIVER
+#  define PLAT_ARM_MMAP_ENTRIES                6
+#  define MAX_XLAT_TABLES              3
+# else
+#  define PLAT_ARM_MMAP_ENTRIES                5
+#  define MAX_XLAT_TABLES              2
+# endif
 #endif
 
 #ifdef IMAGE_BL32
index d2e0c77e67ce7d9cb6c4fc7e5ced128b68f6f530..b9412b1f42a91af0ac46528404f1f6cb0457764b 100644 (file)
@@ -51,3 +51,10 @@ unsigned int plat_arm_get_cluster_core_count(u_register_t mpidr)
        return (((mpidr) & 0x100) ? JUNO_CLUSTER1_CORE_COUNT :\
                                JUNO_CLUSTER0_CORE_COUNT);
 }
+
+/*
+ * The array mapping platform core position (implemented by plat_my_core_pos())
+ * to the SCMI power domain ID implemented by SCP.
+ */
+const uint32_t plat_css_core_pos_to_scmi_dmn_id_map[PLATFORM_CORE_COUNT] = {
+                       2, 3, 4, 5, 0, 1 };