diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-02-08 00:37:03 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-08 03:52:40 -0500 |
commit | 0e0b47abb71a2c4aed5895c01f41827dbd8a981c (patch) | |
tree | 03b8d844cab362388ecaf28431dac83dc350d6fa /arch/powerpc | |
parent | ccd05d086f82dba2ab117dcaf4a38cbb2863a439 (diff) |
[POWERPC] Don't enable cell IOMMU fixed mapping if there are no dma-ranges
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>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/iommu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index a276064471b3..1f7b25474086 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -917,6 +917,18 @@ static int __init cell_iommu_fixed_mapping_init(void) | |||
917 | return -1; | 917 | return -1; |
918 | } | 918 | } |
919 | 919 | ||
920 | /* We must have dma-ranges properties for fixed mapping to work */ | ||
921 | for (np = NULL; (np = of_find_all_nodes(np));) { | ||
922 | if (of_find_property(np, "dma-ranges", NULL)) | ||
923 | break; | ||
924 | } | ||
925 | of_node_put(np); | ||
926 | |||
927 | if (!np) { | ||
928 | pr_debug("iommu: no dma-ranges found, no fixed mapping\n"); | ||
929 | return -1; | ||
930 | } | ||
931 | |||
920 | /* The default setup is to have the fixed mapping sit after the | 932 | /* The default setup is to have the fixed mapping sit after the |
921 | * dynamic region, so find the top of the largest IOMMU window | 933 | * dynamic region, so find the top of the largest IOMMU window |
922 | * on any axon, then add the size of RAM and that's our max value. | 934 | * on any axon, then add the size of RAM and that's our max value. |