summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/t400/dock.h
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2018-10-30 17:38:13 +0100
committerFelix Held <felix-coreboot@felixheld.de>2018-11-10 11:51:27 +0000
commitc0a1625df13ac9e95ca4de849ac52bb3af29c7b6 (patch)
treed00241b3078090ff85d5f18df9043fc2e8acc549 /src/mainboard/lenovo/t400/dock.h
parentd2c2f83964ff43141011c52c27e6eca7f1e5263a (diff)
mb/lenovo/t400: Improve docking code
* Remove dead code * Add support for types 2504 and 2505 * Print dock info at romstage entry * Improve dock disconnect for type 2505 * Move defines into dock.h for future ACPI code * Reduce timeouts according to spec to decrease boot time on error * Fix no docking detection (reduces boot time by 1 second) * Configure GPIO LDN before reading GPIOs * Use Kconfig values instead of fixed defines * Add documentation Tested on Lenovo T500 with docking 2504 and 2505. Change-Id: Ic4510ffadc67da95961cecd51a6d8ed856b3ac99 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/29418 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/mainboard/lenovo/t400/dock.h')
-rw-r--r--src/mainboard/lenovo/t400/dock.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/lenovo/t400/dock.h b/src/mainboard/lenovo/t400/dock.h
index 74b730ca23..4d2b32b9b7 100644
--- a/src/mainboard/lenovo/t400/dock.h
+++ b/src/mainboard/lenovo/t400/dock.h
@@ -16,7 +16,34 @@
#ifndef THINKPAD_T400_DOCK_H
#define THINKPAD_T400_DOCK_H
+#ifndef __ACPI__
+int pc87382_early(void);
+
void dock_connect(void);
void dock_disconnect(void);
int dock_present(void);
+void dock_info(void);
+#endif
+
+/* pc87382 */
+#define DLPC_CONTROL 0x164c
+#define DLPC_GPIO_BASE 0x1680
+
+#define DLPC_GPDO0 (DLPC_GPIO_BASE + 0x0)
+#define DLPC_GPDI0 (DLPC_GPIO_BASE + 0x1)
+#define D_PLTRST 0x01
+#define D_LPCPD 0x02
+
+#define DLPC_GPDO2 (DLPC_GPIO_BASE + 0x8)
+#define DLPC_GPDI2 (DLPC_GPIO_BASE + 0x9)
+
+ /* Pullups on all GPIOs, dock pulls ID pins low */
+#define DOCK_TYPE_2504 1
+#define DOCK_TYPE_2505 2
+#define DOCK_TYPE_NONE 7
+
+/* pc87384 */
+#define SUPERIO_DEV 0x2e
+#define DOCK_GPIO_BASE 0x1620
+
#endif