refactor(neoverse-rd): refactor mmap macro for RoS device memory region
There are two macros that define ROS device memory map range and
attributes - one for local chip and the other for remote chip. Refactor
these two macros into a single macro that uses the chip ID to identify
the local or the remote chip.
Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Change-Id: Iceb87f5fc319efa37105d66bb1c88b622a2bb366
diff --git a/plat/arm/board/neoverse_rd/common/include/nrd1/nrd_ros_fw_def1.h b/plat/arm/board/neoverse_rd/common/include/nrd1/nrd_ros_fw_def1.h
index 7e146ba..5f3c376 100644
--- a/plat/arm/board/neoverse_rd/common/include/nrd1/nrd_ros_fw_def1.h
+++ b/plat/arm/board/neoverse_rd/common/include/nrd1/nrd_ros_fw_def1.h
@@ -18,13 +18,7 @@
* MMU mapping
******************************************************************************/
-#define PLAT_ARM_SECURE_MAP_DEVICE \
- MAP_REGION_FLAT( \
- SOC_CSS_DEVICE_BASE, \
- SOC_CSS_DEVICE_SIZE, \
- MT_DEVICE | MT_RW | MT_SECURE | MT_USER)
-
-#define SOC_CSS_MAP_DEVICE_REMOTE_CHIP(n) \
+#define PLAT_ARM_SECURE_MAP_DEVICE(n) \
MAP_REGION_FLAT( \
NRD_REMOTE_CHIP_MEM_OFFSET(n) + \
SOC_CSS_DEVICE_BASE, \
diff --git a/plat/arm/board/neoverse_rd/common/nrd_plat1.c b/plat/arm/board/neoverse_rd/common/nrd_plat1.c
index bd848ec..eb96944 100644
--- a/plat/arm/board/neoverse_rd/common/nrd_plat1.c
+++ b/plat/arm/board/neoverse_rd/common/nrd_plat1.c
@@ -33,7 +33,7 @@
ARM_MAP_SHARED_RAM,
NRD_MAP_FLASH0_RO,
NRD_MAP_DEVICE(0),
- SOC_CSS_MAP_DEVICE,
+ PLAT_ARM_SECURE_MAP_DEVICE(0),
{0}
};
#endif
@@ -45,7 +45,7 @@
ARM_V2M_MAP_MEM_PROTECT,
#endif
NRD_MAP_DEVICE(0),
- SOC_CSS_MAP_DEVICE,
+ PLAT_ARM_SECURE_MAP_DEVICE(0),
ARM_MAP_NS_DRAM1,
#if NRD_CHIP_COUNT > 1
NRD_MAP_DEVICE(1),
@@ -76,7 +76,7 @@
#ifdef PLAT_ARM_MEM_PROT_ADDR
ARM_V2M_MAP_MEM_PROTECT,
#endif
- SOC_CSS_MAP_DEVICE,
+ PLAT_ARM_SECURE_MAP_DEVICE(0),
#if SPM_MM
ARM_SPM_BUF_EL3_MMAP,
#endif
@@ -88,7 +88,7 @@
PLAT_ARM_SECURE_MAP_SYSTEMREG,
PLAT_ARM_SECURE_MAP_NOR2,
SOC_PLATFORM_SECURE_UART,
- PLAT_ARM_SECURE_MAP_DEVICE,
+ PLAT_ARM_SECURE_MAP_DEVICE(0),
ARM_SP_IMAGE_MMAP,
ARM_SP_IMAGE_NS_BUF_MMAP,
ARM_SP_IMAGE_RW_MMAP,
diff --git a/plat/arm/board/neoverse_rd/platform/rdn1edge/rdn1edge_plat.c b/plat/arm/board/neoverse_rd/platform/rdn1edge/rdn1edge_plat.c
index f40c9a4..5f84d0c 100644
--- a/plat/arm/board/neoverse_rd/platform/rdn1edge/rdn1edge_plat.c
+++ b/plat/arm/board/neoverse_rd/platform/rdn1edge/rdn1edge_plat.c
@@ -15,7 +15,7 @@
static const mmap_region_t rdn1edge_dynamic_mmap[] = {
ARM_MAP_SHARED_RAM_REMOTE_CHIP(1),
NRD_MAP_DEVICE(1),
- SOC_CSS_MAP_DEVICE_REMOTE_CHIP(1)
+ PLAT_ARM_SECURE_MAP_DEVICE(1)
};
static struct gic600_multichip_data rdn1e1_multichip_data __init = {
diff --git a/plat/arm/board/neoverse_rd/platform/rdv1mc/rdv1mc_plat.c b/plat/arm/board/neoverse_rd/platform/rdv1mc/rdv1mc_plat.c
index 313eeba..e537257 100644
--- a/plat/arm/board/neoverse_rd/platform/rdv1mc/rdv1mc_plat.c
+++ b/plat/arm/board/neoverse_rd/platform/rdv1mc/rdv1mc_plat.c
@@ -15,16 +15,16 @@
static const mmap_region_t rdv1mc_dynamic_mmap[] = {
ARM_MAP_SHARED_RAM_REMOTE_CHIP(1),
NRD_MAP_DEVICE(1),
- SOC_CSS_MAP_DEVICE_REMOTE_CHIP(1),
+ PLAT_ARM_SECURE_MAP_DEVICE(1),
#if (NRD_CHIP_COUNT > 2)
ARM_MAP_SHARED_RAM_REMOTE_CHIP(2),
NRD_MAP_DEVICE(2),
- SOC_CSS_MAP_DEVICE_REMOTE_CHIP(2),
+ PLAT_ARM_SECURE_MAP_DEVICE(2),
#endif
#if (NRD_CHIP_COUNT > 3)
ARM_MAP_SHARED_RAM_REMOTE_CHIP(3),
NRD_MAP_DEVICE(3),
- SOC_CSS_MAP_DEVICE_REMOTE_CHIP(3)
+ PLAT_ARM_SECURE_MAP_DEVICE(3)
#endif
};