[U-Boot] [RFC 22/22] pci: auto probe thunderx NIC devices

Tim Harvey tharvey at gateworks.com
Fri Feb 22 18:03:19 UTC 2019


For boards with soc peripherals via the pci devices some devices require
probing during config to be available (ie VNIC on ThunderX SoCs).

Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 drivers/pci/pci_auto.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index d7237f6eee..7ab0e06cc7 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <dm/device-internal.h>
 #include <errno.h>
 #include <pci.h>
 
@@ -128,6 +129,23 @@ void dm_pciauto_setup_device(struct udevice *dev, int bars_num,
 	}
 
 	if (!enum_only) {
+		u16 device, vendor;
+
+		dm_pci_read_config16(dev, PCI_DEVICE_ID, &device);
+		dm_pci_read_config16(dev, PCI_VENDOR_ID, &vendor);
+		if ( (vendor == PCI_VENDOR_ID_CAVIUM) &&
+		     ((device == PCI_DEVICE_ID_THUNDERX_SMI) ||
+		      (device == PCI_DEVICE_ID_THUNDERX_RGX) ||
+		      (device == PCI_DEVICE_ID_THUNDERX_BGX) ||
+		      (device == PCI_DEVICE_ID_THUNDERX_NIC_PF) ||
+		      (device == PCI_DEVICE_ID_THUNDERX_NIC_VF_1) ||
+		      (device == PCI_DEVICE_ID_THUNDERX_NIC_VF)) )
+		{
+			debug("Probing 0x%04x:0x%04x %s\n", vendor, device,
+			      dev->name);
+			device_probe(dev);
+		}
+
 		/* Configure the expansion ROM address */
 		dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type);
 		header_type &= 0x7f;
-- 
2.17.1



More information about the U-Boot mailing list