[coreboot-gerrit] New patch to review for coreboot: lenovo/x200, t400: enable C4 cpu low power state

Arthur Heymans (arthur@aheymans.xyz) gerrit at coreboot.org
Sat Jun 18 14:01:37 CEST 2016


Arthur Heymans (arthur at aheymans.xyz) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15251

-gerrit

commit 49f56db42079a584a86589db79692f3414f5f0a3
Author: Arthur Heymans <arthur at aheymans.xyz>
Date:   Fri Jun 17 19:06:25 2016 +0200

    lenovo/x200,t400: enable C4 cpu low power state
    
    This enables the C4 low power state on the lenovo x200 and t400.
    It's inspired by the thread on the mailinglist:
    "[coreboot] Lenovo X200 running Coreboot drains 3-4W more power
    than with Vendor BIOS".
    
    What this does, is to enable a C3 state using MWAIT(C3) request
    and set the southbridge config c4onc3_enable to automatically
    upgrade C3 to the lower power C4 state.
    The latency (0x37) is the same value used by the vendor bios.
    
    With C4 enabled the idle power consumption is about ~2-3W lower.
    
    TEST= build and install on target. Use powertop top to measure power
    usage. To manually disable c-state to compare them,
    do (tested on linux 4.4):
    echo 1 > /sys/devices/system/cpu/cpu*/cpuidle/stateX/disable
    
    Change-Id: I1a1663a7662ebc7157a965667680688ad6a33545
    Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
 src/mainboard/lenovo/t400/cstates.c     | 5 +++++
 src/mainboard/lenovo/t400/devicetree.cb | 2 +-
 src/mainboard/lenovo/x200/cstates.c     | 5 +++++
 src/mainboard/lenovo/x200/devicetree.cb | 2 +-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/mainboard/lenovo/t400/cstates.c b/src/mainboard/lenovo/t400/cstates.c
index 827f76e..67fc125 100644
--- a/src/mainboard/lenovo/t400/cstates.c
+++ b/src/mainboard/lenovo/t400/cstates.c
@@ -28,6 +28,11 @@ static acpi_cstate_t cst_entries[] = {
 		2, 0x01,  500,
 		{ ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x10, 0 }
 	},
+	{
+		/* acpi C3 / cpu C3 */
+		3, 0x37,  250,
+		{ ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 }
+	},
 };
 
 int get_cst_entries(acpi_cstate_t **entries)
diff --git a/src/mainboard/lenovo/t400/devicetree.cb b/src/mainboard/lenovo/t400/devicetree.cb
index 43a610a..6bf25fa 100644
--- a/src/mainboard/lenovo/t400/devicetree.cb
+++ b/src/mainboard/lenovo/t400/devicetree.cb
@@ -63,7 +63,7 @@ chip northbridge/intel/gm45
 			register "sata_traffic_monitor"		= "0"
 
 			# Set c-state support
-			register "c4onc3_enable"		= "0"
+			register "c4onc3_enable"		= "1"
 			register "c5_enable"			= "1"
 			register "c6_enable"			= "1"
 
diff --git a/src/mainboard/lenovo/x200/cstates.c b/src/mainboard/lenovo/x200/cstates.c
index 827f76e..67fc125 100644
--- a/src/mainboard/lenovo/x200/cstates.c
+++ b/src/mainboard/lenovo/x200/cstates.c
@@ -28,6 +28,11 @@ static acpi_cstate_t cst_entries[] = {
 		2, 0x01,  500,
 		{ ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x10, 0 }
 	},
+	{
+		/* acpi C3 / cpu C3 */
+		3, 0x37,  250,
+		{ ACPI_ADDRESS_SPACE_FIXED, 1, 2, { 1 }, 0x20, 0 }
+	},
 };
 
 int get_cst_entries(acpi_cstate_t **entries)
diff --git a/src/mainboard/lenovo/x200/devicetree.cb b/src/mainboard/lenovo/x200/devicetree.cb
index 9f5bb41..200b4bc 100644
--- a/src/mainboard/lenovo/x200/devicetree.cb
+++ b/src/mainboard/lenovo/x200/devicetree.cb
@@ -67,7 +67,7 @@ chip northbridge/intel/gm45
 			register "sata_traffic_monitor"		= "0"
 
 			# Set c-state support
-			register "c4onc3_enable"		= "0"
+			register "c4onc3_enable"		= "1"
 			register "c5_enable"			= "1"
 			register "c6_enable"			= "1"
 



More information about the coreboot-gerrit mailing list