refactor(neoverse-rd): refactor mmap macro for CSS device memory region

There are two macros that define CSS 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. While at it, rename the macro that defines
the memory map range and attributes for the remote shared RAM region.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Change-Id: Ieddd5c81f6261490dbacb97160858903e56d327a
diff --git a/plat/arm/board/neoverse_rd/common/include/nrd2/nrd_css_fw_def2.h b/plat/arm/board/neoverse_rd/common/include/nrd2/nrd_css_fw_def2.h
index b0397e6..37607f4 100644
--- a/plat/arm/board/neoverse_rd/common/include/nrd2/nrd_css_fw_def2.h
+++ b/plat/arm/board/neoverse_rd/common/include/nrd2/nrd_css_fw_def2.h
@@ -60,20 +60,14 @@
  * MMU mapping
  ******************************************************************************/
 
-#define NRD_CSS_SHARED_RAM_REMOTE_CHIP_MMAP(n)				\
+#define NRD_CSS_SHARED_RAM_MMAP(n)					\
 		MAP_REGION_FLAT(					\
 			NRD_REMOTE_CHIP_MEM_OFFSET(n) +			\
 			ARM_SHARED_RAM_BASE,				\
 			ARM_SHARED_RAM_SIZE,				\
 			MT_NON_CACHEABLE | MT_RW | MT_SECURE)
 
-#define NRD_CSS_PERIPH_MMAP						\
-		MAP_REGION_FLAT(					\
-			NRD_DEVICE_BASE,				\
-			NRD_DEVICE_SIZE,				\
-			MT_DEVICE | MT_RW | MT_SECURE)
-
-#define NRD_CSS_PERIPH_REMOTE_CHIP_MMAP(n)				\
+#define NRD_CSS_PERIPH_MMAP(n)						\
 		MAP_REGION_FLAT(					\
 			NRD_REMOTE_CHIP_MEM_OFFSET(n) +			\
 			NRD_DEVICE_BASE,				\
diff --git a/plat/arm/board/neoverse_rd/common/nrd_plat2.c b/plat/arm/board/neoverse_rd/common/nrd_plat2.c
index 63cd834..fc8866f 100644
--- a/plat/arm/board/neoverse_rd/common/nrd_plat2.c
+++ b/plat/arm/board/neoverse_rd/common/nrd_plat2.c
@@ -23,9 +23,9 @@
  */
 #if IMAGE_BL1
 const mmap_region_t plat_arm_mmap[] = {
-	ARM_MAP_SHARED_RAM,
+	NRD_CSS_SHARED_RAM_MMAP(0),
 	NRD_ROS_FLASH0_RO_MMAP,
-	NRD_CSS_PERIPH_MMAP,
+	NRD_CSS_PERIPH_MMAP(0),
 	NRD_ROS_PLATFORM_PERIPH_MMAP,
 	NRD_ROS_SYSTEM_PERIPH_MMAP,
 	{0}
@@ -34,12 +34,12 @@
 
 #if IMAGE_BL2
 const mmap_region_t plat_arm_mmap[] = {
-	ARM_MAP_SHARED_RAM,
+	NRD_CSS_SHARED_RAM_MMAP(0),
 	NRD_ROS_FLASH0_RO_MMAP,
 #ifdef PLAT_ARM_MEM_PROT_ADDR
 	ARM_V2M_MAP_MEM_PROTECT,
 #endif
-	NRD_CSS_PERIPH_MMAP,
+	NRD_CSS_PERIPH_MMAP(0),
 	NRD_ROS_MEMCNTRL_MMAP,
 	NRD_ROS_PLATFORM_PERIPH_MMAP,
 	NRD_ROS_SYSTEM_PERIPH_MMAP,
@@ -68,11 +68,11 @@
 
 #if IMAGE_BL31
 const mmap_region_t plat_arm_mmap[] = {
-	ARM_MAP_SHARED_RAM,
+	NRD_CSS_SHARED_RAM_MMAP(0),
 #ifdef PLAT_ARM_MEM_PROT_ADDR
 	ARM_V2M_MAP_MEM_PROTECT,
 #endif
-	NRD_CSS_PERIPH_MMAP,
+	NRD_CSS_PERIPH_MMAP(0),
 	NRD_ROS_PLATFORM_PERIPH_MMAP,
 	NRD_ROS_SYSTEM_PERIPH_MMAP,
 #if SPM_MM || (SPMC_AT_EL3 && SPMC_AT_EL3_SEL0_SP)
diff --git a/plat/arm/board/neoverse_rd/platform/rdn2/rdn2_plat.c b/plat/arm/board/neoverse_rd/platform/rdn2/rdn2_plat.c
index cad4e4d..7459679 100644
--- a/plat/arm/board/neoverse_rd/platform/rdn2/rdn2_plat.c
+++ b/plat/arm/board/neoverse_rd/platform/rdn2/rdn2_plat.c
@@ -17,16 +17,16 @@
 #if (NRD_PLATFORM_VARIANT == 2)
 static const mmap_region_t rdn2mc_dynamic_mmap[] = {
 #if NRD_CHIP_COUNT > 1
-	NRD_CSS_SHARED_RAM_REMOTE_CHIP_MMAP(1),
-	NRD_CSS_PERIPH_REMOTE_CHIP_MMAP(1),
+	NRD_CSS_SHARED_RAM_MMAP(1),
+	NRD_CSS_PERIPH_MMAP(1),
 #endif
 #if NRD_CHIP_COUNT > 2
-	NRD_CSS_SHARED_RAM_REMOTE_CHIP_MMAP(2),
-	NRD_CSS_PERIPH_REMOTE_CHIP_MMAP(2),
+	NRD_CSS_SHARED_RAM_MMAP(2),
+	NRD_CSS_PERIPH_MMAP(2),
 #endif
 #if NRD_CHIP_COUNT > 3
-	NRD_CSS_SHARED_RAM_REMOTE_CHIP_MMAP(3),
-	NRD_CSS_PERIPH_REMOTE_CHIP_MMAP(3),
+	NRD_CSS_SHARED_RAM_MMAP(3),
+	NRD_CSS_PERIPH_MMAP(3),
 #endif
 };
 #endif