From: Maximilian Brune Date: Wed, 22 Apr 2026 12:57:53 +0000 (+0200) Subject: pci: correct PCI device enumeration to include all functions on device 0 X-Git-Tag: v2026.07-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab5b5d2804b00d3253d09c6d8f829d918d2ed1c;p=thirdparty%2Fu-boot.git pci: correct PCI device enumeration to include all functions on device 0 Currently the implementation does not just skip all devices beside device 0, it also skips all functions (besides 0) on device 0. This broke basically all AMD platforms, since they have a lot of internal SOC devices behind these functions. This was detected, because the XHCI controller and therefore the USB devices were not found by u-boot on AMD/crater platform. PCI_MASK_BUS() returns both device and function bits, so it skips any bdf where either device > 0 or function > 0. Using PCI_DEV() extracts only the device number, matching the intent in only_one_child(). It therefore now checks all functions on device 0 (Linux does the same). I build tested u-boot as coreboot payload and run it on a recent x86 AMD platform. Devices like the XHCI controller are now found again. Fixes: fbde868ba4aa ("pci: skip unnecessary PCIe scanning") Signed-off-by: Maximilian Brune Reviewed-by: Simon Glass CC: Tom Rini CC: Andrew Goodbody CC: George McCollister CC: Simon Glass --- diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 83b76d01f24..f58d542ef75 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -927,7 +927,7 @@ int pci_bind_bus_devices(struct udevice *bus) if (PCI_FUNC(bdf) && !found_multi) continue; - if (only_one_child(bus) && (PCI_MASK_BUS(bdf) > 0)) + if (only_one_child(bus) && (PCI_DEV(bdf) > 0)) continue; /* Check only the first access, we don't expect problems */