powerpc/mpc85xx: Reserve default boot page
authorYork Sun <[email protected]>
Fri, 14 Dec 2012 06:21:58 +0000 (06:21 +0000)
committerAndy Fleming <[email protected]>
Wed, 30 Jan 2013 17:25:08 +0000 (11:25 -0600)
The boot page in memory is already reserved so OS won't overwrite.
As long as the boot page translation is active, the default boot page
also needs to be reserved in case the memory is 4GB or more.

Signed-off-by: York Sun <[email protected]>
Signed-off-by: Andy Fleming <[email protected]>
arch/powerpc/cpu/mpc85xx/fdt.c

index ab0933076df9352b7ecb401686941c9cf7cbc1c1..16d7f6a222de99e6397867ac2ec6365ebdfee13d 100644 (file)
@@ -100,6 +100,22 @@ void ft_fixup_cpu(void *blob, u64 memory_limit)
                        printf("Failed to reserve memory for bootpg: %s\n",
                                fdt_strerror(off));
        }
+
+#ifndef CONFIG_MPC8xxx_DISABLE_BPTR
+       /*
+        * Reserve the default boot page so OSes dont use it.
+        * The default boot page is always mapped to bootpg above using
+        * boot page translation.
+        */
+       if (0xfffff000ull < memory_limit) {
+               off = fdt_add_mem_rsv(blob, 0xfffff000ull, (u64)4096);
+               if (off < 0) {
+                       printf("Failed to reserve memory for 0xfffff000: %s\n",
+                               fdt_strerror(off));
+               }
+       }
+#endif
+
        /* Reserve spin table page */
        if (spin_tbl_addr < memory_limit) {
                off = fdt_add_mem_rsv(blob,