summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/lynxpoint/usb_ehci.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2013-05-29 15:27:55 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-11-25 23:55:15 +0100
commit2d9d39a7041cf531246845194f76cb9f65eaa08d (patch)
tree51f60a7d9ede4ee6f2b44e270d85a08195dd6aef /src/southbridge/intel/lynxpoint/usb_ehci.c
parent5afca1357fdaebc5c4ad2b2a963f3c239648ba76 (diff)
downloadcoreboot-2d9d39a7041cf531246845194f76cb9f65eaa08d.tar.xz
lynxpoint: Enable USB clock gating, late setup, and sleep prep
Both EHCI and XHCI controllers have additional setup steps that are not part of the PEI reference code so they need to be done later. Both controllers also have specific clock gating setup requirements that are now implemented. Additionally they both have specific requirements when entering sleep states. XHCI needs something in S3/S4/S5 and EHCI only has steps for S4/S5 entry. Change-Id: Ic62cbc8b6255455e56b72dd5d52e27a311999330 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/57033 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/4217 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/southbridge/intel/lynxpoint/usb_ehci.c')
-rw-r--r--src/southbridge/intel/lynxpoint/usb_ehci.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/southbridge/intel/lynxpoint/usb_ehci.c b/src/southbridge/intel/lynxpoint/usb_ehci.c
index fd7c659edd..f06151b138 100644
--- a/src/southbridge/intel/lynxpoint/usb_ehci.c
+++ b/src/southbridge/intel/lynxpoint/usb_ehci.c
@@ -26,20 +26,33 @@
#include <usbdebug.h>
#include <arch/io.h>
-static void usb_ehci_init(struct device *dev)
+static void usb_ehci_clock_gating(struct device *dev)
{
u32 reg32;
- /* Disable Wake on Disconnect in RMH */
- reg32 = RCBA32(0x35b0);
- reg32 |= 0x22;
- RCBA32(0x35b0) = reg32;
+ /* IOBP 0xE5004001[7:6] = 11b */
+ pch_iobp_update(0xe5004001, ~0, (1 << 7)|(1 << 6));
+
+ /* Dx:F0:DCh[5,2,1] = 111b
+ * Dx:F0:DCh[0] = 1b when EHCI controller is disabled */
+ reg32 = pci_read_config32(dev, 0xdc);
+ reg32 |= (1 << 5) | (1 << 2) | (1 << 1);
+ pci_write_config32(dev, 0xdc, reg32);
+
+ /* Dx:F0:78h[1:0] = 11b */
+ reg32 = pci_read_config32(dev, 0x78);
+ reg32 |= (1 << 1) | (1 << 0);
+ pci_write_config32(dev, 0x78, reg32);
+}
+static void usb_ehci_init(struct device *dev)
+{
printk(BIOS_DEBUG, "EHCI: Setting up controller.. ");
- reg32 = pci_read_config32(dev, PCI_COMMAND);
- reg32 |= PCI_COMMAND_MASTER;
- //reg32 |= PCI_COMMAND_SERR;
- pci_write_config32(dev, PCI_COMMAND, reg32);
+
+ usb_ehci_clock_gating(dev);
+
+ /* Disable Wake on Disconnect in RMH */
+ RCBA32_OR(0x35b0, 0x00000022);
printk(BIOS_DEBUG, "done.\n");
}