Skip to content

Commit

Permalink
product/rdn2: add support for variant 3 of rdn2 platform
Browse files Browse the repository at this point in the history
Add support for variant 3 of RD-N2 platform. It is a variant of RD-N2
platform with a 10x6 mesh. For this variant, the RD-N2 platform support
is reused using the compile time macro PLATFORM_VARIANT. For this
platform, the PLATFORM_VARIANT macro should be set to 3 at compile time.

Signed-off-by: Tony K Nadackal <tony.nadackal@arm.com>
Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Change-Id: I53c4feeba066d961bd6131c8f7a0e3868d4bf1a7
  • Loading branch information
tonykn-arm authored and nicola-mazzucato-arm committed Dec 5, 2022
1 parent f612950 commit ebc5d50
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 15 deletions.
2 changes: 1 addition & 1 deletion product/rdn2/include/platform_core.h
Expand Up @@ -15,7 +15,7 @@
#define PLATFORM_CORE_PER_CLUSTER_MAX 1

#define CORES_PER_CLUSTER 1
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
# define NUMBER_OF_CLUSTERS 16
#elif (PLATFORM_VARIANT == 1)
# define NUMBER_OF_CLUSTERS 8
Expand Down
2 changes: 1 addition & 1 deletion product/rdn2/include/platform_def.h
Expand Up @@ -9,7 +9,7 @@
#define PLATFORM_DEF_H

