Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5512
-gerrit
commit b970e50c008f889042b9db6b66ae0ecd15a61c7a
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Apr 9 12:24:39 2014 -0500
hp/pavilion_m6_1035dx: Add SMI handler and handle EC requests
The EC may disable some functionality, such as Caps Lock LED and
battery charging if it never receives a command to go in APM mode. If
we start it in APM mode, then immediately switch to ACPI mode, it will
not get its SCIs serviced until an ACPI OS boots. If its SCIs are not
serviced, it may assume the OS has hung.
The way we solve this is to initalize the EC in APM mode, and only
switch it to ACPI when an ACPI-capable OS issues the ACPI_ENABLE
command. The switch has to be handled in SMM.
Although we aren't yet processing SMIs from the EC, we are reading the
status in order to satisfy the EC that the event is handled.
Change-Id: Iffaeb9a6f57841f456c4bce8337dc09b287f8758
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/mainboard/hp/pavilion_m6_1035dx/Kconfig | 1 +
src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc | 2 +
src/mainboard/hp/pavilion_m6_1035dx/ec.c | 18 +++--
src/mainboard/hp/pavilion_m6_1035dx/ec.h | 4 ++
src/mainboard/hp/pavilion_m6_1035dx/mainboard.c | 5 ++
.../hp/pavilion_m6_1035dx/mainboard_smi.c | 77 ++++++++++++++++++++++
6 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/Kconfig b/src/mainboard/hp/pavilion_m6_1035dx/Kconfig
index 87e8212..d6cdb10 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/Kconfig
+++ b/src/mainboard/hp/pavilion_m6_1035dx/Kconfig
@@ -30,6 +30,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_PIRQ_TABLE
select HAVE_MP_TABLE
select HAVE_ACPI_RESUME
+ select HAVE_SMI_HANDLER
select SERIAL_CPU_INIT
select HAVE_ACPI_TABLES
select BOARD_ROMSIZE_KB_4096
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
index 07ea765..7039c72 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
+++ b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
@@ -27,3 +27,5 @@ ramstage-y += agesawrapper.c
ramstage-y += BiosCallOuts.c
ramstage-y += PlatformGnbPcie.c
ramstage-y += ec.c
+
+smm-y += mainboard_smi.c
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/ec.c b/src/mainboard/hp/pavilion_m6_1035dx/ec.c
index d61a2e5..2dd0009 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/ec.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/ec.c
@@ -13,16 +13,24 @@ static void set_keyboard_matrix_us(void)
ec_kbc_write_ib(0xE5);
}
-/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */
-static void enter_acpi_mode(void)
+/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */
+static void enter_apm_mode(void)
{
ec_kbc_write_cmd(0x59);
- ec_kbc_write_ib(0xE8);
+ ec_kbc_write_ib(0xE9);
}
void pavilion_m6_1035dx_ec_init(void)
{
set_keyboard_matrix_us();
- /* This could also be done in an SMI, should we decide to use SMM */
- enter_acpi_mode();
+
+ /*
+ * The EC has a special "blinking Caps Lock LED" mode which it normally
+ * enters when it believes the OS is not responding. It occasionally
+ * disables battery charging when in this mode, although other
+ * functionality is unaffected. Although the EC starts in APM mode by
+ * default, it only leaves the "blinking Caps Lock LED" mode after
+ * receiving the following command.
+ */
+ enter_apm_mode();
}
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/ec.h b/src/mainboard/hp/pavilion_m6_1035dx/ec.h
index 0c00d7a..579bf7e 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/ec.h
+++ b/src/mainboard/hp/pavilion_m6_1035dx/ec.h
@@ -6,6 +6,10 @@
#ifndef _MAINBOARD_HP_PAVILION_M6_1035DX_EC_H
#define _MAINBOARD_HP_PAVILION_M6_1035DX_EC_H
+#define EC_SMI_GEVENT 23
+
+#ifndef __SMM__
void pavilion_m6_1035dx_ec_init(void);
+#endif
#endif /* _MAINBOARD_HP_PAVILION_M6_1035DX_EC_H */
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c b/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c
index 2e2b72b..756b443 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c
@@ -30,6 +30,8 @@
#include <device/pci.h>
#include <device/pci_def.h>
+#include <southbridge/amd/agesa/hudson/smi.h>
+
/*************************************************
* enable the dedicated function in parmer board.
*************************************************/
@@ -39,6 +41,9 @@ static void mainboard_enable(device_t dev)
pavilion_m6_1035dx_ec_init();
+ hudson_enable_gevent_smi(EC_SMI_GEVENT);
+ hudson_enable_smi_generation();
+
/*
* The mainboard is the first place that we get control in ramstage. Check
* for S3 resume and call the approriate AGESA/CIMx resume functions.
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c b/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c
new file mode 100644
index 0000000..a48182b
--- /dev/null
+++ b/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c
@@ -0,0 +1,77 @@
+/*
+ * SMI handler -- mostly takes care of SMIs from the EC
+ *
+ * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
+ * Subject to the GNU GPL v2, or (at your option) any later version.
+ */
+
+#include "ec.h"
+
+#include <console/console.h>
+#include <cpu/x86/smm.h>
+#include <delay.h>
+#include <southbridge/amd/agesa/hudson/hudson.h>
+
+enum ec_smi_event {
+ EC_SMI_EVENT_IDLE = 0x80,
+};
+
+/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */
+static void ec_enter_apm_mode(void)
+{
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xE9);
+}
+/* Tell EC to operate in ACPI mode, thus generating SCIs on events, not SMIs */
+static void ec_enter_acpi_mode(void)
+{
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xE8);
+}
+
+static uint8_t ec_get_smi_event(void)
+{
+ ec_kbc_write_cmd(0x56);
+ return ec_kbc_read_ob();
+}
+
+static void ec_process_smi(uint8_t src)
+{
+ /*
+ * Stub: We aren't processing any events yet, but reading the SMI source
+ * from satisfies the EC in terms of responding to the event.
+ */
+
+ printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src);
+}
+
+static void handle_ec_smi(void)
+{
+ uint8_t src;
+
+ while ((src = ec_get_smi_event()) != EC_SMI_EVENT_IDLE)
+ ec_process_smi(src);
+}
+
+int mainboard_smi_apmc(uint8_t data)
+{
+ switch (data) {
+ case ACPI_SMI_CMD_ENABLE:
+ printk(BIOS_DEBUG, "Enable ACPI mode\n");
+ ec_enter_acpi_mode();
+ break;
+ case ACPI_SMI_CMD_DISABLE:
+ printk(BIOS_DEBUG, "Disable ACPI mode\n");
+ ec_enter_apm_mode();
+ break;
+ default:
+ printk(BIOS_DEBUG, "Unhandled ACPI command: 0x%x\n", data);
+ }
+ return 0;
+}
+
+void mainboard_smi_gpi(uint32_t gpi_sts)
+{
+ if (gpi_sts & EC_SMI_GEVENT)
+ handle_ec_smi();
+}
the following patch was just integrated into master:
commit 288c95882d701bb09c77c8ad1a8904673503656c
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Mon Apr 14 16:35:34 2014 -0500
southbridge/hudson: Add support for ACPI enable/disable via SMI
This enables the ACPI SMI command port in the FADT table, and sets up
the hardware accordingly. If we have SMI enabled, then we don't set
the SCI_EN bit at boot, causing the OS to send the ACPI_ENABLE
command, as required by the ACPI spec. This gives us a chance to hook
into the mainboard_smi_apmc() handler.
Change-Id: Ib4c63d55b3132578dcae48bfe2092d4ea35821dd
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Reviewed-on: http://review.coreboot.org/5511
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)gmail.com>
See http://review.coreboot.org/5511 for details.
-gerrit
the following patch was just integrated into master:
commit 22d90e34f95307d143249b53f3bb48f0a674ecbd
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Mon Apr 14 14:38:19 2014 -0500
southbridge/hudson: Pass GEVENT SMIs to mainboard_smi_gpi()
Change-Id: Ifc368974a7a0dc0756431654fb89668e3846801a
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Reviewed-on: http://review.coreboot.org/5502
Reviewed-by: Aaron Durbin <adurbin(a)gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
See http://review.coreboot.org/5502 for details.
-gerrit
the following patch was just integrated into master:
commit 2dbd08faf4be1f2a156730f8857b4c6bb72909e3
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Thu Apr 10 14:35:59 2014 -0500
southbridge/amd/agesa/hudson: Add initial support for SMM
This sets up the infrastructure to handle SMIs generated by the Hudson
southbridge. An API for interfacing to mainboard handlers is not
defined at this point. A few functions are defined to allow mainboard
code to enable SMIs from GEVENT pins. These are the only functions which
I expect to be needed anytime in the foreseeable future.
SMIs are always acknowledged and cleared, as not clearing an SMI will
cause us to re-enter the SMI, effectively bricking the machine if a
southbridge-generated SMI without a handler occurs.
Change-Id: Ibceb21ac5423eb134d3eb7d24800280b183f7619
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Reviewed-on: http://review.coreboot.org/5494
Reviewed-by: Aaron Durbin <adurbin(a)gmail.com>
Tested-by: build bot (Jenkins)
See http://review.coreboot.org/5494 for details.
-gerrit
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5515
-gerrit
commit 90aa22be8b490fb2bddcf8b514a3e08ba23ce322
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Apr 9 21:07:43 2014 -0500
ec/compal/ene932: Update to use coreboot EC-mainboard API
This patch implements a simple interface between the EC and mainboard
ASL code. This interface does not rely on the preprocessor, and
prevents name conflicts by scoping the interface methods. As this
interface is documented on the coreboot wiki, an in-tree documentation
is not provided.
Change-Id: If0b09be4f5e17cc444539a30f0186590fa0b72b5
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/ec/compal/ene932/acpi/ec.asl | 41 +++++++++++++++++++---
src/ec/compal/ene932/documentation.txt | 21 ++++-------
src/mainboard/google/parrot/acpi/ec.asl | 5 +--
src/mainboard/google/parrot/acpi/mainboard.asl | 20 +++++++++++
src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl | 4 +--
.../hp/pavilion_m6_1035dx/acpi/mainboard.asl | 21 +++++++++--
6 files changed, 83 insertions(+), 29 deletions(-)
diff --git a/src/ec/compal/ene932/acpi/ec.asl b/src/ec/compal/ene932/acpi/ec.asl
index a042d75..0b7837f 100644
--- a/src/ec/compal/ene932/acpi/ec.asl
+++ b/src/ec/compal/ene932/acpi/ec.asl
@@ -27,7 +27,7 @@ Device (EC0)
{
Name (_HID, EISAID ("PNP0C09"))
Name (_UID, 1)
- Name (_GPE, EC_SCI) // GPE for Runtime SCI
+ Name (_GPE, EC_SCI_GPE) // GPE for Runtime SCI
OperationRegion (ERAM, EmbeddedControl, 0x00, 0xff)
Field (ERAM, ByteAcc, Lock, Preserve)
@@ -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/ec/compal/ene932/documentation.txt b/src/ec/compal/ene932/documentation.txt
index eeb801a..a597e4e 100644
--- a/src/ec/compal/ene932/documentation.txt
+++ b/src/ec/compal/ene932/documentation.txt
@@ -1,23 +1,14 @@
-Accessing the EC space
-======================
+ASL interface
+=============
-The ACPI implementation uses the standard I/O ports 0x62 and 0x66 to access the
-EC functionality. Accesses to these ports must be directed to the LPC bus to
-which the EC is connected.
+This EC implements the standard mainboard-EC coreboot interface.
+Deviations from standard interface
+==================================
-Interfacing with the ASL files
-==============================
+The following method must be defined in the global namespace:
-The mainboard code must define several variables for the ASL files.
-
-* EC_SCI
- Defines the General Purpose Event (GPE) corresponding to the EC's SCI line.
-* EC_ACPI_LID_SWITCH_OBJECT
- Defines the APCI object which reads the state of the lid, with 0 = open, and
- 1 = closed. This is usually the bit which reads the GPIO input corresponding
- to the lid switch.
* PNOT()
The mainboard must define a PNOT method to handle power state notifications
and Notify CPU device objects to re-evaluate their _PPC and _CST tables.
diff --git a/src/mainboard/google/parrot/acpi/ec.asl b/src/mainboard/google/parrot/acpi/ec.asl
index a0ee9d5..ae0090f 100644
--- a/src/mainboard/google/parrot/acpi/ec.asl
+++ b/src/mainboard/google/parrot/acpi/ec.asl
@@ -19,10 +19,7 @@
/* mainboard configuration */
#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
+#define EC_SCI_GPE 23 // GPIO7 << 16 to GPE bit for Runtime SCI
/* 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..188515c 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl
+++ b/src/mainboard/hp/pavilion_m6_1035dx/acpi/ec.asl
@@ -6,9 +6,7 @@
/*
* 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
+#define EC_SCI_GPE 3
/* 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 */ }
+ }
}
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5515
-gerrit
commit ac15210b1ff6984b7ba5d912377832364aa52f4e
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Apr 9 21:07:43 2014 -0500
ec/compal/ene932: Update to use coreboot EC-mainboard API
This patch implements a simple interface between the EC and mainboard
ASL code. This interface does not rely on the preprocessor, and
prevents name conflicts by scoping the interface methods. As this
interface is documented on the coreboot wiki, an in-tree documentation
is not provided.
Change-Id: If0b09be4f5e17cc444539a30f0186590fa0b72b5
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/ec/compal/ene932/acpi/ec.asl | 39 ++++++++++++++++++++--
src/ec/compal/ene932/documentation.txt | 21 ++++--------
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 ++++++++++--
6 files changed, 80 insertions(+), 26 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/ec/compal/ene932/documentation.txt b/src/ec/compal/ene932/documentation.txt
index eeb801a..a597e4e 100644
--- a/src/ec/compal/ene932/documentation.txt
+++ b/src/ec/compal/ene932/documentation.txt
@@ -1,23 +1,14 @@
-Accessing the EC space
-======================
+ASL interface
+=============
-The ACPI implementation uses the standard I/O ports 0x62 and 0x66 to access the
-EC functionality. Accesses to these ports must be directed to the LPC bus to
-which the EC is connected.
+This EC implements the standard mainboard-EC coreboot interface.
+Deviations from standard interface
+==================================
-Interfacing with the ASL files
-==============================
+The following method must be defined in the global namespace:
-The mainboard code must define several variables for the ASL files.
-
-* EC_SCI
- Defines the General Purpose Event (GPE) corresponding to the EC's SCI line.
-* EC_ACPI_LID_SWITCH_OBJECT
- Defines the APCI object which reads the state of the lid, with 0 = open, and
- 1 = closed. This is usually the bit which reads the GPIO input corresponding
- to the lid switch.
* PNOT()
The mainboard must define a PNOT method to handle power state notifications
and Notify CPU device objects to re-evaluate their _PPC and _CST tables.
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 */ }
+ }
}