summaryrefslogtreecommitdiff
path: root/src/northbridge/intel
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2012-07-18 15:33:45 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-07-26 21:12:31 +0200
commit1b3207ee617c24fd283e654359c20c88d95a69c8 (patch)
treeca466e863790e9053b5e5a5463026e9ed1b49310 /src/northbridge/intel
parent8de884424cb65bdba80a5602e76a4e40b11b154f (diff)
downloadcoreboot-1b3207ee617c24fd283e654359c20c88d95a69c8.tar.xz
CTDP: Only do TDP down/nominal change from TNP0
Otherwise there is a flurry of TDP changes with suspend/resume as the kernel powers devices off on suspend and brings them back online in resume. This also adds a mutex around the TDP operations since it is split across two methods and can't just rely on being Serialized. Change-Id: I7757d3ddad34ac985a9c8ce2fc202e2b2dcb2527 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/1348 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/intel')
-rw-r--r--src/northbridge/intel/sandybridge/acpi/hostbridge.asl30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/northbridge/intel/sandybridge/acpi/hostbridge.asl b/src/northbridge/intel/sandybridge/acpi/hostbridge.asl
index 8dd1de6ff6..93db98d1c5 100644
--- a/src/northbridge/intel/sandybridge/acpi/hostbridge.asl
+++ b/src/northbridge/intel/sandybridge/acpi/hostbridge.asl
@@ -101,6 +101,8 @@ Device (MCHC)
TLUD, 32,
}
+ Mutex (CTCM, 1) /* CTDP Switch Mutex (sync level 1) */
+ Name (CTCC, 0) /* CTDP Current Selection */
Name (CTCN, 0) /* CTDP Nominal Select */
Name (CTCD, 1) /* CTDP Down Select */
Name (CTCU, 2) /* CTDP Up Select */
@@ -167,12 +169,16 @@ Device (MCHC)
/* Set TDP Down */
Method (STND, 0, Serialized)
{
- Store ("Set TDP Down", Debug)
-
- If (LEqual (CTCD, CTCS)) {
+ If (Acquire (CTCM, 100)) {
+ Return (0)
+ }
+ If (LEqual (CTCD, CTCC)) {
+ Release (CTCM)
Return (0)
}
+ Store ("Set TDP Down", Debug)
+
/* Set CTC */
Store (CTCD, CTCS)
@@ -189,18 +195,26 @@ Device (MCHC)
/* Set PL1 */
Store (CTDD, PL1V)
+ /* Store the new TDP Down setting */
+ Store (CTCD, CTCC)
+
+ Release (CTCM)
Return (1)
}
/* Set TDP Nominal from Down */
Method (STDN, 0, Serialized)
{
- Store ("Set TDP Nominal", Debug)
-
- If (LEqual (CTCN, CTCS)) {
+ If (Acquire (CTCM, 100)) {
+ Return (0)
+ }
+ If (LEqual (CTCN, CTCC)) {
+ Release (CTCM)
Return (0)
}
+ Store ("Set TDP Nominal", Debug)
+
/* Set PL1 */
Store (CTDN, PL1V)
@@ -217,6 +231,10 @@ Device (MCHC)
/* Set CTC */
Store (CTCN, CTCS)
+ /* Store the new TDP Nominal setting */
+ Store (CTCN, CTCC)
+
+ Release (CTCM)
Return (1)
}
}