summaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/acpi.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-01-28 03:38:20 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-01-31 17:35:53 +0000
commit281be57a558ba7db8d69d2570d53ea5522960ca5 (patch)
tree90512c297169129b8de24b6ee86cc7c3e3773c02 /src/soc/amd/picasso/acpi.c
parent32bba1877ba6d248406a56cd97dce777d499aaa6 (diff)
soc/amd/picasso/acpi: use acpigen_write_processor_device
In CB:71614 Kyösti pointed out that ACPI_GPE0_BLK is the wrong address to assign to proc_blk_addr; the correct one would be ACPI_CPU_CONTROL. When looking a bit closer into this, it turned out that acpigen_write_processor is generating deprecated AML opcodes, so replace the acpigen_write_processor call with a call to the newly added acpigen_write_processor_device function that also doesn't have the proc_blk_addr and proc_blk_len parameters. The information about the IO port for entering C-states is already written into an SSDT by acpigen_write_CST_package which is likely also the reason why the wrong proc_blk_addr value wasn't noticed for a very long time. TEST=Mandolin still boots Ubuntu 22.04 LTS and Windows 10 and no possibly related errors show up. Linux gets the expected C-state information from the _CST package inside the processor device scope. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ie67416e19e431029dd12da66ad44ddfa8586df03 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72490 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/soc/amd/picasso/acpi.c')
-rw-r--r--src/soc/amd/picasso/acpi.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c
index a4464ebfb7..48b56f584f 100644
--- a/src/soc/amd/picasso/acpi.c
+++ b/src/soc/amd/picasso/acpi.c
@@ -237,10 +237,10 @@ static size_t get_pstate_info(struct acpi_sw_pstate *pstate_values,
void generate_cpu_entries(const struct device *device)
{
int logical_cores;
- size_t pstate_count, cpu, proc_blk_len;
+ size_t pstate_count, cpu;
struct acpi_sw_pstate pstate_values[MAX_PSTATES] = { {0} };
struct acpi_xpss_sw_pstate pstate_xpss_values[MAX_PSTATES] = { {0} };
- uint32_t threads_per_core, proc_blk_addr;
+ uint32_t threads_per_core;
uint32_t cstate_base_address =
rdmsr(MSR_CSTATE_ADDRESS).lo & MSR_CSTATE_ADDRESS_MASK;
@@ -288,18 +288,7 @@ void generate_cpu_entries(const struct device *device)
logical_cores = get_cpu_count();
for (cpu = 0; cpu < logical_cores; cpu++) {
-
- if (cpu == 0) {
- /* BSP values for \_SB.Pxxx */
- proc_blk_len = 6;
- proc_blk_addr = ACPI_GPE0_BLK;
- } else {
- /* AP values for \_SB.Pxxx */
- proc_blk_addr = 0;
- proc_blk_len = 0;
- }
-
- acpigen_write_processor(cpu, proc_blk_addr, proc_blk_len);
+ acpigen_write_processor_device(cpu);
acpigen_write_pct_package(&perf_ctrl, &perf_sts);
@@ -320,7 +309,7 @@ void generate_cpu_entries(const struct device *device)
acpigen_write_CSD_package(cpu / threads_per_core, threads_per_core,
CSD_HW_ALL, 0);
- acpigen_pop_len();
+ acpigen_write_processor_device_end();
}
acpigen_write_processor_package("PPKG", 0, logical_cores);