summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc1
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/ec.c28
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/ec.h11
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/mainboard.c4
4 files changed, 44 insertions, 0 deletions
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
index 3103f70d11..07ea765df4 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
+++ b/src/mainboard/hp/pavilion_m6_1035dx/Makefile.inc
@@ -26,3 +26,4 @@ ramstage-y += buildOpts.c
ramstage-y += agesawrapper.c
ramstage-y += BiosCallOuts.c
ramstage-y += PlatformGnbPcie.c
+ramstage-y += ec.c
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/ec.c b/src/mainboard/hp/pavilion_m6_1035dx/ec.c
new file mode 100644
index 0000000000..d61a2e5301
--- /dev/null
+++ b/src/mainboard/hp/pavilion_m6_1035dx/ec.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me@gmail.com>
+ * Subject to the GNU GPL v2, or (at your option) any later version.
+ */
+
+#include "ec.h"
+#include <ec/compal/ene932/ec.h>
+
+/* The keyboard matrix tells the EC how the keyboard is wired internally */
+static void set_keyboard_matrix_us(void)
+{
+ ec_kbc_write_cmd(0x59);
+ 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)
+{
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xE8);
+}
+
+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();
+}
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/ec.h b/src/mainboard/hp/pavilion_m6_1035dx/ec.h
new file mode 100644
index 0000000000..0c00d7aae0
--- /dev/null
+++ b/src/mainboard/hp/pavilion_m6_1035dx/ec.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2014 Alexandru Gagniuc <mr.nuke.me@gmail.com>
+ * Subject to the GNU GPL v2, or (at your option) any later version.
+ */
+
+#ifndef _MAINBOARD_HP_PAVILION_M6_1035DX_EC_H
+#define _MAINBOARD_HP_PAVILION_M6_1035DX_EC_H
+
+void pavilion_m6_1035dx_ec_init(void);
+
+#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 5ac478f968..2e2b72bf03 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/mainboard.c
@@ -19,6 +19,7 @@
#include "agesawrapper.h"
#include "BiosCallOuts.h"
+#include "ec.h"
#include <arch/acpi.h>
#include <arch/io.h>
@@ -35,6 +36,9 @@
static void mainboard_enable(device_t dev)
{
printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
+
+ pavilion_m6_1035dx_ec_init();
+
/*
* The mainboard is the first place that we get control in ramstage. Check
* for S3 resume and call the approriate AGESA/CIMx resume functions.