Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73424 )
Change subject: soc/amd/picasso/acpi: only use constants in cstate_info ......................................................................
soc/amd/picasso/acpi: only use constants in cstate_info
To facilitate factoring out the C-state info retrieval into a function which would then allow to make generate_cpu_entries common, all fields of the cstate_info array of acpi_cstate_t structs need to be build-time constants. To achieve this, use the ACPI_CPU_CONTROL IO port address in the resource's address instead of the value retrieved from MSR_CSTATE_ADDRESS. earlier in ramstage, set_cstate_io_addr writes the ACPI_CPU_CONTROL IO port address used for C state control into MSR_CSTATE_ADDRESS and we don't expect this MSR value to have changed, but better check and print an error if the assumption turned out to not be true. In this case, the C-state IO address info in the _CST package will be wrong, but the rare case where this might happen should be caught during early development of the SoC support.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I202047a6632cd13e81ac3c93f5e108e269c2ce03 --- M src/soc/amd/picasso/acpi.c 1 file changed, 29 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/73424/1
diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index 138e743..c876f6c 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -272,13 +272,18 @@ .space_id = ACPI_ADDRESS_SPACE_IO, .bit_width = 8, .bit_offset = 0, - .addrl = cstate_base_address + 1, + .addrl = ACPI_CPU_CONTROL + 1, .addrh = 0, .access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS, }, }, };
+ if (cstate_base_address != ACPI_CPU_CONTROL) { + printk(BIOS_ERR, "C state IO port mismatch. Expected %x, found %x.\n", + ACPI_CPU_CONTROL, cstate_base_address); + } + threads_per_core = get_threads_per_core(); pstate_count = get_pstate_info(pstate_values, pstate_xpss_values); logical_cores = get_cpu_count();