Attention is currently required from: Arthur Heymans, Patrick Rudolph. Hello Arthur Heymans,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/59314
to review the following change.
Change subject: cpu/haswell/acpi.c: Use static.c exposed lapic 0 ......................................................................
cpu/haswell/acpi.c: Use static.c exposed lapic 0
Change-Id: Ic449b2df8036e8c02b5559cca6b2e7479a70a786 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/intel/haswell/acpi.c M src/cpu/intel/haswell/chip.h M src/cpu/intel/haswell/haswell_init.c 3 files changed, 4 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/59314/1
diff --git a/src/cpu/intel/haswell/acpi.c b/src/cpu/intel/haswell/acpi.c index f20d446..711f372 100644 --- a/src/cpu/intel/haswell/acpi.c +++ b/src/cpu/intel/haswell/acpi.c @@ -168,12 +168,7 @@ if (!haswell_is_ult()) return false;
- const struct device *lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC); - - if (!lapic || !lapic->chip_info) - return false; - - const struct cpu_intel_haswell_config *conf = lapic->chip_info; + const struct cpu_intel_haswell_config *conf = config_of(config_of_lapic());
return conf->s0ix_enable; } diff --git a/src/cpu/intel/haswell/chip.h b/src/cpu/intel/haswell/chip.h index 776e239..5f2324c 100644 --- a/src/cpu/intel/haswell/chip.h +++ b/src/cpu/intel/haswell/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 - #include <stdbool.h> #include <stdint.h>
diff --git a/src/cpu/intel/haswell/haswell_init.c b/src/cpu/intel/haswell/haswell_init.c index d4f3587..872c728 100644 --- a/src/cpu/intel/haswell/haswell_init.c +++ b/src/cpu/intel/haswell/haswell_init.c @@ -179,13 +179,8 @@ struct cpu_vr_config vr_config = { 0 }; msr_t msr;
- const struct device *lapic = dev_find_lapic(SPEEDSTEP_APIC_MAGIC); - - if (lapic && lapic->chip_info) { - const struct cpu_intel_haswell_config *conf = lapic->chip_info; - - vr_config = conf->vr_config; - } + const struct cpu_intel_haswell_config *conf = config_of(config_of_lapic()); + vr_config = conf->vr_config;
printk(BIOS_DEBUG, "Initializing VR config.\n");
@@ -452,16 +447,9 @@
static void configure_thermal_target(void) { - struct cpu_intel_haswell_config *conf; - struct device *lapic; + const struct cpu_intel_haswell_config *conf = config_of(config_of_lapic()); 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) {