aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>2019-12-11 18:21:49 +0530
committerVijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>2019-12-11 18:21:49 +0530
commit7fa712a00b7b737c2a086189daa5cc6f752ef040 (patch)
tree21ee0c32fe942ce2732655afb5efe521f018443a
parentd1bcfb96cc3b3f27b380dfd595992e558f7930c3 (diff)
rddaniel: enable address translationRD-INFRA-MC-2019.12.13refinfra-mc
Enable address translation so that all the chips can access the trusted RAM of the boot region. Change-Id: I7e86166c92c5d32717c3534a468aa959dd470aaf Signed-off-by: Vijayenthiran Subramaniam <vijayenthiran.subramaniam@arm.com>
-rw-r--r--module/smt/src/mod_smt.c2
-rw-r--r--product/rddaniel/module/rddaniel_system/src/mod_rddaniel_system.c23
-rw-r--r--product/rddaniel/scp_ramfw/config_armv7m_mpu.c5
-rw-r--r--product/rddaniel/scp_ramfw/config_sideband.c24
-rw-r--r--product/rddaniel/scp_ramfw/config_smt.c3
5 files changed, 43 insertions, 14 deletions
diff --git a/module/smt/src/mod_smt.c b/module/smt/src/mod_smt.c
index fcdbd183..e4e9af15 100644
--- a/module/smt/src/mod_smt.c
+++ b/module/smt/src/mod_smt.c
@@ -623,7 +623,7 @@ static int smt_process_notification(
if (channel_ctx->config->policies & MOD_SMT_POLICY_INIT_MAILBOX) {
/* Initialize mailbox */
- *((struct mod_smt_memory *)channel_ctx->config->mailbox_address) =
+ *((struct mod_smt_memory *)0xA4000DC0) =
(struct mod_smt_memory) {
.status = (1 << MOD_SMT_MAILBOX_STATUS_FREE_POS)
};
diff --git a/product/rddaniel/module/rddaniel_system/src/mod_rddaniel_system.c b/product/rddaniel/module/rddaniel_system/src/mod_rddaniel_system.c
index 2910369b..dbefa68e 100644
--- a/product/rddaniel/module/rddaniel_system/src/mod_rddaniel_system.c
+++ b/product/rddaniel/module/rddaniel_system/src/mod_rddaniel_system.c
@@ -31,6 +31,7 @@
#include <rddaniel_sds.h>
#include <scp_rddaniel_irq.h>
#include <scp_rddaniel_mmap.h>
+#include <scp_rddaniel_pik.h>
#include <scp_rddaniel_scmi.h>
#include <config_clock.h>
@@ -185,6 +186,18 @@ static const struct mod_system_power_driver_api
};
/*
+ * AP memory 1MB windowed access driver API
+ */
+static void enable_ap_memory_access(uint32_t addr_47_20)
+{
+ uint32_t addr_trans_reg = 0;
+
+ addr_trans_reg = addr_47_20 << 1;
+ addr_trans_reg |= 0x1;
+ PIK_SCP->ADDR_TRANS = addr_trans_reg;
+}
+
+/*
* Functions fulfilling the framework's module interface
*/
@@ -320,6 +333,16 @@ int rddaniel_system_process_notification(const struct fwk_event *event,
chip_id = sid_info->node_number;
+ /*
+ * Configure the address translation to access the Trusted RAM
+ * region. This is done in order to access the Trusted RAM from the
+ * SCPs of Chip 1-3.
+ */
+ enable_ap_memory_access(0x040);
+ rddaniel_system_ctx.log_api->log(MOD_LOG_GROUP_DEBUG,
+ "[RD-Daniel] MSCP Address Translation enabled for Chip %d\n",
+ chip_id);
+
/* If the chip is not a master chip, then don't turn on any cpu */
if (chip_id == 0) {
rddaniel_system_ctx.log_api->log(MOD_LOG_GROUP_DEBUG,
diff --git a/product/rddaniel/scp_ramfw/config_armv7m_mpu.c b/product/rddaniel/scp_ramfw/config_armv7m_mpu.c
index 7ff36959..2fee6d53 100644
--- a/product/rddaniel/scp_ramfw/config_armv7m_mpu.c
+++ b/product/rddaniel/scp_ramfw/config_armv7m_mpu.c
@@ -37,6 +37,11 @@ static const ARM_MPU_Region_t regions[] = {
.RASR = ARM_MPU_RASR(
1, ARM_MPU_AP_PRIV, 0, 1, 1, 1, 0, ARM_MPU_REGION_SIZE_256B),
},
+ { /* 0xCB00_0000 - 0xCB00_7FFF*/
+ .RBAR = ARM_MPU_RBAR(3, 0xCB000000),
+ .RASR = ARM_MPU_RASR(
+ 1, ARM_MPU_AP_PRIV, 0, 1, 1, 1, 0, ARM_MPU_REGION_SIZE_4KB),
+ },
};
const struct fwk_module_config config_armv7m_mpu = {
diff --git a/product/rddaniel/scp_ramfw/config_sideband.c b/product/rddaniel/scp_ramfw/config_sideband.c
index 734e542d..90262799 100644
--- a/product/rddaniel/scp_ramfw/config_sideband.c
+++ b/product/rddaniel/scp_ramfw/config_sideband.c
@@ -53,7 +53,7 @@ struct remote_instance remote_instances1[] = {
[0] = {
.process = {
.remote_instance_id = 0,
- .read_address = 0xA4001000,
+ .read_address = 0xCB001000,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 2, 0),
@@ -65,7 +65,7 @@ struct remote_instance remote_instances1[] = {
[1] = {
.process = {
.remote_instance_id = 2,
- .read_address = 0xA4001000 + 0x400 + 0x400,
+ .read_address = 0xCB001000 + 0x400 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 3, 0),
@@ -77,7 +77,7 @@ struct remote_instance remote_instances1[] = {
[2] = {
.process = {
.remote_instance_id = 3,
- .read_address = 0xA4001000 + 0x400 + 0x400 + 0x400,
+ .read_address = 0xCB001000 + 0x400 + 0x400 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 4, 0),
@@ -93,7 +93,7 @@ struct remote_instance remote_instances2[] = {
[0] = {
.process = {
.remote_instance_id = 0,
- .read_address = 0xA4001000,
+ .read_address = 0xCB001000,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 2, 0),
@@ -105,7 +105,7 @@ struct remote_instance remote_instances2[] = {
[1] = {
.process = {
.remote_instance_id = 1,
- .read_address = 0xA4001000 + 0x400,
+ .read_address = 0xCB001000 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 3, 0),
@@ -117,7 +117,7 @@ struct remote_instance remote_instances2[] = {
[2] = {
.process = {
.remote_instance_id = 3,
- .read_address = 0xA4001000 + 0x400 + 0x400 + 0x400,
+ .read_address = 0xCB001000 + 0x400 + 0x400 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 4, 0),
@@ -133,7 +133,7 @@ struct remote_instance remote_instances3[] = {
[0] = {
.process = {
.remote_instance_id = 0,
- .read_address = 0xA4001000,
+ .read_address = 0xCB001000,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 2, 0),
@@ -145,7 +145,7 @@ struct remote_instance remote_instances3[] = {
[1] = {
.process = {
.remote_instance_id = 1,
- .read_address = 0xA4001000 + 0x400,
+ .read_address = 0xCB001000 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 3, 0),
@@ -157,7 +157,7 @@ struct remote_instance remote_instances3[] = {
[2] = {
.process = {
.remote_instance_id = 2,
- .read_address = 0xA4001000 + 0x400 + 0x400,
+ .read_address = 0xCB001000 + 0x400 + 0x400,
},
.transport = {
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2, 4, 0),
@@ -186,7 +186,7 @@ static const struct fwk_element instance_table1[] = {
[0] = {
.name = "INSTANCE1",
.data = &((struct instance_ctx) {
- .write_base_address = 0xA4001000 + 0x400,
+ .write_base_address = 0xCB001000 + 0x400,
.write_max_size = 0x400,
.instance_id = 1,
.remote_instances = remote_instances1,
@@ -200,7 +200,7 @@ static const struct fwk_element instance_table2[] = {
[0] = {
.name = "INSTANCE2",
.data = &((struct instance_ctx) {
- .write_base_address = 0xA4001000 + 0x400 + 0x400,
+ .write_base_address = 0xCB001000 + 0x400 + 0x400,
.write_max_size = 0x400,
.instance_id = 2,
.remote_instances = remote_instances2,
@@ -214,7 +214,7 @@ static const struct fwk_element instance_table3[] = {
[0] = {
.name = "INSTANCE3",
.data = &((struct instance_ctx) {
- .write_base_address = 0xA4001000 + 0x400 + 0x400 + 0x400,
+ .write_base_address = 0xCB001000 + 0x400 + 0x400 + 0x400,
.write_max_size = 0x400,
.instance_id = 3,
.remote_instances = remote_instances3,
diff --git a/product/rddaniel/scp_ramfw/config_smt.c b/product/rddaniel/scp_ramfw/config_smt.c
index 8f6441e5..6596fdad 100644
--- a/product/rddaniel/scp_ramfw/config_smt.c
+++ b/product/rddaniel/scp_ramfw/config_smt.c
@@ -23,7 +23,8 @@ static const struct fwk_element smt_element_table[] = {
.data = &((struct mod_smt_channel_config) {
.type = MOD_SMT_CHANNEL_TYPE_SLAVE,
.policies = MOD_SMT_POLICY_INIT_MAILBOX | MOD_SMT_POLICY_SECURE,
- .mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD_S_A2P_BASE,
+ /* Mailbox addr when ADDR_TRAN enabled */
+ .mailbox_address = (uintptr_t)(0xCB000DC0),
.mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_MHU2,
SCP_RDDANIEL_MHU_DEVICE_IDX_SCP_AP_S_CLUS0, 0),