From patchwork Fri Sep 3 14:44:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: libpayload: scan all PCI functions for USB Date: Fri, 03 Sep 2010 14:44:40 -0000 From: Jens Rottmann X-Patchwork-Id: 1858 Message-Id: <4C8109D8.1030100@LiPPERTEmbedded.de> To: coreboot mailing list The AMD CS5536's USB controllers are located at device 0F, functions 4 and 5. They're not found if only function 0 is checked. So if a device exists at all, try all its functions. usb_controller_initialize() will silently skip all device classes != 0C03. Signed-off-by: Jens Rottmann Acked-by: Patrick Georgi --- --- payloads/libpayload/drivers/usb/usbinit.c (rev 5767) +++ payloads/libpayload/drivers/usb/usbinit.c (working copy) @@ -126,7 +126,7 @@ */ for (bus = 0; bus < 256; bus++) for (dev = 0; dev < 32; dev++) - if (pci_read_config32 (PCI_DEV(bus, dev, 0), 8) >> 16 == 0x0c03) + if (pci_read_config16(PCI_DEV(bus, dev, 0), 10) != 0xFFFF) for (func = 7; func >= 0 ; func--) usb_controller_initialize (bus, dev, func); usb_poll();