summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/intel/haswell/acpi.c37
-rw-r--r--src/cpu/intel/model_2065x/acpi.c37
-rw-r--r--src/cpu/intel/model_206ax/acpi.c37
3 files changed, 60 insertions, 51 deletions
diff --git a/src/cpu/intel/haswell/acpi.c b/src/cpu/intel/haswell/acpi.c
index 66d58adef2..3727d8a065 100644
--- a/src/cpu/intel/haswell/acpi.c
+++ b/src/cpu/intel/haswell/acpi.c
@@ -325,6 +325,23 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
+static void generate_cpu_entry(const struct device *device, int cpu, int core, int cores_per_package)
+{
+ /* Generate Scope(\_SB) { Device(CPUx */
+ acpigen_write_processor_device(cpu * cores_per_package + core);
+
+ /* Generate P-state tables */
+ generate_P_state_entries(core, cores_per_package);
+
+ /* Generate C-state tables */
+ generate_C_state_entries(device);
+
+ /* Generate T-state tables */
+ generate_T_state_entries(cpu, cores_per_package);
+
+ acpigen_write_processor_device_end();
+}
+
void generate_cpu_entries(const struct device *device)
{
int totalcores = dev_count_cpu();
@@ -334,23 +351,9 @@ void generate_cpu_entries(const struct device *device)
printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each.\n",
numcpus, cores_per_package);
- for (int cpu_id = 0; cpu_id < numcpus; cpu_id++) {
- for (int core_id = 0; core_id < cores_per_package; core_id++) {
- /* Generate Scope(\_SB) { Device(CPUx */
- acpigen_write_processor_device(cpu_id * cores_per_package + core_id);
-
- /* Generate P-state tables */
- generate_P_state_entries(core_id, cores_per_package);
-
- /* Generate C-state tables */
- generate_C_state_entries(device);
-
- /* Generate T-state tables */
- generate_T_state_entries(cpu_id, cores_per_package);
-
- acpigen_write_processor_device_end();
- }
- }
+ for (int cpu_id = 0; cpu_id < numcpus; cpu_id++)
+ for (int core_id = 0; core_id < cores_per_package; core_id++)
+ generate_cpu_entry(device, cpu_id, core_id, cores_per_package);
/* PPKG is usually used for thermal management
of the first and only package. */
diff --git a/src/cpu/intel/model_2065x/acpi.c b/src/cpu/intel/model_2065x/acpi.c
index 370ea96518..d8fef628b8 100644
--- a/src/cpu/intel/model_2065x/acpi.c
+++ b/src/cpu/intel/model_2065x/acpi.c
@@ -203,6 +203,23 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
+static void generate_cpu_entry(int cpu, int core, int cores_per_package)
+{
+ /* Generate Scope(\_SB) { Device(CPUx */
+ acpigen_write_processor_device(cpu * cores_per_package + core);
+
+ /* Generate P-state tables */
+ generate_P_state_entries(cpu, cores_per_package);
+
+ /* Generate C-state tables */
+ generate_C_state_entries();
+
+ /* Generate T-state tables */
+ generate_T_state_entries(cpu, cores_per_package);
+
+ acpigen_write_processor_device_end();
+}
+
void generate_cpu_entries(const struct device *device)
{
int totalcores = dev_count_cpu();
@@ -212,23 +229,9 @@ void generate_cpu_entries(const struct device *device)
printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each.\n",
numcpus, cores_per_package);
- for (int cpu_id = 0; cpu_id < numcpus; cpu_id++) {
- for (int core_id = 0; core_id < cores_per_package; core_id++) {
- /* Generate Scope(\_SB) { Device(CPUx */
- acpigen_write_processor_device(cpu_id * cores_per_package + core_id);
-
- /* Generate P-state tables */
- generate_P_state_entries(cpu_id, cores_per_package);
-
- /* Generate C-state tables */
- generate_C_state_entries();
-
- /* Generate T-state tables */
- generate_T_state_entries(cpu_id, cores_per_package);
-
- acpigen_write_processor_device_end();
- }
- }
+ for (int cpu_id = 0; cpu_id < numcpus; cpu_id++)
+ for (int core_id = 0; core_id < cores_per_package; core_id++)
+ generate_cpu_entry(cpu_id, core_id, cores_per_package);
/* PPKG is usually used for thermal management
of the first and only package. */
diff --git a/src/cpu/intel/model_206ax/acpi.c b/src/cpu/intel/model_206ax/acpi.c
index a10f8dc66e..994f3bbe9e 100644
--- a/src/cpu/intel/model_206ax/acpi.c
+++ b/src/cpu/intel/model_206ax/acpi.c
@@ -294,6 +294,23 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
+static void generate_cpu_entry(const struct device *device, int cpu, int core, int cores_per_package)
+{
+ /* Generate Scope(\_SB) { Device(CPUx */
+ acpigen_write_processor_device(cpu * cores_per_package + core);
+
+ /* Generate P-state tables */
+ generate_P_state_entries(cpu, cores_per_package);
+
+ /* Generate C-state tables */
+ generate_C_state_entries(device);
+
+ /* Generate T-state tables */
+ generate_T_state_entries(cpu, cores_per_package);
+
+ acpigen_write_processor_device_end();
+}
+
void generate_cpu_entries(const struct device *device)
{
int totalcores = dev_count_cpu();
@@ -303,23 +320,9 @@ void generate_cpu_entries(const struct device *device)
printk(BIOS_DEBUG, "Found %d CPU(s) with %d core(s) each.\n",
numcpus, cores_per_package);
- for (int cpu_id = 0; cpu_id < numcpus; cpu_id++) {
- for (int core_id = 0; core_id < cores_per_package; core_id++) {
- /* Generate Scope(\_SB) { Device(CPUx */
- acpigen_write_processor_device(cpu_id * cores_per_package + core_id);
-
- /* Generate P-state tables */
- generate_P_state_entries(cpu_id, cores_per_package);
-
- /* Generate C-state tables */
- generate_C_state_entries(device);
-
- /* Generate T-state tables */
- generate_T_state_entries(cpu_id, cores_per_package);
-
- acpigen_write_processor_device_end();
- }
- }
+ for (int cpu_id = 0; cpu_id < numcpus; cpu_id++)
+ for (int core_id = 0; core_id < cores_per_package; core_id++)
+ generate_cpu_entry(device, cpu_id, core_id, cores_per_package);
/* PPKG is usually used for thermal management
of the first and only package. */