summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/g505s/ec.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-23 17:38:52 +1100
committerEdward O'Callaghan <eocallaghan@alterapraxis.com>2014-11-27 11:28:24 +0100
commit32960e30f08f678355b20b5702e8028351a7275e (patch)
tree8a44ac8674c02286bccb63bf8286645b3c3c367b /src/mainboard/lenovo/g505s/ec.c
parentb06eaf76b5142977aa130c22f09a97ad08bef036 (diff)
downloadcoreboot-32960e30f08f678355b20b5702e8028351a7275e.tar.xz
mainboard/lenovo/g505s: New port Richland APU A10-5750M
Richland APU A10-5750M 8GB RAM 4MB Flash Boots to working Linux with SeaBIOS payload. S3 works with Linux 3.16.3-2 Debian Jessie. Change-Id: I5d05d1b31400fdb9e41c2e011c5b0bf9986fe970 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-on: http://review.coreboot.org/7560 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/mainboard/lenovo/g505s/ec.c')
-rw-r--r--src/mainboard/lenovo/g505s/ec.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mainboard/lenovo/g505s/ec.c b/src/mainboard/lenovo/g505s/ec.c
new file mode 100644
index 0000000000..61f70b7a4e
--- /dev/null
+++ b/src/mainboard/lenovo/g505s/ec.c
@@ -0,0 +1,36 @@
+/*
+ * 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 APM mode. Events generate SMIs instead of SCIs */
+static void enter_apm_mode(void)
+{
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xE9);
+}
+
+void lenovo_g505s_ec_init(void)
+{
+ set_keyboard_matrix_us();
+
+ /*
+ * 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();
+}