diff options
author | Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2018-08-03 10:38:45 -0400 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-08-08 10:50:30 -0400 |
commit | ee1604381a371b3ea6aec7d5e43b6e3f5e153854 (patch) | |
tree | 44a73c6b1bdf9240d5ca3f54089ae3e2b68f84c3 | |
parent | dfd0309fd7b30a5baffaf47b2fccb88b46d64d69 (diff) |
PCI: mvebu: Only remap I/O space if configured
If there is no PCI I/O aperture configured in the Device Tree, it does
not make sense to create the virtual mapping for the PCI I/O space,
since we will anyway not create the MBus window that will allow to
access it. Therefore, do the pci_ioremap_io() only if necessary.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-rw-r--r-- | drivers/pci/controller/pci-mvebu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index a195592723c2..9aa224f2f009 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c | |||
@@ -1220,6 +1220,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev) | |||
1220 | pcie->realio.end = min_t(resource_size_t, | 1220 | pcie->realio.end = min_t(resource_size_t, |
1221 | IO_SPACE_LIMIT, | 1221 | IO_SPACE_LIMIT, |
1222 | resource_size(&pcie->io) - 1); | 1222 | resource_size(&pcie->io) - 1); |
1223 | |||
1224 | for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K) | ||
1225 | pci_ioremap_io(i, pcie->io.start + i); | ||
1223 | } else | 1226 | } else |
1224 | pcie->realio = pcie->io; | 1227 | pcie->realio = pcie->io; |
1225 | 1228 | ||
@@ -1278,9 +1281,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev) | |||
1278 | 1281 | ||
1279 | pcie->nports = i; | 1282 | pcie->nports = i; |
1280 | 1283 | ||
1281 | for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K) | ||
1282 | pci_ioremap_io(i, pcie->io.start + i); | ||
1283 | |||
1284 | mvebu_pcie_enable(pcie); | 1284 | mvebu_pcie_enable(pcie); |
1285 | 1285 | ||
1286 | return 0; | 1286 | return 0; |