[coreboot-gerrit] New patch to review for coreboot: b763cda [RFC] ec/compal/ene932: Update to use coreboot EC API

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Wed Apr 16 06:30:56 CEST 2014


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5515

-gerrit

commit b763cda9b260d14d41cf78fbc7c649de8c128d2a
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Wed Apr 9 21:07:43 2014 -0500

    [RFC] ec/compal/ene932: Update to use coreboot EC API
    
    This is based on the EC-mainboard interaction draft specification [1]
    I've implemented the mainboard namespace handler here, as it seems to
    be the most readable, most sane, and least convoluted of the
    solutions.
    
    If we can agree that this is a good change, then I'll fix the commit
    message, and we'll get this out of the way.
    
    Enjoy the clusterURL in clustercommit clustermessage.
    
    [1] http://www.coreboot.org/ACPI/Board-EC_interaction#The_mainboard_namespace_method
    
    P.S. A few HP Pavilion changes depend on this. They're up as well for
    the purpose of illustration.
    
    Change-Id: If0b09be4f5e17cc444539a30f0186590fa0b72b5
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 src/ec/compal/ene932/acpi/ec.asl                   | 39 ++++++++++++++++++++--
 src/mainboard/google/parrot/acpi/ec.asl            |  3 --
 src/mainboard/google/parrot/acpi/mainboard.asl     | 20 +++++++++++
 src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl    |  2 --
 .../hp/pavilion_m6_1035dx/acpi/mainboard.asl       | 21 ++++++++++--
 5 files changed, 74 insertions(+), 11 deletions(-)

diff --git a/src/ec/compal/ene932/acpi/ec.asl b/src/ec/compal/ene932/acpi/ec.asl
index a042d75..5c300e3 100644
--- a/src/ec/compal/ene932/acpi/ec.asl
+++ b/src/ec/compal/ene932/acpi/ec.asl
@@ -272,9 +272,6 @@ Device (EC0)
 		// Initialize AC power state
 		Store (ADPT, \PWRS)
 
-		// Initialize LID switch state
-		Store (EC_ACPI_LID_SWITCH_OBJECT, \LIDS)
-
 		// Force a read of CPU temperature
 		Store (CTML, Local0)
 	}
@@ -308,6 +305,36 @@ Device (EC0)
  * Hotkey break Function     46h
  */
 
+	/* Decrease brightness hotkey */
+	Method (_Q11, 0, NotSerialized)
+	{
+		\_SB.MB.BRTD()
+	}
+
+	/* Increase brightness hotkey */
+	Method (_Q12, 0, NotSerialized)
+	{
+		\_SB.MB.BRTU()
+	}
+
+	/* Lid opened */
+	Method (_Q15, 0, NotSerialized)
+	{
+		\_SB.MB.LIDO()
+	}
+
+	/* Lid closed */
+	Method (_Q16, 0, NotSerialized)
+	{
+		\_SB.MB.LIDC()
+	}
+
+	/* Switch display hotkey */
+	Method (_Q1C, 0, NotSerialized)
+	{
+		\_SB.MB.DSPS()
+	}
+
 	// AC Power Connected
 	Method (_Q37, 0, NotSerialized)
 	{
@@ -328,6 +355,12 @@ Device (EC0)
 		\PNOT ()
 	}
 
+	/* Wireless toggle hotkey */
+	Method (_Q40, 0, NotSerialized)
+	{
+		\_SB.MB.WLTG()
+	}
+
 	// Battery at critical low state
 	Method (_Q22, 0, NotSerialized)
 	{
diff --git a/src/mainboard/google/parrot/acpi/ec.asl b/src/mainboard/google/parrot/acpi/ec.asl
index a0ee9d5..522a0b9 100644
--- a/src/mainboard/google/parrot/acpi/ec.asl
+++ b/src/mainboard/google/parrot/acpi/ec.asl
@@ -21,8 +21,5 @@
 #include "../ec.h"
 #define EC_SCI 23      // GPIO7 << 16 to GPE bit for Runtime SCI
 
-/* GP15 is defined in the southbridge's ASL */
-#define EC_ACPI_LID_SWITCH_OBJECT	GP15
-
 /* ACPI code for EC functions */
 #include "../../../../ec/compal/ene932/acpi/ec.asl"
diff --git a/src/mainboard/google/parrot/acpi/mainboard.asl b/src/mainboard/google/parrot/acpi/mainboard.asl
index 7b9aef0..4ab9733 100644
--- a/src/mainboard/google/parrot/acpi/mainboard.asl
+++ b/src/mainboard/google/parrot/acpi/mainboard.asl
@@ -68,4 +68,24 @@ Scope (\_SB) {
 		})
 	}
 
+	Device (MB) {
+		/* Lid open */
+		Method (LIDO) { /* Not needed on this board */ }
+		/* Lid closed */
+		Method (LIDC) { /* Not needed on this board */ }
+		/* Increase brightness */
+		Method (BRTU) { /* Not needed on this board */ }
+		/* Decrease brightness */
+		Method (BRTD) { /* Not needed on this board */ }
+		/* Switch display */
+		Method (DSPS) { /* Not needed on this board */ }
+		/* Toggle wireless */
+		Method (WLTG) { /* Not needed on this board */ }
+		/* Return lid state */
+		Method (LIDS)
+		{
+			Return (GP15)
+		}
+	}
+
 }
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl b/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl
index e0d92fa..326710e 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl
+++ b/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl
@@ -7,8 +7,6 @@
  * EC bits specific to the mainboard
  */
 #define EC_SCI 3
-/* TODO: We do not yet know how the LID is connected to the platform */
-#define EC_ACPI_LID_SWITCH_OBJECT	Zero
 
 /* ACPI code for EC functions */
 #include <ec/compal/ene932/acpi/ec.asl>
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/acpi/mainboard.asl b/src/mainboard/hp/pavilion_m6_1035dx/acpi/mainboard.asl
index 47d7872..8725e2a 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/acpi/mainboard.asl
+++ b/src/mainboard/hp/pavilion_m6_1035dx/acpi/mainboard.asl
@@ -38,7 +38,6 @@
 	/* Variables used by EC */
 	/* TODO: These may belong in global non-volatile storage */
 	Name(PWRS, Zero)
-	Name(LIDS, Zero)
 
 	/* AcpiGpe0Blk */
 	OperationRegion(GP0B, SystemMemory, 0xfed80814, 0x04)
@@ -78,8 +77,24 @@ Scope (\_SB) {
 		Name(_HID, EisaId("PNP0C0D"))
 		Method(_LID, 0)
 		{
-			Store (GE22, \LIDS)
-			Return (\LIDS)
+			Return (GE22)	/* GE pin 22 */
 		}
 	}
+
+	Device (MB) {
+		/* Lid open */
+		Method (LIDO) { /* Stub */ }
+		/* Lid closed */
+		Method (LIDC) { /* Stub */ }
+		/* Increase brightness */
+		Method (BRTU) { /* Stub */ }
+		/* Decrease brightness */
+		Method (BRTD) { /* Stub */ }
+		/* Switch display */
+		Method (DSPS) { /* Stub */ }
+		/* Toggle wireless */
+		Method (WLTG) { /* Stub */ }
+		/* Return lid state */
+		Method (LIDS) { /* Stub */ }
+	}
 }



More information about the coreboot-gerrit mailing list