]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] powerpc: Detect prefetchable windows in pci_process_bridge_OF_ranges
authorKumar Gala <galak@gate.crashing.org>
Tue, 13 Dec 2005 20:46:29 +0000 (14:46 -0600)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 03:54:06 +0000 (14:54 +1100)
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: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/kernel/pci.c

index af364003880be26f331f9efce77806a20237691e..8de320308e87664f4c420d948eeb16640c61aefd 100644 (file)
@@ -941,7 +941,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
        while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
                res = NULL;
                size = ranges[na+4];
-               switch (ranges[0] >> 24) {
+               switch ((ranges[0] >> 24) & 0x3) {
                case 1:         /* I/O space */
                        if (ranges[2] != 0)
                                break;
@@ -955,6 +955,8 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
                        res = &hose->io_resource;
                        res->flags = IORESOURCE_IO;
                        res->start = ranges[2];
+                       DBG("PCI: IO 0x%lx -> 0x%lx\n",
+                                   res->start, res->start + size - 1);
                        break;
                case 2:         /* memory space */
                        memno = 0;
@@ -972,7 +974,11 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
                        if (memno < 3) {
                                res = &hose->mem_resources[memno];
                                res->flags = IORESOURCE_MEM;
+                               if(ranges[0] & 0x40000000)
+                                       res->flags |= IORESOURCE_PREFETCH;
                                res->start = ranges[na+2];
+                               DBG("PCI: MEM[%d] 0x%lx -> 0x%lx\n", memno,
+                                           res->start, res->start + size - 1);
                        }
                        break;
                }