diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-20 07:40:48 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-20 07:40:48 -0400 |
commit | 48e4237d96fdcb1237b63bcddb37771f97452eec (patch) | |
tree | 8a3f8ea4bff0f4545560fbeb6e3d1c06f882cf46 /arch/sh/drivers/pci/pci-sh5.c | |
parent | 3444f5ec49bc6cb901ffea38e085db1d76e1189c (diff) |
sh: pci: Convert the SH-5 code over to the new interface.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh5.c')
-rw-r--r-- | arch/sh/drivers/pci/pci-sh5.c | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/arch/sh/drivers/pci/pci-sh5.c b/arch/sh/drivers/pci/pci-sh5.c index 7750da276284..cf431852213c 100644 --- a/arch/sh/drivers/pci/pci-sh5.c +++ b/arch/sh/drivers/pci/pci-sh5.c | |||
@@ -27,12 +27,6 @@ | |||
27 | unsigned long pcicr_virt; | 27 | unsigned long pcicr_virt; |
28 | unsigned long PCI_IO_AREA; | 28 | unsigned long PCI_IO_AREA; |
29 | 29 | ||
30 | int __init sh5_pci_init(struct pci_channel *chan) | ||
31 | { | ||
32 | pr_debug("PCI: Starting intialization.\n"); | ||
33 | return pcibios_init_platform(); | ||
34 | } | ||
35 | |||
36 | /* Rounds a number UP to the nearest power of two. Used for | 30 | /* Rounds a number UP to the nearest power of two. Used for |
37 | * sizing the PCI window. | 31 | * sizing the PCI window. |
38 | */ | 32 | */ |
@@ -95,8 +89,21 @@ static irqreturn_t pcish5_serr_irq(int irq, void *dev_id) | |||
95 | return IRQ_NONE; | 89 | return IRQ_NONE; |
96 | } | 90 | } |
97 | 91 | ||
98 | int __init sh5pci_init(unsigned long memStart, unsigned long memSize) | 92 | static struct resource sh5_io_resource = { /* place holder */ }; |
93 | static struct resource sh5_mem_resource = { /* place holder */ }; | ||
94 | |||
95 | static struct pci_channel sh5pci_controller = { | ||
96 | .pci_ops = &sh5_pci_ops, | ||
97 | .mem_resource = &sh5_mem_resource, | ||
98 | .mem_offset = 0x00000000, | ||
99 | .io_resource = &sh5_io_resource, | ||
100 | .io_offset = 0x00000000, | ||
101 | }; | ||
102 | |||
103 | static int __init sh5pci_init(void) | ||
99 | { | 104 | { |
105 | unsigned long memStart = __pa(memory_start); | ||
106 | unsigned long memSize = __pa(memory_end) - memStart; | ||
100 | u32 lsr0; | 107 | u32 lsr0; |
101 | u32 uval; | 108 | u32 uval; |
102 | 109 | ||
@@ -203,35 +210,14 @@ int __init sh5pci_init(unsigned long memStart, unsigned long memSize) | |||
203 | SH5PCI_WRITE(AINTM, ~0); | 210 | SH5PCI_WRITE(AINTM, ~0); |
204 | SH5PCI_WRITE(PINTM, ~0); | 211 | SH5PCI_WRITE(PINTM, ~0); |
205 | 212 | ||
206 | return 0; | 213 | sh5_io_resource.start = PCI_IO_AREA; |
207 | } | 214 | sh5_io_resource.end = PCI_IO_AREA + 0x10000; |
208 | 215 | ||
209 | #define xPCIBIOS_MIN_IO board_pci_channels->io_resource->start | 216 | sh5_mem_resource.start = memStart; |
210 | #define xPCIBIOS_MIN_MEM board_pci_channels->mem_resource->start | 217 | sh5_mem_resource.end = memStart + memSize; |
211 | 218 | ||
212 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 219 | register_pci_controller(&sh5pci_controller); |
213 | { | 220 | |
214 | struct pci_dev *dev = bus->self; | 221 | return 0; |
215 | int i; | ||
216 | |||
217 | if (dev) { | ||
218 | for (i= 0; i < 3; i++) { | ||
219 | bus->resource[i] = | ||
220 | &dev->resource[PCI_BRIDGE_RESOURCES+i]; | ||
221 | bus->resource[i]->name = bus->name; | ||
222 | } | ||
223 | bus->resource[0]->flags |= IORESOURCE_IO; | ||
224 | bus->resource[1]->flags |= IORESOURCE_MEM; | ||
225 | |||
226 | /* For now, propagate host limits to the bus; | ||
227 | * we'll adjust them later. */ | ||
228 | bus->resource[0]->end = 64*1024 - 1 ; | ||
229 | bus->resource[1]->end = xPCIBIOS_MIN_MEM+(256*1024*1024)-1; | ||
230 | bus->resource[0]->start = xPCIBIOS_MIN_IO; | ||
231 | bus->resource[1]->start = xPCIBIOS_MIN_MEM; | ||
232 | |||
233 | /* Turn off downstream PF memory address range by default */ | ||
234 | bus->resource[2]->start = 1024*1024; | ||
235 | bus->resource[2]->end = bus->resource[2]->start - 1; | ||
236 | } | ||
237 | } | 222 | } |
223 | arch_initcall(sh5pci_init); | ||