aboutsummaryrefslogtreecommitdiff
path: root/product/rddaniel
diff options
context:
space:
mode:
authorAditya Angadi <aditya.angadi@arm.com>2020-01-08 12:47:27 +0530
committerjimqui01 <54316584+jimqui01@users.noreply.github.com>2020-02-05 18:37:04 +0000
commitd62347839c205bd4b6475a81440e9be2dad4161c (patch)
treeeff0156c4611c98007a5fab6648dfcce22da0a81 /product/rddaniel
parent7e7b15a04e5969ec6d6593423625b070febea819 (diff)
product/rddaniel: add configuration data for sds service module
SDS module is used to pass runtime data from SCP firmware to the firmware on AP core using shared memory. Provide the base address and size for the same and also the payloads to be passed. Change-Id: I09d4ddbf5f4c8c305907e4c02832062f7dc0199c Signed-off-by: Aditya Angadi <aditya.angadi@arm.com>
Diffstat (limited to 'product/rddaniel')
-rw-r--r--product/rddaniel/include/rddaniel_sds.h64
-rw-r--r--product/rddaniel/include/scp_software_mmap.h4
-rw-r--r--product/rddaniel/scp_ramfw/config_sds.c100
3 files changed, 168 insertions, 0 deletions
diff --git a/product/rddaniel/include/rddaniel_sds.h b/product/rddaniel/include/rddaniel_sds.h
new file mode 100644
index 00000000..be852dc4
--- /dev/null
+++ b/product/rddaniel/include/rddaniel_sds.h
@@ -0,0 +1,64 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef RDDANIEL_SDS_H
+#define RDDANIEL_SDS_H
+
+#include <mod_sds.h>
+
+/*
+ * Structure identifiers.
+ */
+enum rddaniel_sds_struct_id {
+ RDDANIEL_SDS_CPU_INFO = 1 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_FIRMWARE_VERSION = 2 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_PLATFORM_ID = 3 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_RESET_SYNDROME = 4 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_FEATURE_AVAILABILITY = 5 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_CPU_BOOTCTR = 6 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+ RDDANIEL_SDS_CPU_FLAGS = 7 | (1 << MOD_SDS_ID_VERSION_MAJOR_POS),
+};
+
+/*
+ * Structure sizes.
+ */
+#define RDDANIEL_SDS_CPU_INFO_SIZE 4
+#define RDDANIEL_SDS_FIRMWARE_VERSION_SIZE 4
+#define RDDANIEL_SDS_PLATFORM_ID_SIZE 8
+#define RDDANIEL_SDS_RESET_SYNDROME_SIZE 4
+#define RDDANIEL_SDS_FEATURE_AVAILABILITY_SIZE 4
+#define RDDANIEL_SDS_CPU_BOOTCTR_SIZE 256
+#define RDDANIEL_SDS_CPU_FLAGS_SIZE 256
+
+/*
+ * Field masks and offsets for the RDDANIEL_SDS_AP_CPU_INFO structure.
+ */
+#define RDDANIEL_SDS_CPU_INFO_PRIMARY_MASK 0xFFFFFFFF
+#define RDDANIEL_SDS_CPU_INFO_PRIMARY_POS 0
+
+/*
+ * Platform information
+ */
+struct rddaniel_sds_platid {
+ /* Subsystem part number */
+ uint32_t platform_identifier;
+ /* Platform type information */
+ uint32_t platform_type_identifier;
+};
+
+/*
+ * Field masks and offsets for the RDDANIEL_SDS_FEATURE_AVAILABILITY structure.
+ */
+#define RDDANIEL_SDS_FEATURE_FIRMWARE_MASK 0x1
+#define RDDANIEL_SDS_FEATURE_DMC_MASK 0x2
+#define RDDANIEL_SDS_FEATURE_MESSAGING_MASK 0x4
+
+#define RDDANIEL_SDS_FEATURE_FIRMWARE_POS 0
+#define RDDANIEL_SDS_FEATURE_DMC_POS 1
+#define RDDANIEL_SDS_FEATURE_MESSAGING_POS 2
+
+#endif /* RDDANIEL_SDS_H */
diff --git a/product/rddaniel/include/scp_software_mmap.h b/product/rddaniel/include/scp_software_mmap.h
index 29d701f6..23a6810c 100644
--- a/product/rddaniel/include/scp_software_mmap.h
+++ b/product/rddaniel/include/scp_software_mmap.h
@@ -35,4 +35,8 @@
SCP_AP_CONTEXT_SIZE)
#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)
+
#endif /* SCP_SOFTWARE_MMAP_H */
diff --git a/product/rddaniel/scp_ramfw/config_sds.c b/product/rddaniel/scp_ramfw/config_sds.c
new file mode 100644
index 00000000..89fc5017
--- /dev/null
+++ b/product/rddaniel/scp_ramfw/config_sds.c
@@ -0,0 +1,100 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdbool.h>
+#include <fwk_assert.h>
+#include <fwk_element.h>
+#include <fwk_macros.h>
+#include <fwk_module.h>
+#include <fwk_module_idx.h>
+#include <mod_sds.h>
+#include <mod_sid.h>
+#include <clock_soc.h>
+#include <rddaniel_sds.h>
+#include <scp_pik.h>
+#include <scp_software_mmap.h>
+
+static const uint32_t version_packed = FWK_BUILD_VERSION;
+static const uint32_t feature_flags = 0x00000000;
+
+const struct mod_sds_config sds_module_config = {
+ .region_base_address = SCP_SDS_MEM_BASE,
+ .region_size = SCP_SDS_MEM_SIZE,
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK,
+ CLOCK_IDX_INTERCONNECT)
+};
+
+static struct fwk_element sds_element_table[] = {
+ {
+ .name = "CPU Info",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_CPU_INFO,
+ .size = RDDANIEL_SDS_CPU_INFO_SIZE,
+ .finalize = true,
+ }),
+ },
+ {
+ .name = "Firmware version",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_FIRMWARE_VERSION,
+ .size = RDDANIEL_SDS_FIRMWARE_VERSION_SIZE,
+ .payload = &version_packed,
+ .finalize = true,
+ }),
+ },
+ {
+ .name = "Reset Syndrome",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_RESET_SYNDROME,
+ .size = RDDANIEL_SDS_RESET_SYNDROME_SIZE,
+ .payload = (void *)(&SCP_PIK_PTR->RESET_SYNDROME),
+ .finalize = true,
+ }),
+ },
+ {
+ .name = "Feature Availability",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_FEATURE_AVAILABILITY,
+ .size = RDDANIEL_SDS_FEATURE_AVAILABILITY_SIZE,
+ .payload = &feature_flags,
+ .finalize = true,
+ }),
+ },
+#ifdef BUILD_HAS_MOD_TEST
+ {
+ .name = "Boot Counters",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_CPU_BOOTCTR,
+ .size = RDDANIEL_SDS_CPU_BOOTCTR_SIZE,
+ .finalize = true,
+ }),
+ },
+ {
+ .name = "CPU Flags",
+ .data = &((struct mod_sds_structure_desc) {
+ .id = RDDANIEL_SDS_CPU_FLAGS,
+ .size = RDDANIEL_SDS_CPU_FLAGS_SIZE,
+ .finalize = true,
+ }),
+ },
+#endif
+ { 0 }, /* Termination description. */
+};
+
+static const struct fwk_element *sds_get_element_table(fwk_id_t module_id)
+{
+ static_assert(BUILD_VERSION_MAJOR < UINT8_MAX, "Invalid version size");
+ static_assert(BUILD_VERSION_MINOR < UINT8_MAX, "Invalid version size");
+ static_assert(BUILD_VERSION_PATCH < UINT16_MAX, "Invalid version size");
+
+ return sds_element_table;
+}
+
+struct fwk_module_config config_sds = {
+ .get_element_table = sds_get_element_table,
+ .data = &sds_module_config,
+};