Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6708
-gerrit
commit a30aaf5be3d76a8d528c80ad436dbe942b2dcbe4 Author: Vladimir Serbinenko phcoder@gmail.com Date: Tue Aug 19 00:48:39 2014 +0200
lenovo/x201: Unpower USB on undocking
Change-Id: I9b496e8ff92ee575d0b780eab0cb45ea05506d30 Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/mainboard/lenovo/x201/acpi/dock.asl | 2 ++ src/mainboard/lenovo/x201/dock.c | 8 ++++++++ src/mainboard/lenovo/x201/gpio.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/lenovo/x201/acpi/dock.asl b/src/mainboard/lenovo/x201/acpi/dock.asl index 974dc96..421ee15 100644 --- a/src/mainboard/lenovo/x201/acpi/dock.asl +++ b/src/mainboard/lenovo/x201/acpi/dock.asl @@ -33,11 +33,13 @@ Scope (_SB) { if (Arg0) { /* connect dock */ + Store (1, \GP28) Store (1, _SB.PCI0.LPCB.EC.DKR1) Store (1, _SB.PCI0.LPCB.EC.DKR2) Store (1, _SB.PCI0.LPCB.EC.DKR3) } else { /* disconnect dock */ + Store (0, \GP28) Store (0, _SB.PCI0.LPCB.EC.DKR1) Store (0, _SB.PCI0.LPCB.EC.DKR2) Store (0, _SB.PCI0.LPCB.EC.DKR3) diff --git a/src/mainboard/lenovo/x201/dock.c b/src/mainboard/lenovo/x201/dock.c index fb2c797..3dba5e1 100644 --- a/src/mainboard/lenovo/x201/dock.c +++ b/src/mainboard/lenovo/x201/dock.c @@ -42,16 +42,24 @@ void h8_mainboard_init_dock (void)
void dock_connect(void) { + u16 gpiobase = pci_read_config16(PCH_LPC_DEV, GPIO_BASE) & 0xfffc; + ec_set_bit(0x02, 0); ec_set_bit(0x1a, 0); ec_set_bit(0xfe, 4); + + outl(inl(gpiobase + 0x0c) | (1 << 28), gpiobase + 0x0c); }
void dock_disconnect(void) { + u16 gpiobase = pci_read_config16(PCH_LPC_DEV, GPIO_BASE) & 0xfffc; + ec_clr_bit(0x02, 0); ec_clr_bit(0x1a, 0); ec_clr_bit(0xfe, 4); + + outl(inl(gpiobase + 0x0c) & ~(1 << 28), gpiobase + 0x0c); }
int dock_present(void) diff --git a/src/mainboard/lenovo/x201/gpio.h b/src/mainboard/lenovo/x201/gpio.h index d9e9ff2..f01c9d9 100644 --- a/src/mainboard/lenovo/x201/gpio.h +++ b/src/mainboard/lenovo/x201/gpio.h @@ -156,7 +156,7 @@ const struct pch_gpio_set1 pch_gpio_set1_level = { .gpio25 = GPIO_LEVEL_HIGH, .gpio26 = GPIO_LEVEL_HIGH, .gpio27 = GPIO_LEVEL_HIGH, - .gpio28 = GPIO_LEVEL_HIGH, + .gpio28 = GPIO_LEVEL_LOW, .gpio29 = GPIO_LEVEL_HIGH, .gpio30 = GPIO_LEVEL_HIGH, .gpio31 = GPIO_LEVEL_HIGH,