]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lmb: sh: Add arch_lmb_reserve()
authorMarek Vasut <marek.vasut@gmail.com>
Fri, 10 Sep 2021 20:47:16 +0000 (22:47 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 23 Sep 2021 18:15:32 +0000 (14:15 -0400)
Add arch_lmb_reserve() implemented using arch_lmb_reserve_generic().
This architecture also needs to cover U-Boot with LMB before booting
Linux.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
arch/sh/lib/bootm.c

index dc94f8378566e957db8e412887b06fe9c98641f4..9b71424dfe60a009db9b86bc78ace8ae13dd3def 100644 (file)
 #include <env.h>
 #include <image.h>
 #include <asm/byteorder.h>
+#include <asm/global_data.h>
 #include <asm/zimage.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CONFIG_SYS_DEBUG
 static void hexdump(unsigned char *buf, int len)
 {
@@ -111,3 +114,16 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
        /* does not return */
        return 1;
 }
+
+static ulong get_sp(void)
+{
+       ulong ret;
+
+       asm("mov r15, %0" : "=r"(ret) : );
+       return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+       arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
+}