diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2023-04-12 21:44:49 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2023-04-17 08:13:38 +0000 |
commit | d521b967c435ca22667d8209d7afd5a6b8090601 (patch) | |
tree | 4715d4767e9974db5c5ca6bea6b54889dbd316f3 /src/soc/intel | |
parent | 15dd44eedd98f5659cc138eedf70983fae95d9bb (diff) |
cpu,soc/intel: Separate single SSDT CPU entry
Change-Id: Ic75e8907de9730c6fdb06dbe799a7644fa90f904
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74399
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r-- | src/soc/intel/baytrail/acpi.c | 34 | ||||
-rw-r--r-- | src/soc/intel/braswell/acpi.c | 34 | ||||
-rw-r--r-- | src/soc/intel/common/block/acpi/acpi.c | 34 |
3 files changed, 57 insertions, 45 deletions
diff --git a/src/soc/intel/baytrail/acpi.c b/src/soc/intel/baytrail/acpi.c index 8bfb345db9..1c6023dabd 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. */ diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c index 308da129a1..1927421b40 100644 --- a/src/soc/intel/braswell/acpi.c +++ b/src/soc/intel/braswell/acpi.c @@ -161,7 +161,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; @@ -276,26 +276,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. */ diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index 51649d0aee..cfc15a840d 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -384,6 +384,22 @@ __weak void soc_power_states_generation(int core_id, { } +static void generate_cpu_entry(int cpu, int core, int cores_per_package) +{ + /* Generate processor \_SB.CPUx */ + acpigen_write_processor_device(cpu * cores_per_package + core); + + /* Generate C-state tables */ + generate_c_state_entries(); + + generate_cppc_entries(core); + + /* Soc specific power states generation */ + soc_power_states_generation(core, cores_per_package); + + acpigen_write_processor_device_end(); +} + void generate_cpu_entries(const struct device *device) { int core_id, cpu_id; @@ -398,22 +414,10 @@ void generate_cpu_entries(const struct device *device) printk(BIOS_DEBUG, "Found %d CPU(s) with %d/%d physical/logical core(s) each.\n", numcpus, num_phys, num_virt); - for (cpu_id = 0; cpu_id < numcpus; cpu_id++) { - for (core_id = 0; core_id < num_virt; core_id++) { - /* Generate processor \_SB.CPUx */ - acpigen_write_processor_device(cpu_id * num_virt + core_id); - - /* Generate C-state tables */ - generate_c_state_entries(); + for (cpu_id = 0; cpu_id < numcpus; cpu_id++) + for (core_id = 0; core_id < num_virt; core_id++) + generate_cpu_entry(cpu_id, core_id, num_virt); - generate_cppc_entries(core_id); - - /* Soc specific power states generation */ - soc_power_states_generation(core_id, num_virt); - - acpigen_write_processor_device_end(); - } - } /* PPKG is usually used for thermal management of the first and only package. */ acpigen_write_processor_package("PPKG", 0, num_virt); |