summaryrefslogtreecommitdiff
path: root/src/cpu/intel
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-11-15 20:12:02 +0100
committerArthur Heymans <arthur@aheymans.xyz>2022-12-01 10:27:31 +0000
commitcdb26fd011285124a6ed5e6be6dddc806ca5b3a8 (patch)
treeffab336e5873ae9c0b5fd62e0feacbbab062b778 /src/cpu/intel
parentd52bfbb6aa822b8d5137bedef638a5214a07e4da (diff)
cpu/intel/model_206ax: Remove fake lapic device
Instead of using a fake lapic device hook up the cpu cluster to chip cpu/intel/model_206ax. The lapic device is also not needed as the mp init will allocate it for the BSP at runtime. Change-Id: Id3b1c4ca027e2905535e137691c3e3e60417dbf3 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59316 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/cpu/intel')
-rw-r--r--src/cpu/intel/model_206ax/acpi.c15
-rw-r--r--src/cpu/intel/model_206ax/chip.h3
-rw-r--r--src/cpu/intel/model_206ax/model_206ax_init.c13
3 files changed, 6 insertions, 25 deletions
diff --git a/src/cpu/intel/model_206ax/acpi.c b/src/cpu/intel/model_206ax/acpi.c
index 06913bcdc0..d2d6467455 100644
--- a/src/cpu/intel/model_206ax/acpi.c
+++ b/src/cpu/intel/model_206ax/acpi.c
@@ -95,18 +95,9 @@ static int get_logical_cores_per_package(void)
return msr.lo & 0xffff;
}
-static void generate_C_state_entries(void)
+static void generate_C_state_entries(const struct device *dev)
{
- struct device *lapic;
- struct cpu_intel_model_206ax_config *conf = NULL;
-
- /* Find the SpeedStep CPU in the device tree using magic APIC ID */
- lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC);
- if (!lapic)
- return;
- conf = lapic->chip_info;
- if (!conf)
- return;
+ struct cpu_intel_model_206ax_config *conf = dev->bus->dev->chip_info;
const int acpi_cstates[3] = { conf->acpi_c1, conf->acpi_c2, conf->acpi_c3 };
@@ -324,7 +315,7 @@ void generate_cpu_entries(const struct device *device)
cpuID-1, cores_per_package);
/* Generate C-state tables */
- generate_C_state_entries();
+ generate_C_state_entries(device);
/* Generate T-state tables */
generate_T_state_entries(
diff --git a/src/cpu/intel/model_206ax/chip.h b/src/cpu/intel/model_206ax/chip.h
index a46c7bf154..13cf3163e0 100644
--- a/src/cpu/intel/model_206ax/chip.h
+++ b/src/cpu/intel/model_206ax/chip.h
@@ -1,8 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-/* Magic value used to locate this chip in the device tree */
-#define SPEEDSTEP_APIC_MAGIC 0xACAC
-
/* Keep this in sync with acpi.c */
enum cpu_acpi_level {
CPU_ACPI_DISABLED = 0,
diff --git a/src/cpu/intel/model_206ax/model_206ax_init.c b/src/cpu/intel/model_206ax/model_206ax_init.c
index 8bb1091687..6522e0febb 100644
--- a/src/cpu/intel/model_206ax/model_206ax_init.c
+++ b/src/cpu/intel/model_206ax/model_206ax_init.c
@@ -211,18 +211,11 @@ static void configure_c_states(void)
wrmsr(MSR_PP1_CURRENT_CONFIG, msr);
}
-static void configure_thermal_target(void)
+static void configure_thermal_target(struct device *dev)
{
- struct cpu_intel_model_206ax_config *conf;
- struct device *lapic;
+ struct cpu_intel_model_206ax_config *conf = dev->bus->dev->chip_info;
msr_t msr;
- /* Find pointer to CPU configuration */
- lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC);
- if (!lapic || !lapic->chip_info)
- return;
- conf = lapic->chip_info;
-
/* Set TCC activation offset if supported */
msr = rdmsr(MSR_PLATFORM_INFO);
if ((msr.lo & (1 << 30)) && conf->tcc_offset) {
@@ -346,7 +339,7 @@ static void model_206ax_init(struct device *cpu)
configure_misc();
/* Thermal throttle activation offset */
- configure_thermal_target();
+ configure_thermal_target(cpu);
set_aesni_lock();