aboutsummaryrefslogtreecommitdiff
path: root/product/rddaniel
diff options
context:
space:
mode:
authorPierre-Clément Tosi <pierre-clement.tosi@arm.com>2019-02-11 13:04:37 +0000
committerjimqui01 <54316584+jimqui01@users.noreply.github.com>2020-05-13 12:48:44 +0100
commit77b876b5388191cda7bfb22eb4ff5890c23595d8 (patch)
tree2a5c6eb9232ce23288b77c316bacc1577d3364e2 /product/rddaniel
parent14da3f1407837da1e7aca13f0780b7e240234078 (diff)
sds: Add support for having multiple SDS regions
Update the SDS internal functions to use more than one region (e.g. when creating or accessing an SDS structure) while keeping this multi-region layer invisible to the calling code (which relies on SDS structure IDs, exclusively). Update the module configuration code (incl. configuration data structures and types and handlers for the framework API). Update the platform-specific SDS configuration code to comply with the changes described above. Change-Id: Ic5669000e3f44797f373e94dd143bf2d87564b51 Signed-off-by: Pierre-Clément Tosi <pierre-clement.tosi@arm.com> Signed-off-by: Girish Pathak <girish.pathak@arm.com>
Diffstat (limited to 'product/rddaniel')
-rw-r--r--product/rddaniel/include/rddaniel_sds.h5
-rw-r--r--product/rddaniel/include/scp_software_mmap.h8
-rw-r--r--product/rddaniel/scp_ramfw/config_sds.c21
3 files changed, 28 insertions, 6 deletions
diff --git a/product/rddaniel/include/rddaniel_sds.h b/product/rddaniel/include/rddaniel_sds.h
index 32dc4673..f81c6d94 100644
--- a/product/rddaniel/include/rddaniel_sds.h
+++ b/product/rddaniel/include/rddaniel_sds.h
@@ -25,6 +25,11 @@ enum rddaniel_sds_struct_id {
RDDANIEL_SDS_CPU_FLAGS = 7 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
};
+enum rddaniel_sds_region_idx {
+ RDDANIEL_SDS_REGION_SECURE,
+ RDDANIEL_SDS_REGION_COUNT,
+};
+
/*
* Structure sizes.
*/
diff --git a/product/rddaniel/include/scp_software_mmap.h b/product/rddaniel/include/scp_software_mmap.h
index 536b4de7..49c11af1 100644
--- a/product/rddaniel/include/scp_software_mmap.h
+++ b/product/rddaniel/include/scp_software_mmap.h
@@ -38,13 +38,13 @@
#define SCP_AP_CONTEXT_SIZE (64)
/* SDS Memory Region */
-#define SCP_SDS_MEM_BASE (SCP_AP_SHARED_SECURE_BASE)
-#define SCP_SDS_MEM_SIZE (3520)
+#define SCP_SDS_SECURE_BASE (SCP_AP_SHARED_SECURE_BASE)
+#define SCP_SDS_SECURE_SIZE (3520)
/* SCMI Secure Payload Areas */
#define SCP_SCMI_PAYLOAD_SIZE (128)
-#define SCP_SCMI_PAYLOAD_S_A2P_BASE (SCP_SDS_MEM_BASE + \
- SCP_SDS_MEM_SIZE)
+#define SCP_SCMI_PAYLOAD_S_A2P_BASE (SCP_SDS_SECURE_BASE + \
+ SCP_SDS_SECURE_SIZE)
#define SCP_SCMI_PAYLOAD_S_P2A_BASE (SCP_SCMI_PAYLOAD_S_A2P_BASE + \
SCP_SCMI_PAYLOAD_SIZE)
diff --git a/product/rddaniel/scp_ramfw/config_sds.c b/product/rddaniel/scp_ramfw/config_sds.c
index 0a300591..95ff1ce7 100644
--- a/product/rddaniel/scp_ramfw/config_sds.c
+++ b/product/rddaniel/scp_ramfw/config_sds.c
@@ -25,9 +25,20 @@
static const uint32_t version_packed = FWK_BUILD_VERSION;
static const uint32_t feature_flags = 0x00000000;
+static const struct mod_sds_region_desc sds_module_regions[] = {
+ [RDDANIEL_SDS_REGION_SECURE] = {
+ .base = (void*)SCP_SDS_SECURE_BASE,
+ .size = SCP_SDS_SECURE_SIZE,
+ },
+};
+
+static_assert(FWK_ARRAY_SIZE(sds_module_regions) == RDDANIEL_SDS_REGION_COUNT,
+ "Mismatch between number of SDS regions and number of regions "
+ "provided by the SDS configuration.");
+
const struct mod_sds_config sds_module_config = {
- .region_base_address = SCP_SDS_MEM_BASE,
- .region_size = SCP_SDS_MEM_SIZE,
+ .regions = sds_module_regions,
+ .region_count = RDDANIEL_SDS_REGION_COUNT,
.clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK,
CLOCK_IDX_INTERCONNECT)
};
@@ -38,6 +49,7 @@ static struct fwk_element sds_element_table[] = {
.data = &((struct mod_sds_structure_desc) {
.id = RDDANIEL_SDS_CPU_INFO,
.size = RDDANIEL_SDS_CPU_INFO_SIZE,
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},
@@ -47,6 +59,7 @@ static struct fwk_element sds_element_table[] = {
.id = RDDANIEL_SDS_FIRMWARE_VERSION,
.size = RDDANIEL_SDS_FIRMWARE_VERSION_SIZE,
.payload = &version_packed,
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},
@@ -56,6 +69,7 @@ static struct fwk_element sds_element_table[] = {
.id = RDDANIEL_SDS_RESET_SYNDROME,
.size = RDDANIEL_SDS_RESET_SYNDROME_SIZE,
.payload = (void *)(&SCP_PIK_PTR->RESET_SYNDROME),
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},
@@ -65,6 +79,7 @@ static struct fwk_element sds_element_table[] = {
.id = RDDANIEL_SDS_FEATURE_AVAILABILITY,
.size = RDDANIEL_SDS_FEATURE_AVAILABILITY_SIZE,
.payload = &feature_flags,
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},
@@ -74,6 +89,7 @@ static struct fwk_element sds_element_table[] = {
.data = &((struct mod_sds_structure_desc) {
.id = RDDANIEL_SDS_CPU_BOOTCTR,
.size = RDDANIEL_SDS_CPU_BOOTCTR_SIZE,
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},
@@ -82,6 +98,7 @@ static struct fwk_element sds_element_table[] = {
.data = &((struct mod_sds_structure_desc) {
.id = RDDANIEL_SDS_CPU_FLAGS,
.size = RDDANIEL_SDS_CPU_FLAGS_SIZE,
+ .region_id = RDDANIEL_SDS_REGION_SECURE,
.finalize = true,
}),
},