|
@@ -56,7 +56,7 @@ struct pcie_port {
|
|
|
void __iomem *base;
|
|
|
spinlock_t conf_lock;
|
|
|
int irq;
|
|
|
- struct resource res[2];
|
|
|
+ struct resource res;
|
|
|
};
|
|
|
|
|
|
static int pcie_port_map[2];
|
|
@@ -136,21 +136,13 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp)
|
|
|
pp->base = (void __iomem *)PCIE_VIRT_BASE;
|
|
|
pp->irq = IRQ_KIRKWOOD_PCIE;
|
|
|
|
|
|
- /*
|
|
|
- * IORESOURCE_IO
|
|
|
- */
|
|
|
- pp->res[0].name = "PCIe 0 I/O Space";
|
|
|
- pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE;
|
|
|
- pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1;
|
|
|
- pp->res[0].flags = IORESOURCE_IO;
|
|
|
-
|
|
|
/*
|
|
|
* IORESOURCE_MEM
|
|
|
*/
|
|
|
- pp->res[1].name = "PCIe 0 MEM";
|
|
|
- pp->res[1].start = KIRKWOOD_PCIE_MEM_PHYS_BASE;
|
|
|
- pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1;
|
|
|
- pp->res[1].flags = IORESOURCE_MEM;
|
|
|
+ pp->res.name = "PCIe 0 MEM";
|
|
|
+ pp->res.start = KIRKWOOD_PCIE_MEM_PHYS_BASE;
|
|
|
+ pp->res.end = pp->res.start + KIRKWOOD_PCIE_MEM_SIZE - 1;
|
|
|
+ pp->res.flags = IORESOURCE_MEM;
|
|
|
}
|
|
|
|
|
|
static void __init pcie1_ioresources_init(struct pcie_port *pp)
|
|
@@ -158,21 +150,13 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp)
|
|
|
pp->base = (void __iomem *)PCIE1_VIRT_BASE;
|
|
|
pp->irq = IRQ_KIRKWOOD_PCIE1;
|
|
|
|
|
|
- /*
|
|
|
- * IORESOURCE_IO
|
|
|
- */
|
|
|
- pp->res[0].name = "PCIe 1 I/O Space";
|
|
|
- pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE;
|
|
|
- pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1;
|
|
|
- pp->res[0].flags = IORESOURCE_IO;
|
|
|
-
|
|
|
/*
|
|
|
* IORESOURCE_MEM
|
|
|
*/
|
|
|
- pp->res[1].name = "PCIe 1 MEM";
|
|
|
- pp->res[1].start = KIRKWOOD_PCIE1_MEM_PHYS_BASE;
|
|
|
- pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE1_MEM_SIZE - 1;
|
|
|
- pp->res[1].flags = IORESOURCE_MEM;
|
|
|
+ pp->res.name = "PCIe 1 MEM";
|
|
|
+ pp->res.start = KIRKWOOD_PCIE1_MEM_PHYS_BASE;
|
|
|
+ pp->res.end = pp->res.start + KIRKWOOD_PCIE1_MEM_SIZE - 1;
|
|
|
+ pp->res.flags = IORESOURCE_MEM;
|
|
|
}
|
|
|
|
|
|
static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
|
|
@@ -197,23 +181,21 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
|
|
|
case 0:
|
|
|
kirkwood_enable_pcie_clk("0");
|
|
|
pcie0_ioresources_init(pp);
|
|
|
+ pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE_IO_PHYS_BASE);
|
|
|
break;
|
|
|
case 1:
|
|
|
kirkwood_enable_pcie_clk("1");
|
|
|
pcie1_ioresources_init(pp);
|
|
|
+ pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE);
|
|
|
break;
|
|
|
default:
|
|
|
panic("PCIe setup: invalid controller %d", index);
|
|
|
}
|
|
|
|
|
|
- if (request_resource(&ioport_resource, &pp->res[0]))
|
|
|
- panic("Request PCIe%d IO resource failed\n", index);
|
|
|
- if (request_resource(&iomem_resource, &pp->res[1]))
|
|
|
+ if (request_resource(&iomem_resource, &pp->res))
|
|
|
panic("Request PCIe%d Memory resource failed\n", index);
|
|
|
|
|
|
- sys->io_offset = 0;
|
|
|
- pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset);
|
|
|
- pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
|
|
|
+ pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset);
|
|
|
|
|
|
/*
|
|
|
* Generic PCIe unit setup.
|