]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
85xx: Add cpu_mp_lmb_reserve helper to reserve boot page
authorKumar Gala <galak@kernel.crashing.org>
Wed, 26 Mar 2008 13:53:53 +0000 (08:53 -0500)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Wed, 26 Mar 2008 16:43:04 +0000 (11:43 -0500)
Provide a board_lmb_reserve helper function to ensure we reserve
the page of memory we are using for the boot page translation code.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
cpu/mpc85xx/mp.c
cpu/mpc85xx/mp.h

index d3727b0b2c03f2c5ab8819a944b5a0d1d4f8747f..7b10fba0a64413e906aa02f69227db20585f1986 100644 (file)
@@ -23,6 +23,7 @@
 #include <common.h>
 #include <asm/processor.h>
 #include <ioports.h>
+#include <lmb.h>
 #include <asm/io.h>
 #include "mp.h"
 
@@ -177,6 +178,19 @@ static void pq3_mp_up(unsigned long bootpg)
        out_be32(&gur->devdisr, devdisr);
 }
 
+void cpu_mp_lmb_reserve(struct lmb *lmb)
+{
+       u32 bootpg;
+
+       /* if we have 4G or more of memory, put the boot page at 4Gb-4k */
+       if ((u64)gd->ram_size > 0xfffff000)
+               bootpg = 0xfffff000;
+       else
+               bootpg = gd->ram_size - 4096;
+
+       lmb_reserve(lmb, bootpg, 4096);
+}
+
 void setup_mp(void)
 {
        extern ulong __secondary_start_page;
index b762ee2d76cc27c0672403935a61c41188212025..4329286f1fd8a4986db71b29fb61f2b449064d5b 100644 (file)
@@ -4,6 +4,7 @@
 ulong get_spin_addr(void);
 void setup_mp(void);
 u32 get_my_id(void);
+void cpu_mp_lmb_reserve(struct lmb *lmb);
 
 #define BOOT_ENTRY_ADDR_UPPER  0
 #define BOOT_ENTRY_ADDR_LOWER  1