[PATCH] pgdat allocation for new node add (specify node id)
[powerpc.git] / arch / powerpc / sysdev / dart_iommu.c
index 61d3174..6232091 100644 (file)
@@ -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. */