diff options
author | Michael Niewöhner <foss@mniewoehner.de> | 2021-10-05 22:22:21 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-10-21 20:03:14 +0000 |
commit | 38107fa80eb81fe5077dbee0dd9a46618c71a196 (patch) | |
tree | d8f040f30350f52a5ccc8fcc63ef37042e08ff46 /src/acpi | |
parent | 679f4fa46578267989b55635e50ef500f7327338 (diff) |
acpigen,soc/amd,cpu/intel: rework static DWORD for CPPC table
Some elements in the ACPI CPPC table allow static DWORDs. Instead of
using a fake register resource, use a tagged union with the two types
"register" and "DWORD" and respective macros for CPPC table entries.
Test: dumped SSDT before and after do not differ.
Change-Id: Ib853261b5c0ea87ae2424fed188f2d1872be9a06
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57886
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/acpi')
-rw-r--r-- | src/acpi/acpigen.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index e0892e654f..37bfec1654 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1798,13 +1798,11 @@ void acpigen_write_CPPC_package(const struct cppc_config *config) acpigen_write_byte(config->version); for (i = 0; i < max; ++i) { - const acpi_addr_t *reg = &(config->regs[i]); - if (reg->space_id == ACPI_ADDRESS_SPACE_MEMORY && - reg->bit_width == 32 && reg->access_size == ACPI_ACCESS_SIZE_UNDEFINED) { - acpigen_write_dword(reg->addrl); - } else { - acpigen_write_register_resource(reg); - } + const cppc_entry_t *entry = &config->entries[i]; + if (entry->type == CPPC_TYPE_DWORD) + acpigen_write_dword(entry->dword); + else + acpigen_write_register_resource(&entry->reg); } acpigen_pop_len(); } |