Merge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into...
[pandora-kernel.git] / arch / mips / mips-boards / generic / memory.c
index bc4d093..c89fcf9 100644 (file)
@@ -18,7 +18,6 @@
  * PROM library functions for acquiring/using memory descriptors given to
  * us from the YAMON.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
@@ -76,6 +75,15 @@ struct prom_pmemblock * __init prom_getmdesc(void)
                        memsize = simple_strtol(memsize_str, NULL, 0);
                }
        }
+
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       /*
+        * SOC-it swaps, or perhaps doesn't swap, when DMA'ing the last
+        * word of physical memory
+        */
+       memsize -= PAGE_SIZE;
+#endif
+
        memset(mdesc, 0, sizeof(mdesc));
 
        mdesc[0].type = yamon_dontuse;