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
diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c
index adaba34..9c8063a 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 @@
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 @@
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 @@
}
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 @@
*/
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;
}