]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MIPS: bootm: add support for LMB
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Thu, 9 May 2013 15:10:06 +0000 (17:10 +0200)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tue, 13 Aug 2013 09:58:48 +0000 (11:58 +0200)
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>
arch/mips/include/asm/config.h
arch/mips/lib/bootm.c

index cd29734789449b2cd0a0a006a821af9cf897e0d1..6eb1cee2d8dd9e5a52b41ab1cc6190de7b9a1e43 100644 (file)
@@ -7,4 +7,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
index 692f7dc6ca2dce8e0c4637ae2c11277765e08dbe..59ed632b42ef68b63fdebcbdc37cad04d7724238 100644 (file)
@@ -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");