diff options
author | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2013-05-09 17:10:06 +0200 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2013-08-13 11:58:48 +0200 |
commit | f66cc1e34842da7ed23de23a5c5cd7a8f1305326 (patch) | |
tree | 4ca13bebb7d33f687a46f980faa9cae8ac267d43 /arch/mips/lib | |
parent | c4b37847d3f8f98335253bd0e7aeee3ba141b237 (diff) | |
download | u-boot-imx-f66cc1e34842da7ed23de23a5c5cd7a8f1305326.zip u-boot-imx-f66cc1e34842da7ed23de23a5c5cd7a8f1305326.tar.gz u-boot-imx-f66cc1e34842da7ed23de23a5c5cd7a8f1305326.tar.bz2 |
MIPS: bootm: add support for LMB
This is required for init ramdisk relocation and device tree
support.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'arch/mips/lib')
-rw-r--r-- | arch/mips/lib/bootm.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 692f7dc..59ed632 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -27,6 +27,27 @@ static int linux_env_idx; static void linux_params_init(ulong start, char *commandline); static void linux_env_set(char *env_name, char *env_val); +static ulong arch_get_sp(void) +{ + ulong ret; + + __asm__ __volatile__("move %0, $sp" : "=r"(ret) : ); + + return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ + ulong sp; + + sp = arch_get_sp(); + debug("## Current stack ends at 0x%08lx\n", sp); + + /* adjust sp by 4K to be safe */ + sp -= 4096; + lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp); +} + static void boot_prep_linux(bootm_headers_t *images) { char *commandline = getenv("bootargs"); |