arch/x86: Add Kconfig option for ACPI \_PR CPU name string

Add a Kconfig option to change the \PR.CPxx name string. This
provides some flexibility when working with table not generated
by coreboot.

Change-Id: Ibc0c56783c6da80501e2177de96a414b592cb74f
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/21210
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
Marc Jones 2017-08-25 18:54:23 -06:00 committed by Martin Roth
parent 7bb0325884
commit 7a2d4ea4ee
2 changed files with 11 additions and 2 deletions

View File

@ -249,3 +249,12 @@ config SKIP_MAX_REBOOT_CNT_CLEAR
Set to allow the payload to control normal/fallback image recovery. Set to allow the payload to control normal/fallback image recovery.
Note that it is the responsibility of the payload to reset the Note that it is the responsibility of the payload to reset the
normal boot bit to 1 after each successsful boot. normal boot bit to 1 after each successsful boot.
config ACPI_CPU_STRING
string
default "\\_PR.CP%02d"
depends on HAVE_ACPI_TABLES
help
Sets the ACPI name string in the processor scope as written by
the acpigen function. Default is \_PR.CPxx. Note that you need
the \ escape character in the string.

View File

@ -338,7 +338,7 @@ void acpigen_write_scope(const char *name)
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len) void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
{ {
/* /*
Processor (\_PR.CPUcpuindex, cpuindex, pblock_addr, pblock_len) Processor (\_PR.CPcpuindex, cpuindex, pblock_addr, pblock_len)
{ {
*/ */
char pscope[16]; char pscope[16];
@ -346,7 +346,7 @@ void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
acpigen_write_len_f(); acpigen_write_len_f();
snprintf(pscope, sizeof(pscope), snprintf(pscope, sizeof(pscope),
"\\_PR.CP%02d", (unsigned int) cpuindex); CONFIG_ACPI_CPU_STRING, (unsigned int) cpuindex);
acpigen_emit_namestring(pscope); acpigen_emit_namestring(pscope);
acpigen_emit_byte(cpuindex); acpigen_emit_byte(cpuindex);
acpigen_emit_dword(pblock_addr); acpigen_emit_dword(pblock_addr);