Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied...
[linux-drm-fsl-dcu.git] / arch / powerpc / mm / init_32.c
index 7d4b8b5f06063cdf41e1fe56c06fe207974d22a8..5fce6ccecb8dee301d98e5ca97c7d9290a5540d9 100644 (file)
@@ -18,7 +18,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -116,6 +115,10 @@ void MMU_setup(void)
        if (strstr(cmd_line, "noltlbs")) {
                __map_without_ltlbs = 1;
        }
+#ifdef CONFIG_DEBUG_PAGEALLOC
+       __map_without_bats = 1;
+       __map_without_ltlbs = 1;
+#endif
 }
 
 /*
@@ -188,6 +191,11 @@ void __init MMU_init(void)
 
        if (ppc_md.progress)
                ppc_md.progress("MMU:exit", 0x211);
+
+       /* From now on, btext is no longer BAT mapped if it was at all */
+#ifdef CONFIG_BOOTX_TEXT
+       btext_unmap();
+#endif
 }
 
 /* This is only called until mem_init is done. */
@@ -211,7 +219,7 @@ static void free_sec(unsigned long start, unsigned long end, const char *name)
 
        while (start < end) {
                ClearPageReserved(virt_to_page(start));
-               set_page_count(virt_to_page(start), 1);
+               init_page_count(virt_to_page(start));
                free_page(start);
                cnt++;
                start += PAGE_SIZE;
@@ -243,7 +251,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
                printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
        for (; start < end; start += PAGE_SIZE) {
                ClearPageReserved(virt_to_page(start));
-               set_page_count(virt_to_page(start), 1);
+               init_page_count(virt_to_page(start));
                free_page(start);
                totalram_pages++;
        }