summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/baytrail/acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/baytrail/acpi.c')
-rw-r--r--src/soc/intel/baytrail/acpi.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/soc/intel/baytrail/acpi.c b/src/soc/intel/baytrail/acpi.c
index 8bfb345db9ab..1c6023dabd61 100644
--- a/src/soc/intel/baytrail/acpi.c
+++ b/src/soc/intel/baytrail/acpi.c
@@ -132,7 +132,7 @@ static int calculate_power(int tdp, int p1_ratio, int ratio)
return (int)power;
}
-static void generate_p_state_entries(int core, int cores_per_package)
+static void generate_p_state_entries(int core)
{
int ratio_min, ratio_max, ratio_turbo, ratio_step, ratio_range_2;
int coord_type, power_max, power_unit, num_entries;
@@ -247,26 +247,30 @@ static void generate_p_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
-void generate_cpu_entries(const struct device *device)
+static void generate_cpu_entry(int core, int cores_per_package)
{
- int core;
- const struct pattrs *pattrs = pattrs_get();
+ /* Generate Scope(\_SB) { Device(CPUx */
+ acpigen_write_processor_device(core);
- for (core = 0; core < pattrs->num_cpus; core++) {
- /* Generate Scope(\_SB) { Device(CPUx */
- acpigen_write_processor_device(core);
+ /* Generate P-state tables */
+ generate_p_state_entries(core);
- /* Generate P-state tables */
- generate_p_state_entries(core, pattrs->num_cpus);
+ /* Generate C-state tables */
+ acpigen_write_CST_package(cstate_map, ARRAY_SIZE(cstate_map));
- /* Generate C-state tables */
- acpigen_write_CST_package(cstate_map, ARRAY_SIZE(cstate_map));
+ /* Generate T-state tables */
+ generate_t_state_entries(core, cores_per_package);
- /* Generate T-state tables */
- generate_t_state_entries(core, pattrs->num_cpus);
+ acpigen_write_processor_device_end();
+}
- acpigen_write_processor_device_end();
- }
+void generate_cpu_entries(const struct device *device)
+{
+ int core;
+ const struct pattrs *pattrs = pattrs_get();
+
+ for (core = 0; core < pattrs->num_cpus; core++)
+ generate_cpu_entry(core, pattrs->num_cpus);
/* PPKG is usually used for thermal management
of the first and only package. */