summaryrefslogtreecommitdiff
path: root/src/mainboard/hp/pavilion_m6_1035dx/ec.c
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-04-09 12:24:39 -0500
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-04-17 16:48:57 +0200
commit73639e27170355a2bb9a54a340f5bcd2f3dac161 (patch)
treee06c0142a6e79eea25fa51fb70068ad584978576 /src/mainboard/hp/pavilion_m6_1035dx/ec.c
parent62abbe909d27c7351107b0466acc9ea07b490930 (diff)
downloadcoreboot-73639e27170355a2bb9a54a340f5bcd2f3dac161.tar.xz
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@gmail.com> Reviewed-on: http://review.coreboot.org/5512 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@gmail.com>
Diffstat (limited to 'src/mainboard/hp/pavilion_m6_1035dx/ec.c')
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/ec.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/ec.c b/src/mainboard/hp/pavilion_m6_1035dx/ec.c
index d61a2e5301..2dd0009b7b 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();
}