cpu/intel/speedstep: Fix the PNOT ACPI method

The PNOT method never notifies the CPU to update it's _CST methods due
to reliance on inexisting variable (PDCx).

Add a method in the speedstep ssdt generator to notify all available
CPU nodes and hook this up in this file.

The cpu.asl file is moved to cpu/intel/speedstep/acpi since it now
relies on code generated in the speedstep ssdt generator. CPUs not
using the speedstep code never included this PNOT method so this is
a logical place for this code to be.

Change-Id: Ie2ba5e07b401d6f7c80c31f2bfcd9ef3ac0c1ad1
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/23144
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Arthur Heymans 2018-01-06 18:40:23 +01:00 committed by Martin Roth
parent 30bba281b9
commit 0a4e0fd913
17 changed files with 32 additions and 37 deletions

View File

@ -82,6 +82,7 @@ enum {
AND_OP = 0x7B, AND_OP = 0x7B,
OR_OP = 0x7D, OR_OP = 0x7D,
NOT_OP = 0x80, NOT_OP = 0x80,
NOTIFY_OP = 0x86,
LEQUAL_OP = 0x93, LEQUAL_OP = 0x93,
LGREATER_OP = 0x94, LGREATER_OP = 0x94,
LLESS_OP = 0x95, LLESS_OP = 0x95,

View File

@ -23,6 +23,7 @@
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#include <cpu/intel/speedstep.h> #include <cpu/intel/speedstep.h>
#include <device/device.h> #include <device/device.h>
#include <string.h>
static int determine_total_number_of_cores(void) static int determine_total_number_of_cores(void)
{ {
@ -164,4 +165,16 @@ void generate_cpu_entries(device_t device)
/* PPKG is usually used for thermal management /* PPKG is usually used for thermal management
of the first and only package. */ of the first and only package. */
acpigen_write_processor_package("PPKG", 0, cores_per_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();
} }

View File

@ -12,36 +12,17 @@
*/ */
/* These come from the dynamically created CPU SSDT */ /* These come from the dynamically created CPU SSDT */
External(PDC0) External (\_PR.CNOT, MethodObj)
External(PDC1)
// Power notification
External (\_PR_.CP00, DeviceObj) External (\_PR_.CP00, DeviceObj)
External (\_PR_.CP01, DeviceObj)
External (\_PR_.CP00._PPC) External (\_PR_.CP00._PPC)
External (\_PR_.CP01._PPC) External (\_PR_.CP01._PPC)
Method (PNOT) Method (PNOT)
{ {
If (MPEN) { If (MPEN) {
If(And(PDC0, 0x08)) { \_PR.CNOT (0x80) // _PPC
Notify (\_PR_.CP00, 0x80) // _PPC Sleep(100)
\_PR.CNOT (0x81) // _CST
If (And(PDC0, 0x10)) {
Sleep(100)
Notify(\_PR_.CP00, 0x81) // _CST
}
}
If(And(PDC1, 0x08)) {
Notify (\_PR_.CP01, 0x80) // _PPC
If (And(PDC1, 0x10)) {
Sleep(100)
Notify(\_PR_.CP01, 0x81) // _CST
}
}
} Else { // UP } Else { // UP
Notify (\_PR_.CP00, 0x80) Notify (\_PR_.CP00, 0x80)
Sleep(0x64) Sleep(0x64)

View File

@ -34,7 +34,7 @@ DefinitionBlock(
#include <southbridge/intel/i82801gx/acpi/globalnvs.asl> #include <southbridge/intel/i82801gx/acpi/globalnvs.asl>
#include <southbridge/intel/common/acpi/platform.asl> #include <southbridge/intel/common/acpi/platform.asl>
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -38,7 +38,7 @@ DefinitionBlock(
// Thermal Zone // Thermal Zone
//#include "acpi/thermal.asl" //#include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -43,7 +43,7 @@ DefinitionBlock(
// Thermal Zone // Thermal Zone
#include "acpi/thermal.asl" #include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -38,7 +38,7 @@ DefinitionBlock(
// Thermal Zone // Thermal Zone
//#include "acpi/thermal.asl" //#include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -35,7 +35,7 @@ DefinitionBlock(
//#include "acpi/thermal.asl" //#include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -26,7 +26,7 @@ DefinitionBlock(
#include "acpi/platform.asl" #include "acpi/platform.asl"
#include <southbridge/intel/i82801gx/acpi/globalnvs.asl> #include <southbridge/intel/i82801gx/acpi/globalnvs.asl>
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -38,7 +38,7 @@ DefinitionBlock(
// Thermal Zone // Thermal Zone
//#include "acpi/thermal.asl" //#include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -34,7 +34,7 @@ DefinitionBlock(
//#include "acpi/thermal.asl" //#include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -39,7 +39,7 @@ DefinitionBlock(
// General Purpose Events // General Purpose Events
#include "acpi/gpe.asl" #include "acpi/gpe.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -47,7 +47,7 @@ DefinitionBlock(
#include "acpi/video.asl" #include "acpi/video.asl"
} }
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -39,7 +39,7 @@ DefinitionBlock(
// General Purpose Events // General Purpose Events
#include "acpi/gpe.asl" #include "acpi/gpe.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -43,7 +43,7 @@ DefinitionBlock(
// mainboard specific devices // mainboard specific devices
#include "acpi/mainboard.asl" #include "acpi/mainboard.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -39,7 +39,7 @@ DefinitionBlock(
// Thermal Zone // Thermal Zone
#include "acpi/thermal.asl" #include "acpi/thermal.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
Scope (\_SB) { Scope (\_SB) {
Device (PCI0) Device (PCI0)

View File

@ -38,7 +38,7 @@ DefinitionBlock(
// mainboard specific devices // mainboard specific devices
#include "acpi/mainboard.asl" #include "acpi/mainboard.asl"
#include <cpu/intel/common/acpi/cpu.asl> #include <cpu/intel/speedstep/acpi/cpu.asl>
// Thermal Zone // Thermal Zone
#include "acpi/thermal.asl" #include "acpi/thermal.asl"