Commit cd0c7f06 authored by Kumar Gala's avatar Kumar Gala Committed by Paul Mackerras

[PATCH] powerpc: Detect prefetchable windows in pci_process_bridge_OF_ranges

Added the ability to determine if an outbound window in the PCI host
controller is for prefetchable memory and report it as such.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 31087d7d
...@@ -941,7 +941,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -941,7 +941,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) { while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
res = NULL; res = NULL;
size = ranges[na+4]; size = ranges[na+4];
switch (ranges[0] >> 24) { switch ((ranges[0] >> 24) & 0x3) {
case 1: /* I/O space */ case 1: /* I/O space */
if (ranges[2] != 0) if (ranges[2] != 0)
break; break;
...@@ -955,6 +955,8 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -955,6 +955,8 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
res = &hose->io_resource; res = &hose->io_resource;
res->flags = IORESOURCE_IO; res->flags = IORESOURCE_IO;
res->start = ranges[2]; res->start = ranges[2];
DBG("PCI: IO 0x%lx -> 0x%lx\n",
res->start, res->start + size - 1);
break; break;
case 2: /* memory space */ case 2: /* memory space */
memno = 0; memno = 0;
...@@ -972,7 +974,11 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose, ...@@ -972,7 +974,11 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
if (memno < 3) { if (memno < 3) {
res = &hose->mem_resources[memno]; res = &hose->mem_resources[memno];
res->flags = IORESOURCE_MEM; res->flags = IORESOURCE_MEM;
if(ranges[0] & 0x40000000)
res->flags |= IORESOURCE_PREFETCH;
res->start = ranges[na+2]; res->start = ranges[na+2];
DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
res->start, res->start + size - 1);
} }
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment