aboutsummaryrefslogtreecommitdiff
path: root/product/rdn1e1/scp_ramfw/config_dvfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'product/rdn1e1/scp_ramfw/config_dvfs.c')
-rw-r--r--product/rdn1e1/scp_ramfw/config_dvfs.c82
1 files changed, 73 insertions, 9 deletions
diff --git a/product/rdn1e1/scp_ramfw/config_dvfs.c b/product/rdn1e1/scp_ramfw/config_dvfs.c
index 3ef546f6..13fcbc55 100644
--- a/product/rdn1e1/scp_ramfw/config_dvfs.c
+++ b/product/rdn1e1/scp_ramfw/config_dvfs.c
@@ -11,8 +11,11 @@
#include <fwk_module_idx.h>
#include <mod_dvfs.h>
#include <config_clock.h>
+#include <mod_sid.h>
+#include <rdn1e1_sds.h>
+#include <fwk_assert.h>
-static struct mod_dvfs_opp opps[] = {
+static struct mod_dvfs_opp rdn1_opps[] = {
{
.frequency = 1313 * FWK_MHZ,
.voltage = 100,
@@ -36,37 +39,98 @@ static struct mod_dvfs_opp opps[] = {
{ 0 }
};
-static const struct mod_dvfs_domain_config cpu_group0 = {
+static struct mod_dvfs_opp rde1_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 = 2300 * FWK_MHZ,
+ .voltage = 500,
+ },
+ { 0 }
+};
+
+static const struct mod_dvfs_domain_config rdn1_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,
+ .opps = rdn1_opps,
};
-static const struct mod_dvfs_domain_config cpu_group1 = {
+static const struct mod_dvfs_domain_config rdn1_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,
+ .opps = rdn1_opps,
};
-static const struct fwk_element element_table[] = {
+static const struct mod_dvfs_domain_config rde1_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 = rde1_opps,
+};
+
+static const struct mod_dvfs_domain_config rde1_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 = rde1_opps,
+};
+
+static const struct fwk_element rdn1_element_table[] = {
[0] = {
.name = "GROUP0",
- .data = &cpu_group0,
+ .data = &rdn1_cpu_group0,
},
[1] = {
.name = "GROUP1",
- .data = &cpu_group1,
+ .data = &rdn1_cpu_group1,
+ },
+ { 0 }
+};
+
+static const struct fwk_element rde1_element_table[] = {
+ [0] = {
+ .name = "GROUP0",
+ .data = &rde1_cpu_group0,
+ },
+ [1] = {
+ .name = "GROUP1",
+ .data = &rde1_cpu_group1,
},
{ 0 }
};
static const struct fwk_element *dvfs_get_element_table(fwk_id_t module_id)
{
- return element_table;
+ int status;
+ const struct mod_sid_info *system_info;
+
+ status = mod_sid_get_system_info(&system_info);
+ fwk_assert(status);
+
+ if (system_info->config_number == RDE1EDGE_CONFIG_NUM)
+ return rde1_element_table;
+ else
+ return rdn1_element_table;
}
const struct fwk_module_config config_dvfs = {