diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2010-08-13 09:18:58 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-08-13 09:18:58 +0000 |
commit | 6615ef3bfc3ff20643a31f01e40473e174460b46 (patch) | |
tree | 008063a7044a603d606cab68b05e20326b5ba47b /payloads/libpayload/drivers/usb/usbinit.c | |
parent | 03e54de648db0c7059ff7732b8b74a44317ef1a9 (diff) | |
download | coreboot-6615ef3bfc3ff20643a31f01e40473e174460b46.tar.xz |
Add support for OHCI controllers and prelimiary support for xHCI (USB3) controllers.
Improve scanning for USB controllers.
Limitations:
- OHCI doesn't support interrupt transfers yet (ie. no keyboards)
- xHCI just does initialization and device attach/detach so far
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5691 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbinit.c')
-rw-r--r-- | payloads/libpayload/drivers/usb/usbinit.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c index adaba34602..9c8063a3cb 100644 --- a/payloads/libpayload/drivers/usb/usbinit.c +++ b/payloads/libpayload/drivers/usb/usbinit.c @@ -30,9 +30,9 @@ #include <libpayload-config.h> #include <usb/usb.h> #include "uhci.h" -//#include "ohci.h" +#include "ohci.h" //#include "ehci.h" -//#include "xhci.h" +#include "xhci.h" #include <usb/usbdisk.h> /** @@ -68,7 +68,7 @@ usb_controller_initialize (int bus, int dev, int func) pci_command |= PCI_COMMAND_MASTER; pci_write_config32(addr, PCI_COMMAND, pci_command); - printf ("%02x:%02x.%x %04x:%04x.%d ", 0, dev, func, + printf ("%02x:%02x.%x %04x:%04x.%d ", bus, dev, func, pciid >> 16, pciid & 0xFFFF, func); if (prog_if == 0) { printf ("UHCI controller\n"); @@ -81,8 +81,7 @@ usb_controller_initialize (int bus, int dev, int func) if (prog_if == 0x10) { printf ("OHCI controller\n"); #ifdef CONFIG_USB_OHCI - //ohci_init(addr); - printf ("Not supported.\n"); + ohci_init(addr); #else printf ("Not supported.\n"); #endif @@ -99,10 +98,9 @@ usb_controller_initialize (int bus, int dev, int func) } if (prog_if == 0x30) { - printf ("XHCI controller\n"); + printf ("xHCI controller\n"); #ifdef CONFIG_USB_XHCI - //xhci_init(addr); - printf ("Not supported.\n"); + xhci_init(addr); #else printf ("Not supported.\n"); #endif @@ -128,8 +126,9 @@ usb_initialize (void) */ for (bus = 0; bus < 256; bus++) for (dev = 0; dev < 32; dev++) - for (func = 7; func >= 0 ; func--) - usb_controller_initialize (bus, dev, func); + if (pci_read_config32 (PCI_DEV(bus, dev, 0), 8) >> 16 == 0x0c03) + for (func = 7; func >= 0 ; func--) + usb_controller_initialize (bus, dev, func); usb_poll(); return 0; } |