diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-07-04 12:18:40 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-07-26 10:10:04 -0400 |
commit | dd9bf78040fa0da4cecc228e1682b9682b8cb180 (patch) | |
tree | 9cf716530a0549fdac85b7b7b68badce122ce313 /arch/arm/plat-iop/pci.c | |
parent | 0b9b18e0166d8925ed222335efbc3cfd66aa882f (diff) |
ARM: iop3xx: use fixed PCI i/o mapping
Move iop33x and iop32x PCI to fixed i/o mapping and remove io.h. This
changes the PCI bus addresses from the cpu address to 0 based. It appears
that there is translation h/w for this, but its untested.
Not sure what to do with io_offset. I think it should always be 0.
AFAICT, PCI setup is skipped if the ATU is already setup.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/plat-iop/pci.c')
-rw-r--r-- | arch/arm/plat-iop/pci.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c index 8daae9b230e..362474b5c40 100644 --- a/arch/arm/plat-iop/pci.c +++ b/arch/arm/plat-iop/pci.c | |||
@@ -192,30 +192,24 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys) | |||
192 | if (nr != 0) | 192 | if (nr != 0) |
193 | return 0; | 193 | return 0; |
194 | 194 | ||
195 | res = kzalloc(2 * sizeof(struct resource), GFP_KERNEL); | 195 | res = kzalloc(sizeof(struct resource), GFP_KERNEL); |
196 | if (!res) | 196 | if (!res) |
197 | panic("PCI: unable to alloc resources"); | 197 | panic("PCI: unable to alloc resources"); |
198 | 198 | ||
199 | res[0].start = IOP3XX_PCI_LOWER_IO_PA; | 199 | res->start = IOP3XX_PCI_LOWER_MEM_PA; |
200 | res[0].end = IOP3XX_PCI_LOWER_IO_PA + IOP3XX_PCI_IO_WINDOW_SIZE - 1; | 200 | res->end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1; |
201 | res[0].name = "IOP3XX PCI I/O Space"; | 201 | res->name = "IOP3XX PCI Memory Space"; |
202 | res[0].flags = IORESOURCE_IO; | 202 | res->flags = IORESOURCE_MEM; |
203 | request_resource(&ioport_resource, &res[0]); | 203 | request_resource(&iomem_resource, res); |
204 | |||
205 | res[1].start = IOP3XX_PCI_LOWER_MEM_PA; | ||
206 | res[1].end = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE - 1; | ||
207 | res[1].name = "IOP3XX PCI Memory Space"; | ||
208 | res[1].flags = IORESOURCE_MEM; | ||
209 | request_resource(&iomem_resource, &res[1]); | ||
210 | 204 | ||
211 | /* | 205 | /* |
212 | * Use whatever translation is already setup. | 206 | * Use whatever translation is already setup. |
213 | */ | 207 | */ |
214 | sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0; | 208 | sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0; |
215 | sys->io_offset = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR; | ||
216 | 209 | ||
217 | pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); | 210 | pci_add_resource_offset(&sys->resources, res, sys->mem_offset); |
218 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 211 | |
212 | pci_ioremap_io(0, IOP3XX_PCI_LOWER_IO_PA); | ||
219 | 213 | ||
220 | return 1; | 214 | return 1; |
221 | } | 215 | } |
@@ -367,7 +361,6 @@ void __init iop3xx_pci_preinit_cond(void) | |||
367 | 361 | ||
368 | void __init iop3xx_pci_preinit(void) | 362 | void __init iop3xx_pci_preinit(void) |
369 | { | 363 | { |
370 | pcibios_min_io = 0; | ||
371 | pcibios_min_mem = 0; | 364 | pcibios_min_mem = 0; |
372 | 365 | ||
373 | iop3xx_atu_disable(); | 366 | iop3xx_atu_disable(); |