diff mbox series

[2/3] pci: pci-uclass: Add board_pci_fixup_dev for DM_PCI

Message ID 20210416215348.15277-2-tharvey@gateworks.com
State Accepted
Commit cecd013fdfc740612c171cb3ffa5cabd88ffa1de
Delegated to: Stefano Babic
Headers show
Series [1/3] pci: Update the highest subordinate bus number for bridge setup | expand

Commit Message

Tim Harvey April 16, 2021, 9:53 p.m. UTC
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 | 6 ++++++
 include/pci.h            | 8 ++++++++
 2 files changed, 14 insertions(+)

Comments

Stefano Babic May 2, 2021, 11:42 a.m. UTC | #1
> Add a board_pci_fixup_dev weak function to allow PCI device fixups
> during enumeration.
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index f463ef3550..22a033e632 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -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;
diff --git a/include/pci.h b/include/pci.h
index 5f36537b72..2353cebb2a 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -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 */
 
 /**