|
@@ -72,13 +72,19 @@ void efx_probe(struct net_device *netdev, enum efx_revision revision)
|
72
|
72
|
struct efx_nic *efx = netdev_priv(netdev);
|
73
|
73
|
struct pci_device *pci = container_of(netdev->dev,
|
74
|
74
|
struct pci_device, dev);
|
|
75
|
+ unsigned int reg = PCI_BASE_ADDRESS_0;
|
|
76
|
+ uint32_t bar_low;
|
75
|
77
|
|
76
|
78
|
efx->netdev = netdev;
|
77
|
79
|
efx->revision = revision;
|
78
|
80
|
|
79
|
|
- /* MMIO bar */
|
80
|
|
- efx->mmio_start = pci_bar_start(pci, PCI_BASE_ADDRESS_2);
|
81
|
|
- efx->mmio_len = pci_bar_size(pci, PCI_BASE_ADDRESS_2);
|
|
81
|
+ /* Find the memory bar to use */
|
|
82
|
+ pci_read_config_dword(pci, reg, &bar_low);
|
|
83
|
+ if ((bar_low & PCI_BASE_ADDRESS_IO_MASK) == PCI_BASE_ADDRESS_SPACE_IO)
|
|
84
|
+ reg = PCI_BASE_ADDRESS_2;
|
|
85
|
+
|
|
86
|
+ efx->mmio_start = pci_bar_start(pci, reg);
|
|
87
|
+ efx->mmio_len = pci_bar_size(pci, reg);
|
82
|
88
|
efx->membase = ioremap(efx->mmio_start, efx->mmio_len);
|
83
|
89
|
|
84
|
90
|
DBGCP(efx, "BAR of %lx bytes at phys %lx mapped at %p\n",
|