aboutsummaryrefslogtreecommitdiff
path: root/product/sgi575
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2018-07-23 14:13:34 +0530
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2018-10-18 17:22:34 +0000
commit4ee0fb7142d79df115265f8a12c1d93138e42102 (patch)
tree318cd7b1fcddc24ff1f32410e5e4c4d4064c7871 /product/sgi575
parentefad651a4acf8fc66b0b4a2c3be5bf5a00804ec3 (diff)
sgi575/scp_ramfw: Add support for DVFS and SCMI Perf
Change-Id: Ie3a3e0c72f9afc30b36f5e4732e5dd5a451d7305 Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
Diffstat (limited to 'product/sgi575')
-rw-r--r--product/sgi575/scp_ramfw/config_dvfs.c74
-rw-r--r--product/sgi575/scp_ramfw/config_mock_psu.c39
-rw-r--r--product/sgi575/scp_ramfw/config_psu.c41
-rw-r--r--product/sgi575/scp_ramfw/config_scmi_perf.c36
-rw-r--r--product/sgi575/scp_ramfw/firmware.mk10
5 files changed, 199 insertions, 1 deletions
diff --git a/product/sgi575/scp_ramfw/config_dvfs.c b/product/sgi575/scp_ramfw/config_dvfs.c
new file mode 100644
index 00000000..a4f20070
--- /dev/null
+++ b/product/sgi575/scp_ramfw/config_dvfs.c
@@ -0,0 +1,74 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_element.h>
+#include <fwk_macros.h>
+#include <fwk_module.h>
+#include <fwk_module_idx.h>
+#include <mod_dvfs.h>
+#include <config_clock.h>
+
+static struct mod_dvfs_opp opps[] = {
+ {
+ .frequency = 1313 * FWK_MHZ,
+ .voltage = 100,
+ },
+ {
+ .frequency = 1531 * FWK_MHZ,
+ .voltage = 200,
+ },
+ {
+ .frequency = 1750 * FWK_MHZ,
+ .voltage = 300,
+ },
+ {
+ .frequency = 2100 * FWK_MHZ,
+ .voltage = 400,
+ },
+ {
+ .frequency = 2600 * FWK_MHZ,
+ .voltage = 500,
+ },
+ { 0 }
+};
+
+static const struct mod_dvfs_domain_config cpu_group0 = {
+ .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 0),
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP0),
+ .latency = 1200,
+ .sustained_idx = 2,
+ .opps = opps,
+};
+
+static const struct mod_dvfs_domain_config cpu_group1 = {
+ .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 1),
+ .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP1),
+ .latency = 1200,
+ .sustained_idx = 2,
+ .opps = opps,
+};
+
+static const struct fwk_element element_table[] = {
+ [0] = {
+ .name = "GROUP0",
+ .data = &cpu_group0,
+ },
+ [1] = {
+ .name = "GROUP1",
+ .data = &cpu_group1,
+ },
+ { 0 }
+};
+
+static const struct fwk_element *dvfs_get_element_table(fwk_id_t module_id)
+{
+ return element_table;
+}
+
+const struct fwk_module_config config_dvfs = {
+ .get_element_table = dvfs_get_element_table,
+};
diff --git a/product/sgi575/scp_ramfw/config_mock_psu.c b/product/sgi575/scp_ramfw/config_mock_psu.c
new file mode 100644
index 00000000..453f6273
--- /dev/null
+++ b/product/sgi575/scp_ramfw/config_mock_psu.c
@@ -0,0 +1,39 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_element.h>
+#include <fwk_module.h>
+#include <mod_mock_psu.h>
+
+static const struct fwk_element element_table[] = {
+ {
+ .name = "DVFS_GROUP0",
+ .data =
+ &(const struct mod_mock_psu_device_config){
+ .default_enabled = true,
+ .default_voltage = 100,
+ },
+ },
+ {
+ .name = "DVFS_GROUP1",
+ .data =
+ &(const struct mod_mock_psu_device_config){
+ .default_enabled = true,
+ .default_voltage = 100,
+ },
+ },
+ { 0 }
+};
+
+static const struct fwk_element *get_element_table(fwk_id_t module_id)
+{
+ return element_table;
+}
+
+const struct fwk_module_config config_mock_psu = {
+ .get_element_table = get_element_table,
+};
diff --git a/product/sgi575/scp_ramfw/config_psu.c b/product/sgi575/scp_ramfw/config_psu.c
new file mode 100644
index 00000000..5a8654a9
--- /dev/null
+++ b/product/sgi575/scp_ramfw/config_psu.c
@@ -0,0 +1,41 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <fwk_element.h>
+#include <fwk_module.h>
+#include <fwk_module_idx.h>
+#include <mod_mock_psu.h>
+#include <mod_psu.h>
+
+static const struct fwk_element element_table[] = {
+ {
+ .name = "DVFS_GROUP0",
+ .data = &(const struct mod_psu_device_config) {
+ .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 0),
+ .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_MOCK_PSU,
+ MOD_MOCK_PSU_API_IDX_PSU_DRIVER)
+ },
+ },
+ {
+ .name = "DVFS_GROUP1",
+ .data = &(const struct mod_psu_device_config){
+ .driver_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_MOCK_PSU, 1),
+ .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_MOCK_PSU,
+ MOD_MOCK_PSU_API_IDX_PSU_DRIVER)
+ },
+ },
+ { 0 }
+};
+
+static const struct fwk_element *psu_get_element_table(fwk_id_t module_id)
+{
+ return element_table;
+}
+
+const struct fwk_module_config config_psu = {
+ .get_element_table = psu_get_element_table,
+};
diff --git a/product/sgi575/scp_ramfw/config_scmi_perf.c b/product/sgi575/scp_ramfw/config_scmi_perf.c
new file mode 100644
index 00000000..e5d25f2f
--- /dev/null
+++ b/product/sgi575/scp_ramfw/config_scmi_perf.c
@@ -0,0 +1,36 @@
+/*
+ * Arm SCP/MCP Software
+ * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <stdint.h>
+#include <fwk_element.h>
+#include <fwk_module.h>
+#include <mod_scmi_perf.h>
+#include <scp_sgi575_scmi.h>
+
+static const struct mod_scmi_perf_domain_config domains[] = {
+ [0] = {
+ .permissions = &(const uint32_t[]) {
+ [SCP_SCMI_AGENT_ID_OSPM] = MOD_SCMI_PERF_PERMS_SET_LEVEL |
+ MOD_SCMI_PERF_PERMS_SET_LIMITS,
+ [SCP_SCMI_AGENT_ID_PSCI] = MOD_SCMI_PERF_PERMS_NONE,
+ }
+ },
+ [1] = {
+ .permissions = &(const uint32_t[]) {
+ [SCP_SCMI_AGENT_ID_OSPM] = MOD_SCMI_PERF_PERMS_SET_LEVEL |
+ MOD_SCMI_PERF_PERMS_SET_LIMITS,
+ [SCP_SCMI_AGENT_ID_PSCI] = MOD_SCMI_PERF_PERMS_NONE,
+ }
+ },
+};
+
+const struct fwk_module_config config_scmi_perf = {
+ .get_element_table = NULL,
+ .data = &((struct mod_scmi_perf_config) {
+ .domains = &domains,
+ }),
+};
diff --git a/product/sgi575/scp_ramfw/firmware.mk b/product/sgi575/scp_ramfw/firmware.mk
index 22e4744a..c6e018ad 100644
--- a/product/sgi575/scp_ramfw/firmware.mk
+++ b/product/sgi575/scp_ramfw/firmware.mk
@@ -35,7 +35,11 @@ BS_FIRMWARE_MODULES := \
timer \
sensor \
reg_sensor \
- scmi_sensor
+ scmi_sensor \
+ mock_psu \
+ psu \
+ dvfs \
+ scmi_perf
BS_FIRMWARE_SOURCES := \
rtx_config.c \
@@ -59,6 +63,10 @@ BS_FIRMWARE_SOURCES := \
config_css_clock.c \
config_timer.c \
config_sensor.c \
+ config_mock_psu.c \
+ config_psu.c \
+ config_dvfs.c \
+ config_scmi_perf.c \
config_apcontext.c
include $(BS_DIR)/firmware.mk