diff options
author | David Howells <dhowells@redhat.com> | 2009-04-21 15:24:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 16:41:50 -0400 |
commit | 77e38a554aae2c3cdbf852117bc09bac6f95dae1 (patch) | |
tree | 813625300e07dd77623ed28dc2df43488ee59dbc /arch/frv | |
parent | 6d029b645175ae71fdeedea84b246ecb1362d003 (diff) |
frv: insert PCI root bus resources for the MB93090 devel motherboard
Insert PCI root bus resources for the FRV-based MB93090 development kit
motherboard. This is required because the CPU's window onto the PCI bus
address space is considerably smaller than the CPU's full address space
and non-PCI devices lie outside of the PCI window that we might want to
access.
Without this patch, the PCI root bus uses the platform-level bus
resources, and these are then confined to the PCI window, thus making
platform_device_add() reject devices outside of this window.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/frv')
-rw-r--r-- | arch/frv/mb93090-mb00/pci-vdk.c | 63 |
1 files changed, 50 insertions, 13 deletions
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index 0f41c3a72da5..c0dcec65c6b7 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c | |||
@@ -31,6 +31,29 @@ struct pci_bus *__nongpreldata pci_root_bus; | |||
31 | struct pci_ops *__nongpreldata pci_root_ops; | 31 | struct pci_ops *__nongpreldata pci_root_ops; |
32 | 32 | ||
33 | /* | 33 | /* |
34 | * The accessible PCI window does not cover the entire CPU address space, but | ||
35 | * there are devices we want to access outside of that window, so we need to | ||
36 | * insert specific PCI bus resources instead of using the platform-level bus | ||
37 | * resources directly for the PCI root bus. | ||
38 | * | ||
39 | * These are configured and inserted by pcibios_init() and are attached to the | ||
40 | * root bus by pcibios_fixup_bus(). | ||
41 | */ | ||
42 | static struct resource pci_ioport_resource = { | ||
43 | .name = "PCI IO", | ||
44 | .start = 0, | ||
45 | .end = IO_SPACE_LIMIT, | ||
46 | .flags = IORESOURCE_IO, | ||
47 | }; | ||
48 | |||
49 | static struct resource pci_iomem_resource = { | ||
50 | .name = "PCI mem", | ||
51 | .start = 0, | ||
52 | .end = -1, | ||
53 | .flags = IORESOURCE_MEM, | ||
54 | }; | ||
55 | |||
56 | /* | ||
34 | * Functions for accessing PCI configuration space | 57 | * Functions for accessing PCI configuration space |
35 | */ | 58 | */ |
36 | 59 | ||
@@ -304,6 +327,12 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) | |||
304 | #if 0 | 327 | #if 0 |
305 | printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); | 328 | printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); |
306 | #endif | 329 | #endif |
330 | |||
331 | if (bus->number == 0) { | ||
332 | bus->resource[0] = &pci_ioport_resource; | ||
333 | bus->resource[1] = &pci_iomem_resource; | ||
334 | } | ||
335 | |||
307 | pci_read_bridge_bases(bus); | 336 | pci_read_bridge_bases(bus); |
308 | 337 | ||
309 | if (bus->number == 0) { | 338 | if (bus->number == 0) { |
@@ -350,28 +379,36 @@ int __init pcibios_init(void) | |||
350 | /* enable PCI arbitration */ | 379 | /* enable PCI arbitration */ |
351 | __reg_MB86943_pci_arbiter = MB86943_PCIARB_EN; | 380 | __reg_MB86943_pci_arbiter = MB86943_PCIARB_EN; |
352 | 381 | ||
353 | ioport_resource.start = (__reg_MB86943_sl_pci_io_base << 9) & 0xfffffc00; | 382 | pci_ioport_resource.start = (__reg_MB86943_sl_pci_io_base << 9) & 0xfffffc00; |
354 | ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff; | 383 | pci_ioport_resource.end = (__reg_MB86943_sl_pci_io_range << 9) | 0x3ff; |
355 | ioport_resource.end += ioport_resource.start; | 384 | pci_ioport_resource.end += pci_ioport_resource.start; |
356 | 385 | ||
357 | printk("PCI IO window: %08llx-%08llx\n", | 386 | printk("PCI IO window: %08llx-%08llx\n", |
358 | (unsigned long long) ioport_resource.start, | 387 | (unsigned long long) pci_ioport_resource.start, |
359 | (unsigned long long) ioport_resource.end); | 388 | (unsigned long long) pci_ioport_resource.end); |
360 | 389 | ||
361 | iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00; | 390 | pci_iomem_resource.start = (__reg_MB86943_sl_pci_mem_base << 9) & 0xfffffc00; |
391 | pci_iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff; | ||
392 | pci_iomem_resource.end += pci_iomem_resource.start; | ||
362 | 393 | ||
363 | /* Reserve somewhere to write to flush posted writes. */ | 394 | /* Reserve somewhere to write to flush posted writes. This is used by |
364 | iomem_resource.start += 0x400; | 395 | * __flush_PCI_writes() from asm/io.h to force the write FIFO in the |
365 | 396 | * CPU-PCI bridge to flush as this doesn't happen automatically when a | |
366 | iomem_resource.end = (__reg_MB86943_sl_pci_mem_range << 9) | 0x3ff; | 397 | * read is performed on the MB93090 development kit motherboard. |
367 | iomem_resource.end += iomem_resource.start; | 398 | */ |
399 | pci_iomem_resource.start += 0x400; | ||
368 | 400 | ||
369 | printk("PCI MEM window: %08llx-%08llx\n", | 401 | printk("PCI MEM window: %08llx-%08llx\n", |
370 | (unsigned long long) iomem_resource.start, | 402 | (unsigned long long) pci_iomem_resource.start, |
371 | (unsigned long long) iomem_resource.end); | 403 | (unsigned long long) pci_iomem_resource.end); |
372 | printk("PCI DMA memory: %08lx-%08lx\n", | 404 | printk("PCI DMA memory: %08lx-%08lx\n", |
373 | dma_coherent_mem_start, dma_coherent_mem_end); | 405 | dma_coherent_mem_start, dma_coherent_mem_end); |
374 | 406 | ||
407 | if (insert_resource(&iomem_resource, &pci_iomem_resource) < 0) | ||
408 | panic("Unable to insert PCI IOMEM resource\n"); | ||
409 | if (insert_resource(&ioport_resource, &pci_ioport_resource) < 0) | ||
410 | panic("Unable to insert PCI IOPORT resource\n"); | ||
411 | |||
375 | if (!pci_probe) | 412 | if (!pci_probe) |
376 | return -ENXIO; | 413 | return -ENXIO; |
377 | 414 | ||