]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lmb: nds32: Add arch_lmb_reserve()
authorMarek Vasut <marek.vasut@gmail.com>
Fri, 10 Sep 2021 20:47:14 +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().
It is rather likely this architecture also needs to cover U-Boot with
LMB before booting Linux.

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

index 4cb0f530ae1a2178c47e83aaa5907031be377720..a7c8978f23114f47fe0cfdc5af9caaf42a4a12ed 100644 (file)
@@ -245,3 +245,16 @@ static void setup_end_tag(struct bd_info *bd)
 }
 
 #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
+
+static ulong get_sp(void)
+{
+       ulong ret;
+
+       asm("move %0, $sp" : "=r"(ret) : );
+       return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+       arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
+}