]> git.sur5r.net Git - u-boot/commitdiff
pci: add support for board_pci_fixup_dev function
authorTim Harvey <tharvey@gateworks.com>
Fri, 8 Aug 2014 05:49:56 +0000 (22:49 -0700)
committerStefano Babic <sbabic@denx.de>
Tue, 9 Sep 2014 14:15:02 +0000 (16:15 +0200)
Some board-level drivers may wish to have per-device fixup functions
for PCI devices.

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

index 4fd9c532b3fbf8df2b351537dca1b196298f5899..28859f31612527ccff49ee3fbc69dbbc1caaaa54 100644 (file)
@@ -648,6 +648,10 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
                pci_hose_read_config_word(hose, dev, PCI_DEVICE_ID, &device);
                pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
 
+#ifdef CONFIG_PCI_FIXUP_DEV
+               board_pci_fixup_dev(hose, dev, vendor, device, class);
+#endif
+
 #ifdef CONFIG_PCI_SCAN_SHOW
                indent++;
 
index 461f17c058950d89f572545dbcd981e4b4eb6838..2ff73653c5c2382ae654a22c047e743c67b55df1 100644 (file)
@@ -659,6 +659,13 @@ extern int pci_hose_find_cap_start(struct pci_controller *hose, pci_dev_t dev,
 extern int pci_find_cap(struct pci_controller *hose, pci_dev_t dev, int pos,
                        int cap);
 
+#ifdef CONFIG_PCI_FIXUP_DEV
+extern void board_pci_fixup_dev(struct pci_controller *hose, pci_dev_t dev,
+                               unsigned short vendor,
+                               unsigned short device,
+                               unsigned short class);
+#endif
+
 const char * pci_class_str(u8 class);
 int pci_last_busno(void);