diff options
author | Nico Huber <nico.h@gmx.de> | 2017-09-01 21:14:36 +0200 |
---|---|---|
committer | Patrick Rudolph <siro@das-labor.org> | 2017-11-04 17:23:06 +0000 |
commit | 4d211ac08d79e3925d0ad168fc73631113090a6c (patch) | |
tree | 1fae9c806df99e51d1f14f0996b57af31582a1d1 /src/arch/x86 | |
parent | b2b2015be04c9e1e5a952bf9a54c4e284e068e9e (diff) | |
download | coreboot-4d211ac08d79e3925d0ad168fc73631113090a6c.tar.xz |
arch/x86/acpigen: Add function to write a CPU package
Emits a list of CPU cores, e.g.
Name (PPKG, Package (2) { \_PR.CP00, \_PR.CP01 })
Tested on Lenovo Thinkpad T500.
Change-Id: I10e9ebad84343d1fb282b3fbb28f5f014f664f14
Signed-off-by: Nico Huber <nico.h@gmx.de>
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/21324
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/acpigen.c | 16 | ||||
-rw-r--r-- | src/arch/x86/include/arch/acpigen.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index 758386d8a8..9637b7de96 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -353,6 +353,22 @@ void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len) acpigen_emit_byte(pblock_len); } +void acpigen_write_processor_package(const char *const name, + const unsigned int first_core, + const unsigned int core_count) +{ + unsigned int i; + char pscope[16]; + + acpigen_write_name(name); + acpigen_write_package(core_count); + for (i = first_core; i < first_core + core_count; ++i) { + snprintf(pscope, sizeof(pscope), CONFIG_ACPI_CPU_STRING, i); + acpigen_emit_namestring(pscope); + } + acpigen_pop_len(); +} + /* * Generate ACPI AML code for OperationRegion * Arg0: Pointer to struct opregion opreg = OPREGION(rname, space, offset, len) diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h index 37d0d5572d..9ec6ee1bf3 100644 --- a/src/arch/x86/include/arch/acpigen.h +++ b/src/arch/x86/include/arch/acpigen.h @@ -219,6 +219,9 @@ typedef enum { CSD_HW_ALL = 0xfe } CSD_coord; void acpigen_write_CSD_package(u32 domain, u32 numprocs, CSD_coord coordtype, u32 index); void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len); +void acpigen_write_processor_package(const char *name, + unsigned int first_core, + unsigned int core_count); void acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list); void acpigen_write_TSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); void acpigen_write_mem32fixed(int readwrite, u32 base, u32 size); |