summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/s230u/ec.h
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+openocd@tdiedrich.de>2017-02-12 14:09:06 +0100
committerMartin Roth <martinroth@google.com>2017-02-20 18:21:56 +0100
commitcee930a39b183260ea83ac72fc9ca59d61353d8d (patch)
treeb3fd18b7a202b837fc512e2b71a599956fdbbdee /src/mainboard/lenovo/s230u/ec.h
parent97535558f1a1c123a60d73244d835ff5d8d31213 (diff)
downloadcoreboot-cee930a39b183260ea83ac72fc9ca59d61353d8d.tar.xz
lenovo/s230u: Add Thinkpad Twist (S230U)
Created using autoport plus some manual work and copying from G505S to account for the non-H8 EC. This model uses the same ENE KB9012 EC as the G505S. Tested: - Mainboard variant with 8GB Elpida DDR3 - SeaBIOS payload - Booting into Linux 4.9.6 with Debian/unstable installed on the internal HDD/SDD slot - Native raminit - Both native VGA init and option rom VGA init - Basic TPM functionality (auto-detection and RNG) - Battery status readout - Basic ACPI functions (power button event; power-off; reboot) - thinkpad-acpi hotkey functions - thinkpad-acpi LED control (red thinkpad LED) - Suspend to RAM and resume works - Mini displayport output works Known issues: - Patches needed for EC battery support https://review.coreboot.org/#/c/18348/ https://review.coreboot.org/#/c/18349/ - No thermal zone since temperature sensing is not H8-compatible and needs to be reverse engineered. Not tested: - msata/wwan (probably works) Signed-off-by: Tobias Diedrich <ranma+coreboot@tdiedrich.de> Change-Id: I52bc4515277e5c18afbb14a80a9ac788049f485c Reviewed-on: https://review.coreboot.org/18351 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/mainboard/lenovo/s230u/ec.h')
-rw-r--r--src/mainboard/lenovo/s230u/ec.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mainboard/lenovo/s230u/ec.h b/src/mainboard/lenovo/s230u/ec.h
new file mode 100644
index 0000000000..afb6cdc8fb
--- /dev/null
+++ b/src/mainboard/lenovo/s230u/ec.h
@@ -0,0 +1,19 @@
+/*
+ * 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_LENOVO_S230U_EC_H
+#define _MAINBOARD_LENOVO_S230U_EC_H
+
+#ifndef __SMM__
+void lenovo_s230u_ec_init(void);
+#endif
+
+#define ECMM(x) (*((volatile u8 *)(CONFIG_EC_BASE_ADDRESS + x)))
+#define ec_mm_read(addr) (ECMM(0x100 + addr))
+#define ec_mm_write(addr, data) (ECMM(0x100 + addr) = data)
+#define ec_mm_set_bit(addr, bit) (ECMM(0x100 + addr) |= 1 << bit)
+#define ec_mm_clr_bit(addr, bit) (ECMM(0x100 + addr) &= ~(1 << bit))
+
+#endif /* _MAINBOARD_LENOVO_S230U_EC_H */