[U-Boot] [PATCH v3 03/30] pci: Honour pci_skip_dev()
Simon Glass
sjg at chromium.org
Thu Nov 13 02:26:49 CET 2014
From: Thierry Reding <treding at nvidia.com>
When enumerating devices, honour the pci_skip_dev() function. This can
be used by PCI controller drivers to restrict which devices will be
probed.
This is required by the NVIDIA Tegra PCIe controller driver, which will
fail with a data abort exception if an access is attempted to a device
number larger than 0 outside of bus 0. pci_skip_dev() is therefore
implemented to prevent any such accesses.
Signed-off-by: Thierry Reding <treding at nvidia.com>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v3: None
common/cmd_pci.c | 3 +++
drivers/pci/pci.c | 3 +++
include/pci.h | 1 +
3 files changed, 7 insertions(+)
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 5a6048c..e3a77e3 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -71,6 +71,9 @@ void pciinfo(int BusNum, int ShortPCIListing)
dev = PCI_BDF(BusNum, Device, Function);
+ if (pci_skip_dev(hose, dev))
+ continue;
+
pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID);
if ((VendorID == 0xFFFF) || (VendorID == 0x0000))
continue;
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 60c333e..0d321a6 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -195,6 +195,9 @@ pci_dev_t pci_find_devices(struct pci_device_id *ids, int index)
bdf < PCI_BDF(bus + 1, 0, 0);
#endif
bdf += PCI_BDF(0, 0, 1)) {
+ if (pci_skip_dev(hose, bdf))
+ continue;
+
if (!PCI_FUNC(bdf)) {
pci_read_config_byte(bdf,
PCI_HEADER_TYPE,
diff --git a/include/pci.h b/include/pci.h
index 2ff7365..d211351 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -623,6 +623,7 @@ extern void pci_register_hose(struct pci_controller* hose);
extern struct pci_controller* pci_bus_to_hose(int bus);
extern struct pci_controller *find_hose_by_cfg_addr(void *cfg_addr);
+extern int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev);
extern int pci_hose_scan(struct pci_controller *hose);
extern int pci_hose_scan_bus(struct pci_controller *hose, int bus);
--
2.1.0.rc2.206.gedb03e5
More information about the U-Boot
mailing list