aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bmips/files
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2023-04-18 20:11:28 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2023-04-18 20:11:28 +0200
commit5ec781c4448b91a0610dbea1a5f25bbd4bb35b73 (patch)
treed5a033482b6be1390c101036a6788de1718142fb /target/linux/bmips/files
parent16b0cbbde057e3e2cbb7efd92288520a29649192 (diff)
downloadupstream-5ec781c4448b91a0610dbea1a5f25bbd4bb35b73.tar.gz
upstream-5ec781c4448b91a0610dbea1a5f25bbd4bb35b73.tar.bz2
upstream-5ec781c4448b91a0610dbea1a5f25bbd4bb35b73.zip
bmips: pci-bcm6348: load IO resource from DT ranges
Correctly load IO resource from DT ranges and remove the specific IO resource. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bmips/files')
-rw-r--r--target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c b/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
index 730068ae79..39050b3de4 100644
--- a/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
+++ b/target/linux/bmips/files/drivers/pci/controller/pci-bcm6348.c
@@ -335,10 +335,7 @@ static struct pci_ops bcm6348_pci_ops = {
.write = bcm6348_pci_write,
};
-static struct resource bcm6348_pci_io_resource = {
- .name = "BCM6348 PCI IO space",
- .flags = IORESOURCE_IO,
-};
+static struct resource bcm6348_pci_io_resource;
static struct resource bcm6348_pci_mem_resource;
static struct resource bcm6348_pci_busn_resource;
@@ -732,26 +729,13 @@ static int bcm6348_pci_probe(struct platform_device *pdev)
of_pci_check_probe_only();
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pci");
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->pci = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->pci))
return PTR_ERR(priv->pci);
priv->pcmcia = priv->pci + PCMCIA_OFFSET;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pci-io");
- if (!res)
- return -EINVAL;
-#ifdef CONFIG_CARDBUS
- bcm6348_pci_io_resource.start = res->start;
- bcm6348_pci_io_resource.end = res->end - (resource_size(res) >> 1);
- bcm6348_cb_io_resource.start = res->start + (resource_size(res) >> 1);
- bcm6348_cb_io_resource.end = res->end;
-#else
- bcm6348_pci_io_resource.start = res->start;
- bcm6348_pci_io_resource.end = res->end;
-#endif
-
priv->irq = platform_get_irq(pdev, 0);
if (!priv->irq)
return -ENODEV;
@@ -773,6 +757,12 @@ static int bcm6348_pci_probe(struct platform_device *pdev)
of_pci_parse_bus_range(np, &bcm6348_pci_busn_resource);
pci_add_resource(&resources, &bcm6348_pci_busn_resource);
+#ifdef CONFIG_CARDBUS
+ bcm6348_cb_io_resource.start = bcm6348_pci_io_resource.start + (resource_size(&bcm6348_pci_io_resource) >> 1);
+ bcm6348_cb_io_resource.end = bcm6348_pci_io_resource.end;
+ bcm6348_pci_io_resource.end = bcm6348_pci_io_resource.end - (resource_size(&bcm6348_pci_io_resource) >> 1);
+#endif
+
/*
* Configuration accesses are done through IO space, remap 4
* first bytes to access it from CPU.