/* PCIe ECAM and MMIO sizes */
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
# define AP_PCIE_ECAM_SIZE_PER_RC (64ULL * FWK_MIB)
# define AP_PCIE_MMIOL_SIZE_PER_RC (128 * FWK_MIB)
# define AP_PCIE_MMIOH_SIZE_PER_RC (64ULL * FWK_GIB)
Expand Down
5 changes: 4 additions & 1 deletion product/rdn2/mcp_ramfw/CMakeLists.txt
Expand Up @@ -19,11 +19,14 @@ elseif(SCP_PLATFORM_VARIANT STREQUAL "1")
target_compile_definitions(rdn2-mcp-bl2 PUBLIC -DPLATFORM_VARIANT=1)
elseif(SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(rdn2-mcp-bl2 PUBLIC -DPLATFORM_VARIANT=2)
elseif(SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(rdn2-mcp-bl2 PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(
Expand Down
7 changes: 6 additions & 1 deletion product/rdn2/mcp_romfw/CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@ add_executable(rdn2-mcp-bl1)
# - '0' for RD-N2 platform
# - '1' for RD-N2-Cfg1 platform
# - '2' for RD-N2-Cfg2 platform
# - '3' for RD-N2-Cfg3 platform

if (SCP_PLATFORM_VARIANT STREQUAL "0")
target_compile_definitions(rdn2-mcp-bl1
Expand All @@ -25,11 +26,15 @@ elseif (SCP_PLATFORM_VARIANT STREQUAL "1")
elseif (SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(rdn2-mcp-bl1
PUBLIC -DPLATFORM_VARIANT=2)
elseif (SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(rdn2-mcp-bl1
PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(
Expand Down
5 changes: 4 additions & 1 deletion product/rdn2/module/mcp_platform/CMakeLists.txt
Expand Up @@ -14,11 +14,14 @@ elseif(SCP_PLATFORM_VARIANT STREQUAL "1")
target_compile_definitions(${SCP_MODULE_TARGET} PUBLIC -DPLATFORM_VARIANT=1)
elseif(SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(${SCP_MODULE_TARGET} PUBLIC -DPLATFORM_VARIANT=2)
elseif(SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(${SCP_MODULE_TARGET} PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(${SCP_MODULE_TARGET}
Expand Down
7 changes: 6 additions & 1 deletion product/rdn2/module/platform_system/CMakeLists.txt
Expand Up @@ -10,6 +10,7 @@ add_library(${SCP_MODULE_TARGET} SCP_MODULE)
# - '0' for RD-N2 platform
# - '1' for RD-N2-Cfg1 platform
# - '2' for RD-N2-Cfg2 platform
# - '3' for RD-N2-Cfg3 platform

if (SCP_PLATFORM_VARIANT STREQUAL "0")
target_compile_definitions(${SCP_MODULE_TARGET}
Expand All @@ -20,11 +21,15 @@ elseif (SCP_PLATFORM_VARIANT STREQUAL "1")
elseif (SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(${SCP_MODULE_TARGET}
PUBLIC -DPLATFORM_VARIANT=2)
elseif (SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(${SCP_MODULE_TARGET}
PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(${SCP_MODULE_TARGET}
Expand Down
7 changes: 6 additions & 1 deletion product/rdn2/scp_ramfw/CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@ add_executable(rdn2-bl2)
# - '0' for RD-N2 platform
# - '1' for RD-N2-Cfg1 platform
# - '2' for RD-N2-Cfg2 platform
# - '3' for RD-N2-Cfg3 platform

if (SCP_PLATFORM_VARIANT STREQUAL "0")
target_compile_definitions(rdn2-bl2
Expand All @@ -26,11 +27,15 @@ elseif (SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(rdn2-bl2
PUBLIC -DPLATFORM_VARIANT=2)
set(SCP_LOG_LEVEL "INFO" PARENT_SCOPE)
elseif (SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(rdn2-bl2
PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(
Expand Down
68 changes: 63 additions & 5 deletions product/rdn2/scp_ramfw/config_cmn700.c
Expand Up @@ -93,9 +93,33 @@ enum rdn2cfg2_cmn700_ccg_port {

# define MESH_SIZE_X 6
# define MESH_SIZE_Y 6

#elif (PLATFORM_VARIANT == 3)
# define MEM_CNTRL0_ID 16
# define MEM_CNTRL1_ID 1168
# define MEM_CNTRL2_ID 8
# define MEM_CNTRL3_ID 1160
# define MEM_CNTRL4_ID 24
# define MEM_CNTRL5_ID 1176
# define MEM_CNTRL6_ID 32
# define MEM_CNTRL7_ID 1184

# define NODE_ID_HND 42
# define NODE_ID_HNI0 256
# define NODE_ID_HNP0 44
# define NODE_ID_HNP1 298
# define NODE_ID_HNP2 554
# define NODE_ID_HNP3 682
# define NODE_ID_HNP4 938
# define NODE_ID_SBSX 172

# define NODE_ID_NON_PCIE_IO_MACRO NODE_ID_HNP4

# define MESH_SIZE_X 10
# define MESH_SIZE_Y 6
#endif

#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
static const unsigned int snf_table[] = {
MEM_CNTRL0_ID, /* Maps to HN-F logical node 0 */
MEM_CNTRL0_ID, /* Maps to HN-F logical node 1 */
Expand Down Expand Up @@ -129,6 +153,40 @@ static const unsigned int snf_table[] = {
MEM_CNTRL7_ID, /* Maps to HN-F logical node 29 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 30 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 31 */
# if (PLATFORM_VARIANT == 3)
MEM_CNTRL0_ID, /* Maps to HN-F logical node 32 */
MEM_CNTRL0_ID, /* Maps to HN-F logical node 33 */
MEM_CNTRL0_ID, /* Maps to HN-F logical node 34 */
MEM_CNTRL0_ID, /* Maps to HN-F logical node 35 */
MEM_CNTRL1_ID, /* Maps to HN-F logical node 36 */
MEM_CNTRL1_ID, /* Maps to HN-F logical node 37 */
MEM_CNTRL1_ID, /* Maps to HN-F logical node 38 */
MEM_CNTRL1_ID, /* Maps to HN-F logical node 39 */
MEM_CNTRL2_ID, /* Maps to HN-F logical node 40 */
MEM_CNTRL2_ID, /* Maps to HN-F logical node 41 */
MEM_CNTRL2_ID, /* Maps to HN-F logical node 42 */
MEM_CNTRL2_ID, /* Maps to HN-F logical node 43 */
MEM_CNTRL3_ID, /* Maps to HN-F logical node 44 */
MEM_CNTRL3_ID, /* Maps to HN-F logical node 45 */
MEM_CNTRL3_ID, /* Maps to HN-F logical node 46 */
MEM_CNTRL3_ID, /* Maps to HN-F logical node 47 */
MEM_CNTRL4_ID, /* Maps to HN-F logical node 48 */
MEM_CNTRL4_ID, /* Maps to HN-F logical node 49 */
MEM_CNTRL4_ID, /* Maps to HN-F logical node 50 */
MEM_CNTRL4_ID, /* Maps to HN-F logical node 51 */
MEM_CNTRL5_ID, /* Maps to HN-F logical node 52 */
MEM_CNTRL5_ID, /* Maps to HN-F logical node 53 */
MEM_CNTRL5_ID, /* Maps to HN-F logical node 54 */
MEM_CNTRL5_ID, /* Maps to HN-F logical node 55 */
MEM_CNTRL6_ID, /* Maps to HN-F logical node 56 */
MEM_CNTRL6_ID, /* Maps to HN-F logical node 57 */
MEM_CNTRL6_ID, /* Maps to HN-F logical node 58 */
MEM_CNTRL6_ID, /* Maps to HN-F logical node 59 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 60 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 61 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 62 */
MEM_CNTRL7_ID, /* Maps to HN-F logical node 63 */
# endif
};
#elif (PLATFORM_VARIANT == 1)
static const unsigned int snf_table[] = {
Expand Down Expand Up @@ -250,7 +308,7 @@ static const struct mod_cmn700_mem_region_map mmap[] = {
.type = MOD_CMN700_MEM_REGION_TYPE_IO,
.node_id = NODE_ID_HNP1,
},
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
{
/*
* Peripherals, NCI GPV Memory Map 2
Expand Down Expand Up @@ -291,7 +349,7 @@ static const struct mod_cmn700_mem_region_map mmap[] = {
.type = MOD_CMN700_MEM_REGION_TYPE_IO,
.node_id = NODE_ID_HNP0,
},
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
{
/*
* Peripherals, PCIe 32-bit MMIO to IO Macro 1
Expand Down Expand Up @@ -329,7 +387,7 @@ static const struct mod_cmn700_mem_region_map mmap[] = {
.type = MOD_CMN700_MEM_REGION_TYPE_IO,
.node_id = NODE_ID_HNP0,
},
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
{
/*
* PCIe ECAM0 to IO Macro 1
Expand Down Expand Up @@ -367,7 +425,7 @@ static const struct mod_cmn700_mem_region_map mmap[] = {
.type = MOD_CMN700_MEM_REGION_TYPE_IO,
.node_id = NODE_ID_HNP0,
},
#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
{
/*
* Peripherals, PCIe 64-bit MMIO to IO Macro 1
Expand Down
4 changes: 2 additions & 2 deletions product/rdn2/scp_ramfw/config_pcie_integ_ctrl.c
Expand Up @@ -47,7 +47,7 @@
}) \
}

#if (PLATFORM_VARIANT == 0) /* RD-N2 */
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
# define NON_PCIE_IO_MACRO_REG_BASE PCIE_INTEG_CTRL_REG_BASE(4)
#elif (PLATFORM_VARIANT == 1) /* RD-N2-Cfg1 */
# define NON_PCIE_IO_MACRO_REG_BASE PCIE_INTEG_CTRL_REG_BASE(1)
Expand All @@ -61,7 +61,7 @@ static const struct fwk_element pcie_integ_ctrl_element_table[] = {
AP_PCIE_MMIOL_SIZE_PER_RC,
AP_PCIE_MMIOH_SIZE_PER_RC),

#if (PLATFORM_VARIANT == 0)
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 3)
IO_MACRO_ELEMENT_CONFIG(
1,
PCIE_INTEG_CTRL_REG_BASE(1),
Expand Down
7 changes: 6 additions & 1 deletion product/rdn2/scp_romfw/CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@ add_executable(rdn2-bl1)
# - '0' for RD-N2 platform
# - '1' for RD-N2-Cfg1 platform
# - '2' for RD-N2-Cfg2 platform
# - '3' for RD-N2-Cfg3 platform

if (SCP_PLATFORM_VARIANT STREQUAL "0")
target_compile_definitions(rdn2-bl1
Expand All @@ -25,11 +26,15 @@ elseif (SCP_PLATFORM_VARIANT STREQUAL "1")
elseif (SCP_PLATFORM_VARIANT STREQUAL "2")
target_compile_definitions(rdn2-bl1
PUBLIC -DPLATFORM_VARIANT=2)
elseif (SCP_PLATFORM_VARIANT STREQUAL "3")
target_compile_definitions(rdn2-bl1
PUBLIC -DPLATFORM_VARIANT=3)
else()
message(FATAL_ERROR "Please set SCP_PLATFORM_VARIANT to \n"
"'0' for RD-N2 \n"
"'1' for RD-N2-Cfg1 \n"
"'2' for RD-N2-Cfg2 \n")
"'2' for RD-N2-Cfg2 \n"
"'3' for RD-N2-Cfg3 \n")
endif()

target_include_directories(
Expand Down
2 changes: 2 additions & 0 deletions product/rdn2/src/config_sid.c
Expand Up @@ -19,6 +19,8 @@ static const struct fwk_element subsystem_table[] = {
&(struct mod_sid_subsystem_config){
#if (PLATFORM_VARIANT == 0 || PLATFORM_VARIANT == 2)
.part_number = 0x7B7,
#elif (PLATFORM_VARIANT == 3)
.part_number = 0x7F1,
#else
.part_number = 0x7B6,
#endif
Expand Down

0 comments on commit ebc5d50

Please sign in to comment.