From 8f05527485776aab00115cfcb627c5eeb6debcde Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 28 Nov 2018 13:18:57 +0100 Subject: [PATCH] arch/x86/acpigen.c: Add a method to notify all CPU cores Change-Id: If8b07fdcec51c344a82309d4af3b6127ad758baf Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/29895 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/arch/x86/acpigen.c | 17 +++++++++++++++++ src/arch/x86/include/arch/acpigen.h | 1 + src/cpu/intel/speedstep/acpi.c | 12 +----------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index 426a5426b7..290893d719 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -369,6 +369,23 @@ void acpigen_write_processor_package(const char *const name, acpigen_pop_len(); } +/* Method to notify all CPU cores */ +void acpigen_write_processor_cnot(const unsigned int number_of_cores) +{ + int core_id; + + acpigen_write_method("\\_PR.CNOT", 1); + for (core_id = 0; core_id < number_of_cores; core_id++) { + char buffer[DEVICE_PATH_MAX]; + snprintf(buffer, sizeof(buffer), CONFIG_ACPI_CPU_STRING, + core_id); + acpigen_emit_byte(NOTIFY_OP); + acpigen_emit_namestring(buffer); + acpigen_emit_byte(ARG0_OP); + } + 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 a27bd6f277..d9379eb25a 100644 --- a/src/arch/x86/include/arch/acpigen.h +++ b/src/arch/x86/include/arch/acpigen.h @@ -277,6 +277,7 @@ 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_processor_cnot(const unsigned int number_of_cores); 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); diff --git a/src/cpu/intel/speedstep/acpi.c b/src/cpu/intel/speedstep/acpi.c index 0feaa2f4c2..b5e2c9e9e2 100644 --- a/src/cpu/intel/speedstep/acpi.c +++ b/src/cpu/intel/speedstep/acpi.c @@ -166,15 +166,5 @@ void generate_cpu_entries(struct device *device) of the first and only package. */ acpigen_write_processor_package("PPKG", 0, cores_per_package); - /* Add a method to notify processor nodes */ - acpigen_write_method("\\_PR.CNOT", 1); - for (coreID = 0; coreID < cores_per_package; coreID++) { - char buffer[DEVICE_PATH_MAX]; - snprintf(buffer, sizeof(buffer), "\\_PR.CP%c%c", - '0' + coreID / 10, '0' + coreID % 10); - acpigen_emit_byte(NOTIFY_OP); - acpigen_emit_namestring(buffer); - acpigen_emit_byte(ARG0_OP); - } - acpigen_pop_len(); + acpigen_write_processor_cnot(cores_per_package); }