aboutsummaryrefslogtreecommitdiff
path: root/product/rdn1e1
diff options
context:
space:
mode:
authorVijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>2020-01-03 19:02:37 +0530
committerjimqui01 <54316584+jimqui01@users.noreply.github.com>2020-02-27 10:13:55 +0000
commit3bdd7db97b45846796d86f50226f8f74e5ce7c1c (patch)
treee1ef2bf9a86b2f87b4dbf88f003bccedab6874c2 /product/rdn1e1
parent41abc930b10b330e2e42ac8847e20da87025ae1a (diff)
product/rdn1e1: add support for dual-chip configuration
RD-N1-Edge based platforms can operate in dual-chip configuration wherein two rdn1edge SoCs are connected through a high speed coherent CCIX link. This patch adds support to configure the CCIX link in CMN-600 if multi-chip mode is detected. The AP core boot is done only for the primary chip (Chip 0) and the secondary chips will be put in idle state waiting for SCMI commands. Change-Id: I18ce2fad52af50b87ca956157204960704b07b6d Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
Diffstat (limited to 'product/rdn1e1')
-rw-r--r--product/rdn1e1/module/rdn1e1_system/src/mod_rdn1e1_system.c79
-rw-r--r--product/rdn1e1/scp_ramfw/config_cmn600.c15
2 files changed, 85 insertions, 9 deletions
diff --git a/product/rdn1e1/module/rdn1e1_system/src/mod_rdn1e1_system.c b/product/rdn1e1/module/rdn1e1_system/src/mod_rdn1e1_system.c
index ba66c7d1..32610e31 100644
--- a/product/rdn1e1/module/rdn1e1_system/src/mod_rdn1e1_system.c
+++ b/product/rdn1e1/module/rdn1e1_system/src/mod_rdn1e1_system.c
@@ -18,10 +18,12 @@
#include <fwk_module_idx.h>
#include <fwk_notification.h>
#include <mod_clock.h>
+#include <mod_cmn600.h>
#include <mod_rdn1e1_system.h>
#include <mod_log.h>
#include <mod_scmi.h>
#include <mod_sds.h>
+#include <mod_system_info.h>
#include <mod_system_power.h>
#include <mod_power_domain.h>
#include <mod_ppu_v1.h>
@@ -55,6 +57,12 @@ struct rdn1e1_system_ctx {
/* SDS API pointer */
const struct mod_sds_api *sds_api;
+
+ /* CMN600 CCIX config API pointer */
+ struct mod_cmn600_ccix_config_api *cmn600_api;
+
+ /* System Information HAL API pointer */
+ struct mod_system_info_get_info_api *system_info_api;
};
struct rdn1e1_system_isr {
@@ -230,6 +238,20 @@ static int rdn1e1_system_bind(fwk_id_t id, unsigned int round)
if (status != FWK_SUCCESS)
return status;
+ status = fwk_module_bind(FWK_ID_MODULE(FWK_MODULE_IDX_CMN600),
+ FWK_ID_API(FWK_MODULE_IDX_CMN600,
+ MOD_CMN600_API_IDX_CCIX_CONFIG),
+ &rdn1e1_system_ctx.cmn600_api);
+ if (status != FWK_SUCCESS)
+ return status;
+
+ status = fwk_module_bind(FWK_ID_MODULE(FWK_MODULE_IDX_SYSTEM_INFO),
+ FWK_ID_API(FWK_MODULE_IDX_SYSTEM_INFO,
+ MOD_SYSTEM_INFO_GET_API_IDX),
+ &rdn1e1_system_ctx.system_info_api);
+ if (status != FWK_SUCCESS)
+ return status;
+
return fwk_module_bind(fwk_module_id_sds,
FWK_ID_API(FWK_MODULE_IDX_SDS, 0),
&rdn1e1_system_ctx.sds_api);
@@ -299,36 +321,79 @@ int rdn1e1_system_process_notification(const struct fwk_event *event,
struct mod_pd_restricted_api *mod_pd_restricted_api;
static unsigned int scmi_notification_count = 0;
static bool sds_notification_received = false;
+ struct mod_cmn600_ccix_remote_node_config remote_config;
+ const struct mod_system_info *system_info;
+ uint8_t chip_id = 0;
+ bool mc_mode = false;
+
+ status = rdn1e1_system_ctx.system_info_api->get_system_info(&system_info);
+ if (status == FWK_SUCCESS) {
+ chip_id = system_info->chip_id;
+ mc_mode = system_info->multi_chip_mode;
+ }
assert(fwk_id_is_type(event->target_id, FWK_ID_TYPE_MODULE));
if (fwk_id_is_equal(event->id, mod_clock_notification_id_state_changed)) {
params = (struct clock_notification_params *)event->params;
+ if (params->new_state != MOD_CLOCK_STATE_RUNNING)
+ return FWK_SUCCESS;
+
+ /* Perform the CCIX setup if multi-chip mode is detected */
+ if (mc_mode == true) {
+ /* Populate CCIX config data statically */
+ remote_config.remote_rnf_count = 2;
+ remote_config.remote_sa_count = 0;
+ remote_config.remote_ha_count = 1;
+ remote_config.ccix_link_id = 0;
+ remote_config.remote_ha_mmap_count = 1;
+ remote_config.smp_mode = true;
+ if (chip_id == 0) {
+ remote_config.remote_ha_mmap[0].ha_id = 0x1;
+ remote_config.remote_ha_mmap[0].base = (4ULL * FWK_TIB);
+ } else {
+ remote_config.remote_ha_mmap[0].ha_id = 0x0;
+ remote_config.remote_ha_mmap[0].base = 0x0;
+ }
+ remote_config.remote_ha_mmap[0].size = (4ULL * FWK_TIB);
+
+ status = rdn1e1_system_ctx.cmn600_api->set_config(&remote_config);
+ if (status != FWK_SUCCESS) {
+ rdn1e1_system_ctx.log_api->log(MOD_LOG_GROUP_ERROR,
+ "CCIX Setup Failed for Chip: %d!\n", chip_id);
+ return status;
+ }
+ rdn1e1_system_ctx.cmn600_api->exchange_protocol_credit(0);
+ rdn1e1_system_ctx.cmn600_api->enter_system_coherency(0);
+ rdn1e1_system_ctx.cmn600_api->enter_dvm_domain(0);
+ }
/*
* Initialize primary core when the system is initialized for the first
* time only
*/
- if (params->new_state == MOD_CLOCK_STATE_RUNNING) {
+ if (chip_id == 0) {
rdn1e1_system_ctx.log_api->log(MOD_LOG_GROUP_DEBUG,
"[RDN1E1 SYSTEM] Initializing the primary core...\n");
mod_pd_restricted_api = rdn1e1_system_ctx.mod_pd_restricted_api;
- status = mod_pd_restricted_api->set_composite_state_async(
+ status = mod_pd_restricted_api->set_composite_state_async(
FWK_ID_ELEMENT(FWK_MODULE_IDX_POWER_DOMAIN, 0),
false,
MOD_PD_COMPOSITE_STATE(MOD_PD_LEVEL_2, 0, MOD_PD_STATE_ON,
MOD_PD_STATE_ON, MOD_PD_STATE_ON));
if (status != FWK_SUCCESS)
return status;
-
- /* Unsubscribe to the notification */
- return fwk_notification_unsubscribe(event->id, event->source_id,
- event->target_id);
+ } else {
+ rdn1e1_system_ctx.log_api->log(MOD_LOG_GROUP_DEBUG,
+ "[RDN1E1 SYSTEM] Detected as slave chip %d, "
+ "Waiting for SCMI command\n", chip_id);
}
- return FWK_SUCCESS;
+ /* Unsubscribe to the notification */
+ return fwk_notification_unsubscribe(event->id, event->source_id,
+ event->target_id);
} else if (fwk_id_is_equal(event->id,
mod_scmi_notification_id_initialized)) {
scmi_notification_count++;
diff --git a/product/rdn1e1/scp_ramfw/config_cmn600.c b/product/rdn1e1/scp_ramfw/config_cmn600.c
index 99540b34..5b548dad 100644
--- a/product/rdn1e1/scp_ramfw/config_cmn600.c
+++ b/product/rdn1e1/scp_ramfw/config_cmn600.c
@@ -21,6 +21,7 @@
#define DMC1_ID 0x6c
#define NODE_ID_HND 0x68
#define NODE_ID_SBSX 0x64
+#define NODE_ID_CCIX 0x0
static const unsigned int snf_table[] = {
DMC0_ID, /* Maps to HN-F logical node 0 */
@@ -33,10 +34,10 @@ static const struct mod_cmn600_memory_region_map mmap[] = {
{
/*
* System cache backed region
- * Map: 0x0000_0000_0000 - 0xFFFF_FFFF_FFFF (256 TB)
+ * Map: 0x0000_0000_0000 - 0x07FF_FFFF_FFFF (8 TB)
*/
.base = UINT64_C(0x000000000000),
- .size = UINT64_C(256) * FWK_TIB,
+ .size = UINT64_C(8) * FWK_TIB,
.type = MOD_CMN600_MEMORY_REGION_TYPE_SYSCACHE,
},
{
@@ -89,6 +90,16 @@ static const struct mod_cmn600_memory_region_map mmap[] = {
.type = MOD_CMN600_MEMORY_REGION_TYPE_IO,
.node_id = NODE_ID_HND,
},
+ {
+ /*
+ * Remote chip address space
+ * Map: 0x400_0000_0000 - 0x7FF_FFFF_FFFF (4 TB to 8 TB)
+ */
+ .base = UINT64_C(0x40000000000),
+ .size = UINT64_C(4) * FWK_TIB,
+ .type = MOD_CMN600_REGION_TYPE_CCIX,
+ .node_id = NODE_ID_CCIX,
+ },
};
const struct fwk_module_config config_cmn600 = {