summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-11-12 19:10:43 +0100
committerArthur Heymans <arthur@aheymans.xyz>2022-11-29 19:58:09 +0000
commitaab91213b2189472cc3f0e6bc11bf60e76902771 (patch)
tree7586d1f137d4a929948775659515f0d68be7a418
parent39f5042d9e67439a9d486248d4578c4e3dca6277 (diff)
soc/intel/alderlake/acpi.c: Don't look up coreboot CPU index
The coreboot CPU index for a lapic is arbitrary: it depends on which CPU obtains a spinlock first. Simply using an increasing index will result in consistent ACPI tables across each boot. Change-Id: Iaaaef213b32b33e3ec9f4874d576896c2335211c Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/69510 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/intel/alderlake/acpi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/soc/intel/alderlake/acpi.c b/src/soc/intel/alderlake/acpi.c
index 1c820c2750..c874067701 100644
--- a/src/soc/intel/alderlake/acpi.c
+++ b/src/soc/intel/alderlake/acpi.c
@@ -279,6 +279,7 @@ void soc_lpi_get_constraints(void *unused)
acpigen_emit_byte(RETURN_OP);
acpigen_write_package(num_entries);
+ size_t cpu_index = 0;
for (dev = all_devices; dev; dev = dev->next) {
min_sleep_state = get_min_sleep_state(dev);
if (min_sleep_state == NONE)
@@ -294,15 +295,8 @@ void soc_lpi_get_constraints(void *unused)
break;
case DEVICE_PATH_APIC:
- /* Lookup CPU id */
- for (size_t i = 0; i < CONFIG_MAX_CPUS; i++) {
- if (cpu_get_apic_id(i) == dev->path.apic.apic_id) {
- snprintf(path, sizeof(path),
- CONFIG_ACPI_CPU_STRING, i);
- break;
- }
- }
-
+ snprintf(path, sizeof(path), CONFIG_ACPI_CPU_STRING,
+ cpu_index++);
acpigen_emit_namestring(path);
break;