]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: pci-uclass: Add board_pci_fixup_dev for DM_PCI
authorTim Harvey <tharvey@gateworks.com>
Fri, 16 Apr 2021 21:53:47 +0000 (14:53 -0700)
committerStefano Babic <sbabic@denx.de>
Sun, 2 May 2021 10:46:54 +0000 (12:46 +0200)
Add a board_pci_fixup_dev weak function to allow PCI device fixups
during enumeration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
drivers/pci/pci-uclass.c
include/pci.h

index f463ef35509f3f8ac8ce9ba30707f13272e0aa16..22a033e6329b9506ac6c5545215afc2669992921 100644 (file)
@@ -790,6 +790,10 @@ error:
        return ret;
 }
 
+__weak extern void board_pci_fixup_dev(struct udevice *bus, struct udevice *dev)
+{
+}
+
 int pci_bind_bus_devices(struct udevice *bus)
 {
        ulong vendor, device;
@@ -895,6 +899,8 @@ int pci_bind_bus_devices(struct udevice *bus)
                                }
                        }
                }
+
+               board_pci_fixup_dev(bus, dev);
        }
 
        return 0;
index 5f36537b725cd448b4e976a52fb9424306fd621a..2353cebb2a3efdb4033a08e600f1eb7866dcb1d3 100644 (file)
@@ -1690,6 +1690,14 @@ int sandbox_pci_get_emul(const struct udevice *bus, pci_dev_t find_devfn,
  */
 int sandbox_pci_get_client(struct udevice *emul, struct udevice **devp);
 
+/**
+ * board_pci_fixup_dev() - Board callback for PCI device fixups
+ *
+ * @bus:       PCI bus
+ * @dev:       PCI device
+ */
+extern void board_pci_fixup_dev(struct udevice *bus, struct udevice *dev);
+
 #endif /* CONFIG_DM_PCI */
 
 /**