[coreboot-gerrit] Patch set updated for coreboot: lenovo/x60: _CST table use MWAIT request instead of P_LVLx I/O reads

Arthur Heymans (arthur@aheymans.xyz) gerrit at coreboot.org
Sun May 15 17:58:12 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/14801

-gerrit

commit 6c5d38d7577d267d72c3d6793d28a4eda3859913
Author: Arthur Heymans <arthur at aheymans.xyz>
Date:   Fri May 13 00:07:36 2016 +0200

    lenovo/x60: _CST table use MWAIT request instead of P_LVLx I/O reads
    
    Requesting low power acpi cpu c-states has two software interfaces:
    Using P_LVLx I/O reads or using equivalent MWAIT requests.
    Since newer intel boards in coreboot use MWAIT, I tried to
    make the x60 c-states consistent with that.
    
    There also exist extended intel acpi c-state which can be enabled in
    two ways:
    - using a substate hint to the mwait request (defined in bios);
    - setting a model specific register (msr)
    
    I'm not sure if the second method is used, but using MWAIT request
    could potentialy allow to use those states. This is not done in this
    patch
    
    
    Change-Id: I9eeb5b008e2ddc2193725667f2c13582a4877e3c
    Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
 src/mainboard/lenovo/x60/mainboard.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/src/mainboard/lenovo/x60/mainboard.c b/src/mainboard/lenovo/x60/mainboard.c
index 5ea4221..7c21ada 100644
--- a/src/mainboard/lenovo/x60/mainboard.c
+++ b/src/mainboard/lenovo/x60/mainboard.c
@@ -38,10 +38,37 @@
 
 #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT
 
+#define MWAIT_RES(state, sub_state)                         \
+	{                                                   \
+	  .space_id = ACPI_ADDRESS_SPACE_FIXED,		    \
+	  .bit_width = ACPI_FFIXEDHW_VENDOR_INTEL,          \
+	  .bit_offset = ACPI_FFIXEDHW_CLASS_MWAIT,          \
+	  {						    \
+            .resv = 0,					    \
+	  },						    \
+	  .addrl = (((state) << 4) | (sub_state)),          \
+	  .addrh = 0,                                       \
+	}
+
 static acpi_cstate_t cst_entries[] = {
-	{ 1,  1, 1000, { 0x7f, 1, 2, { 0 }, 1, 0 } },
-	{ 2,  1,  500, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV2, 0 } },
-	{ 2, 17,  250, { 0x01, 8, 0, { 0 }, DEFAULT_PMBASE + LV3, 0 } },
+	{
+		.ctype = 1,
+		.latency = 1,
+		.power = 1000,
+		.resource = MWAIT_RES(0, 0),
+	},
+	{
+		.ctype = 2,
+		.latency = 1,
+		.power = 500,
+		.resource = MWAIT_RES(1, 0),
+	},
+	{
+		.ctype = 3,
+		.latency = 17,
+		.power = 250,
+		.resource = MWAIT_RES(2, 0),
+	},
 };
 
 int get_cst_entries(acpi_cstate_t **entries)



More information about the coreboot-gerrit mailing list