]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Don't enable cell IOMMU fixed mapping if there are no dma-ranges
authorMichael Ellerman <michael@ellerman.id.au>
Fri, 8 Feb 2008 05:37:03 +0000 (16:37 +1100)
committerPaul Mackerras <paulus@samba.org>
Fri, 8 Feb 2008 08:52:40 +0000 (19:52 +1100)
In order for the cell IOMMU fixed mapping to work we need "dma-ranges"
properties in the device tree. If there are none then there's no point
enabling the fixed mapping support.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/iommu.c

index a276064471b3a0a9449d6cdedc408073415d635c..1f7b254740862418b930c9d06bbf9dd02a3f7e7e 100644 (file)
@@ -917,6 +917,18 @@ static int __init cell_iommu_fixed_mapping_init(void)
                return -1;
        }
 
+       /* We must have dma-ranges properties for fixed mapping to work */
+       for (np = NULL; (np = of_find_all_nodes(np));) {
+               if (of_find_property(np, "dma-ranges", NULL))
+                       break;
+       }
+       of_node_put(np);
+
+       if (!np) {
+               pr_debug("iommu: no dma-ranges found, no fixed mapping\n");
+               return -1;
+       }
+
        /* The default setup is to have the fixed mapping sit after the
         * dynamic region, so find the top of the largest IOMMU window
         * on any axon, then add the size of RAM and that's our max value.