aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>2019-01-31 14:46:35 +0530
committerThomas Abraham <thomas.abraham@arm.com>2019-10-04 12:08:37 +0530
commit5633a90deeca7f23bc6a45ba5990709acc8e595a (patch)
treeab583c8ee250e35891e13c2692e0bf5a757c2971
parent0c2c43f38c7e08c638d1fe162e5e0c37a9d2d3bf (diff)
rdn1e1: workaround patch for rde1edge 32 core bootARMLT-19.10sgi575
Change-Id: Ia16a3c193b51386780b31059f873b42925c04a20 Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
-rw-r--r--module/ppu_v1/src/mod_ppu_v1.c51
-rw-r--r--product/rdn1e1/scp_ramfw/config_ppu_v1.c14
-rw-r--r--product/rdn1e1/src/config_sid.c21
-rw-r--r--product/sgi575/module/sgi575_system/src/mod_sgi575_system.c5
4 files changed, 78 insertions, 13 deletions
diff --git a/module/ppu_v1/src/mod_ppu_v1.c b/module/ppu_v1/src/mod_ppu_v1.c
index 116c22a5..b379c4c9 100644
--- a/module/ppu_v1/src/mod_ppu_v1.c
+++ b/module/ppu_v1/src/mod_ppu_v1.c
@@ -25,7 +25,9 @@
#include <mod_system_power.h>
#endif
-#define CORE_PER_CLUSTER_COUNT_MAX 8
+#define CORE_PER_CLUSTER_COUNT_MAX 16
+extern unsigned int infra_get_core_count(void);
+int core_count;
/* Power domain context */
struct ppu_v1_pd_ctx {
@@ -219,6 +221,8 @@ static int ppu_v1_core_pd_init(struct ppu_v1_pd_ctx *pd_ctx)
ppu_v1_dynamic_enable(ppu, PPU_V1_MODE_OFF);
}
+ core_count = infra_get_core_count();
+
return FWK_SUCCESS;
}
@@ -227,6 +231,7 @@ static int ppu_v1_core_pd_set_state(fwk_id_t core_pd_id, unsigned int state)
int status;
struct ppu_v1_pd_ctx *pd_ctx;
struct ppu_v1_reg *ppu;
+ int core_index = 0;
status = fwk_module_check_call(core_pd_id);
if (status != FWK_SUCCESS)
@@ -234,6 +239,7 @@ static int ppu_v1_core_pd_set_state(fwk_id_t core_pd_id, unsigned int state)
pd_ctx = ppu_v1_ctx.pd_ctx_table + fwk_id_get_element_idx(core_pd_id);
ppu = pd_ctx->ppu;
+ core_index = fwk_id_get_element_idx(core_pd_id);
switch (state) {
case MOD_PD_STATE_OFF:
@@ -250,17 +256,38 @@ static int ppu_v1_core_pd_set_state(fwk_id_t core_pd_id, unsigned int state)
break;
case MOD_PD_STATE_ON:
- ppu_v1_interrupt_unmask(ppu, PPU_V1_IMR_DYN_POLICY_MIN_IRQ_MASK);
- ppu_v1_set_input_edge_sensitivity(ppu,
- PPU_V1_MODE_ON,
- PPU_V1_EDGE_SENSITIVITY_MASKED);
- ppu_v1_set_power_mode(ppu, PPU_V1_MODE_ON);
- ppu_v1_dynamic_enable(ppu, PPU_V1_MODE_OFF);
- status = pd_ctx->pd_driver_input_api->report_power_state_transition(
- pd_ctx->bound_id, MOD_PD_STATE_ON);
- assert(status == FWK_SUCCESS);
- break;
-
+ if (core_count == 32) {
+ if (core_index != 0 && (core_index % 2) == 1) {
+ ppu_v1_request_operating_mode(ppu, 0x3);
+ status = pd_ctx->pd_driver_input_api->report_power_state_transition(
+ pd_ctx->bound_id, MOD_PD_STATE_ON);
+ assert(status == FWK_SUCCESS);
+ break;
+ } else {
+ ppu_v1_interrupt_unmask(ppu, PPU_V1_IMR_DYN_POLICY_MIN_IRQ_MASK);
+ ppu_v1_set_input_edge_sensitivity(ppu,
+ PPU_V1_MODE_ON,
+ PPU_V1_EDGE_SENSITIVITY_MASKED);
+ ppu_v1_set_power_mode(ppu, PPU_V1_MODE_ON);
+ ppu_v1_request_operating_mode(ppu, 0x1);
+ ppu_v1_dynamic_enable(ppu, PPU_V1_MODE_OFF);
+ status = pd_ctx->pd_driver_input_api->report_power_state_transition(
+ pd_ctx->bound_id, MOD_PD_STATE_ON);
+ assert(status == FWK_SUCCESS);
+ break;
+ }
+ } else {
+ ppu_v1_interrupt_unmask(ppu, PPU_V1_IMR_DYN_POLICY_MIN_IRQ_MASK);
+ ppu_v1_set_input_edge_sensitivity(ppu,
+ PPU_V1_MODE_ON,
+ PPU_V1_EDGE_SENSITIVITY_MASKED);
+ ppu_v1_set_power_mode(ppu, PPU_V1_MODE_ON);
+ ppu_v1_dynamic_enable(ppu, PPU_V1_MODE_OFF);
+ status = pd_ctx->pd_driver_input_api->report_power_state_transition(
+ pd_ctx->bound_id, MOD_PD_STATE_ON);
+ assert(status == FWK_SUCCESS);
+ break;
+ }
case MOD_PD_STATE_SLEEP:
/*
* If the dynamic transitions have been enabled then the core is
diff --git a/product/rdn1e1/scp_ramfw/config_ppu_v1.c b/product/rdn1e1/scp_ramfw/config_ppu_v1.c
index a6e791a0..ba30cddc 100644
--- a/product/rdn1e1/scp_ramfw/config_ppu_v1.c
+++ b/product/rdn1e1/scp_ramfw/config_ppu_v1.c
@@ -65,6 +65,7 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
unsigned int core_count;
unsigned int cluster_count;
unsigned int core_element_count = 0;
+ unsigned int idx = 0;
core_count = rdn1e1_core_get_core_count();
cluster_count = rdn1e1_core_get_cluster_count();
@@ -90,6 +91,7 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
return NULL;
for (cluster_idx = 0; cluster_idx < cluster_count; cluster_idx++) {
+ idx = 0;
for (core_idx = 0;
core_idx < rdn1e1_core_get_core_per_cluster_count(cluster_idx);
core_idx++) {
@@ -105,8 +107,18 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
element->data = pd_config;
+ if (core_count == 32) {
+ // Increment PPU REG BASE for even core_idx
+ if ((core_idx != 0) && (core_idx % 2 == 0)) {
+ idx = core_idx;
+ idx = idx - (idx/2);
+ }
+ pd_config->ppu.reg_base = SCP_PPU_CORE_BASE(cluster_idx, idx);
+ } else {
+ pd_config->ppu.reg_base = SCP_PPU_CORE_BASE(cluster_idx, core_idx);
+ }
+
pd_config->pd_type = MOD_PD_TYPE_CORE;
- pd_config->ppu.reg_base = SCP_PPU_CORE_BASE(cluster_idx, core_idx);
pd_config->ppu.irq = FWK_INTERRUPT_NONE;
pd_config->cluster_id =
FWK_ID_ELEMENT(FWK_MODULE_IDX_PPU_V1,
diff --git a/product/rdn1e1/src/config_sid.c b/product/rdn1e1/src/config_sid.c
index 2e57223d..af33311a 100644
--- a/product/rdn1e1/src/config_sid.c
+++ b/product/rdn1e1/src/config_sid.c
@@ -10,6 +10,27 @@
#include <mod_sid.h>
#include <scp_rdn1e1_mmap.h>
+#define RDN1E1_CORE_PER_CLUSTER_MAX 16
+#define CORES_PER_CLUSTER_RDN1 4
+#define CORES_PER_CLUSTER_RDE1 16
+#define NUMBER_OF_CLUSTERS 2
+#define RDE1EDGE_CONFIG_NUM 2
+
+unsigned int infra_get_core_count(void)
+{
+ int status;
+ const struct mod_sid_info *system_info;
+
+ status = mod_sid_get_system_info(&system_info);
+ if (status != FWK_SUCCESS)
+ return status;
+
+ if (system_info->config_number == RDE1EDGE_CONFIG_NUM)
+ return NUMBER_OF_CLUSTERS * CORES_PER_CLUSTER_RDE1;
+ else
+ return NUMBER_OF_CLUSTERS * CORES_PER_CLUSTER_RDN1;
+}
+
static const struct fwk_element subsystem_table[] = {
{
.name = "RDN1E1",
diff --git a/product/sgi575/module/sgi575_system/src/mod_sgi575_system.c b/product/sgi575/module/sgi575_system/src/mod_sgi575_system.c
index be6ab856..950be080 100644
--- a/product/sgi575/module/sgi575_system/src/mod_sgi575_system.c
+++ b/product/sgi575/module/sgi575_system/src/mod_sgi575_system.c
@@ -72,6 +72,11 @@ static const uint32_t feature_flags = (SGI575_SDS_FEATURE_FIRMWARE_MASK |
static fwk_id_t sds_feature_availability_id =
FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_SDS, 4);
+unsigned int infra_get_core_count(void)
+{
+ return SGI575_CLUSTERS_MAX * SGI575_CORES_PER_CLUSTER_MAX;
+}
+
/*
* SCMI Messaging stack
*/