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>
This commit is contained in:
parent
16b0cbbde0
commit
5ec781c444
3 changed files with 14 additions and 28 deletions
|
@ -283,16 +283,14 @@
|
||||||
|
|
||||||
pci: pci@fffe1000 {
|
pci: pci@fffe1000 {
|
||||||
compatible = "brcm,bcm6348-pci";
|
compatible = "brcm,bcm6348-pci";
|
||||||
reg = <0xfffe1000 0x200>,
|
reg = <0xfffe1000 0x200>;
|
||||||
<0x08000000 0x10000>;
|
|
||||||
reg-names = "pci",
|
|
||||||
"pci-io";
|
|
||||||
#address-cells = <3>;
|
#address-cells = <3>;
|
||||||
#size-cells = <2>;
|
#size-cells = <2>;
|
||||||
|
|
||||||
device_type = "pci";
|
device_type = "pci";
|
||||||
bus-range = <0x00 0x01>;
|
bus-range = <0x00 0x01>;
|
||||||
ranges = <0x2000000 0 0x30000000 0x30000000 0 0x8000000>;
|
ranges = <0x2000000 0 0x30000000 0x30000000 0 0x8000000>,
|
||||||
|
<0x1000000 0 0x08000000 0x08000000 0 0x0010000>;
|
||||||
linux,pci-probe-only = <1>;
|
linux,pci-probe-only = <1>;
|
||||||
|
|
||||||
interrupt-parent = <&periph_intc>;
|
interrupt-parent = <&periph_intc>;
|
||||||
|
|
|
@ -412,16 +412,14 @@
|
||||||
|
|
||||||
pci: pci@10001000 {
|
pci: pci@10001000 {
|
||||||
compatible = "brcm,bcm6348-pci";
|
compatible = "brcm,bcm6348-pci";
|
||||||
reg = <0x10001000 0x200>,
|
reg = <0x10001000 0x200>;
|
||||||
<0x08000000 0x10000>;
|
|
||||||
reg-names = "pci",
|
|
||||||
"pci-io";
|
|
||||||
#address-cells = <3>;
|
#address-cells = <3>;
|
||||||
#size-cells = <2>;
|
#size-cells = <2>;
|
||||||
|
|
||||||
device_type = "pci";
|
device_type = "pci";
|
||||||
bus-range = <0x00 0x01>;
|
bus-range = <0x00 0x01>;
|
||||||
ranges = <0x2000000 0 0x30000000 0x30000000 0 0x8000000>;
|
ranges = <0x2000000 0 0x30000000 0x30000000 0 0x8000000>,
|
||||||
|
<0x1000000 0 0x08000000 0x08000000 0 0x0010000>;
|
||||||
linux,pci-probe-only = <1>;
|
linux,pci-probe-only = <1>;
|
||||||
|
|
||||||
interrupt-parent = <&periph_intc>;
|
interrupt-parent = <&periph_intc>;
|
||||||
|
|
|
@ -335,10 +335,7 @@ static struct pci_ops bcm6348_pci_ops = {
|
||||||
.write = bcm6348_pci_write,
|
.write = bcm6348_pci_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct resource bcm6348_pci_io_resource = {
|
static struct resource bcm6348_pci_io_resource;
|
||||||
.name = "BCM6348 PCI IO space",
|
|
||||||
.flags = IORESOURCE_IO,
|
|
||||||
};
|
|
||||||
static struct resource bcm6348_pci_mem_resource;
|
static struct resource bcm6348_pci_mem_resource;
|
||||||
static struct resource bcm6348_pci_busn_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();
|
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);
|
priv->pci = devm_ioremap_resource(dev, res);
|
||||||
if (IS_ERR(priv->pci))
|
if (IS_ERR(priv->pci))
|
||||||
return PTR_ERR(priv->pci);
|
return PTR_ERR(priv->pci);
|
||||||
|
|
||||||
priv->pcmcia = priv->pci + PCMCIA_OFFSET;
|
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);
|
priv->irq = platform_get_irq(pdev, 0);
|
||||||
if (!priv->irq)
|
if (!priv->irq)
|
||||||
return -ENODEV;
|
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);
|
of_pci_parse_bus_range(np, &bcm6348_pci_busn_resource);
|
||||||
pci_add_resource(&resources, &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
|
* Configuration accesses are done through IO space, remap 4
|
||||||
* first bytes to access it from CPU.
|
* first bytes to access it from CPU.
|
||||||
|
|
Loading…
Reference in a new issue