diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-03-26 08:53:53 -0500 |
---|---|---|
committer | Andrew Fleming-AFLEMING <afleming@freescale.com> | 2008-03-26 11:43:04 -0500 |
commit | dd6c910aadf27c822f17b87eae1a9bd0b2e3aa15 (patch) | |
tree | 0c7243c172651c02b969d370d7364201d88a428e | |
parent | 79679d80021ab095e639e250ca472fe526da02e2 (diff) | |
download | u-boot-imx-dd6c910aadf27c822f17b87eae1a9bd0b2e3aa15.zip u-boot-imx-dd6c910aadf27c822f17b87eae1a9bd0b2e3aa15.tar.gz u-boot-imx-dd6c910aadf27c822f17b87eae1a9bd0b2e3aa15.tar.bz2 |
85xx: Add cpu_mp_lmb_reserve helper to reserve boot page
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>
-rw-r--r-- | cpu/mpc85xx/mp.c | 14 | ||||
-rw-r--r-- | cpu/mpc85xx/mp.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c index d3727b0..7b10fba 100644 --- a/cpu/mpc85xx/mp.c +++ b/cpu/mpc85xx/mp.c @@ -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; diff --git a/cpu/mpc85xx/mp.h b/cpu/mpc85xx/mp.h index b762ee2..4329286 100644 --- a/cpu/mpc85xx/mp.h +++ b/cpu/mpc85xx/mp.h @@ -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 |