diff options
author | Patrick Rudolph <siro@das-labor.org> | 2018-10-30 17:38:13 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2018-11-10 11:51:27 +0000 |
commit | c0a1625df13ac9e95ca4de849ac52bb3af29c7b6 (patch) | |
tree | d00241b3078090ff85d5f18df9043fc2e8acc549 /src/mainboard/lenovo/t400/romstage.c | |
parent | d2c2f83964ff43141011c52c27e6eca7f1e5263a (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/romstage.c')
-rw-r--r-- | src/mainboard/lenovo/t400/romstage.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mainboard/lenovo/t400/romstage.c b/src/mainboard/lenovo/t400/romstage.c index bc419bf7d0..60e51c9808 100644 --- a/src/mainboard/lenovo/t400/romstage.c +++ b/src/mainboard/lenovo/t400/romstage.c @@ -66,6 +66,7 @@ void mainboard_romstage_entry(unsigned long bist) sysinfo_t sysinfo; int s3resume = 0; int cbmem_initted; + int err; u16 reg16; timestamp_init(get_initial_timestamp()); @@ -81,11 +82,20 @@ void mainboard_romstage_entry(unsigned long bist) i82801ix_early_init(); early_lpc_setup(); - dock_connect(); + /* Minimal setup to detect dock */ + err = pc87382_early(); + if (err == 0) + dock_connect(); console_init(); printk(BIOS_DEBUG, "running main(bist = %lu)\n", bist); + /* Print dock info */ + if (err) + printk(BIOS_ERR, "DOCK: Failed to init pc87382\n"); + else + dock_info(); + reg16 = pci_read_config16(LPC_DEV, D31F0_GEN_PMCON_3); pci_write_config16(LPC_DEV, D31F0_GEN_PMCON_3, reg16); if ((MCHBAR16(SSKPD_MCHBAR) == 0xCAFE) && !(reg16 & (1 << 9))) { |