X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fsysdev%2Fdart_iommu.c;h=6232091cc72bcd87b8e6f69c9242257b770926e1;hb=bc02af93dd2bbddce1b55e0a493f833a1b7cf140;hp=61d317428610ab3d953211366d2e938284f0d72a;hpb=79072f38909e3d9883317238887460c39ddcc4cb;p=powerpc.git diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c index 61d3174286..6232091cc7 100644 --- a/arch/powerpc/sysdev/dart_iommu.c +++ b/arch/powerpc/sysdev/dart_iommu.c @@ -49,6 +49,7 @@ #include "dart.h" +extern int iommu_is_off; extern int iommu_force_on; /* Physical base address and size of the DART table */ @@ -245,7 +246,7 @@ static void iommu_table_dart_setup(void) iommu_table_dart.it_base = (unsigned long)dart_vbase; iommu_table_dart.it_index = 0; iommu_table_dart.it_blocksize = 1; - iommu_init_table(&iommu_table_dart); + iommu_init_table(&iommu_table_dart, -1); /* Reserve the last page of the DART to avoid possible prefetch * past the DART mapped area @@ -329,10 +330,17 @@ void iommu_init_early_dart(void) void __init alloc_dart_table(void) { - /* Only reserve DART space if machine has more than 2GB of RAM + /* Only reserve DART space if machine has more than 1GB of RAM * or if requested with iommu=on on cmdline. + * + * 1GB of RAM is picked as limit because some default devices + * (i.e. Airport Extreme) have 30 bit address range limits. */ - if (lmb_end_of_DRAM() <= 0x80000000ull && !iommu_force_on) + + if (iommu_is_off) + return; + + if (!iommu_force_on && lmb_end_of_DRAM() <= 0x40000000ull) return; /* 512 pages (2MB) is max DART tablesize. */