aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/coldfire/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/coldfire/pci.c')
-rw-r--r--arch/m68k/coldfire/pci.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/arch/m68k/coldfire/pci.c b/arch/m68k/coldfire/pci.c
index 6a640be48568..3097fa2ca746 100644
--- a/arch/m68k/coldfire/pci.c
+++ b/arch/m68k/coldfire/pci.c
@@ -243,6 +243,13 @@ static struct resource mcf_pci_io = {
243 .flags = IORESOURCE_IO, 243 .flags = IORESOURCE_IO,
244}; 244};
245 245
246static struct resource busn_resource = {
247 .name = "PCI busn",
248 .start = 0,
249 .end = 255,
250 .flags = IORESOURCE_BUS,
251};
252
246/* 253/*
247 * Interrupt mapping and setting. 254 * Interrupt mapping and setting.
248 */ 255 */
@@ -258,6 +265,13 @@ static int mcf_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
258 265
259static int __init mcf_pci_init(void) 266static int __init mcf_pci_init(void)
260{ 267{
268 struct pci_host_bridge *bridge;
269 int ret;
270
271 bridge = pci_alloc_host_bridge(0);
272 if (!bridge)
273 return -ENOMEM;
274
261 pr_info("ColdFire: PCI bus initialization...\n"); 275 pr_info("ColdFire: PCI bus initialization...\n");
262 276
263 /* Reset the external PCI bus */ 277 /* Reset the external PCI bus */
@@ -312,14 +326,28 @@ static int __init mcf_pci_init(void)
312 set_current_state(TASK_UNINTERRUPTIBLE); 326 set_current_state(TASK_UNINTERRUPTIBLE);
313 schedule_timeout(msecs_to_jiffies(200)); 327 schedule_timeout(msecs_to_jiffies(200));
314 328
315 rootbus = pci_scan_bus(0, &mcf_pci_ops, NULL); 329
316 if (!rootbus) 330 pci_add_resource(&bridge->windows, &ioport_resource);
317 return -ENODEV; 331 pci_add_resource(&bridge->windows, &iomem_resource);
332 pci_add_resource(&bridge->windows, &busn_resource);
333 bridge->dev.parent = NULL;
334 bridge->sysdata = NULL;
335 bridge->busnr = 0;
336 bridge->ops = &mcf_pci_ops;
337 bridge->swizzle_irq = pci_common_swizzle;
338 bridge->map_irq = mcf_pci_map_irq;
339
340 ret = pci_scan_root_bus_bridge(bridge);
341 if (ret) {
342 pci_free_host_bridge(bridge);
343 return ret;
344 }
345
346 rootbus = bridge->bus;
318 347
319 rootbus->resource[0] = &mcf_pci_io; 348 rootbus->resource[0] = &mcf_pci_io;
320 rootbus->resource[1] = &mcf_pci_mem; 349 rootbus->resource[1] = &mcf_pci_mem;
321 350
322 pci_fixup_irqs(pci_common_swizzle, mcf_pci_map_irq);
323 pci_bus_size_bridges(rootbus); 351 pci_bus_size_bridges(rootbus);
324 pci_bus_assign_resources(rootbus); 352 pci_bus_assign_resources(rootbus);
325 pci_bus_add_devices(rootbus); 353 pci_bus_add_devices(rootbus);