summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2021-09-10 22:47:14 +0200
committerTom Rini <[email protected]>2021-09-23 14:15:32 -0400
commit6a0890a61e10d5f8b71e99c7d732bd65cebe31b4 (patch)
tree166ccc0c4b8b806d8aee7d202716d92dc749f9aa
parenta02c18f31f8b99418be8b17135c7a10910dc10e8 (diff)
lmb: nds32: Add arch_lmb_reserve()
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 <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Cc: Rick Chen <[email protected]> Cc: Simon Goldschmidt <[email protected]> Cc: Tom Rini <[email protected]>
-rw-r--r--arch/nds32/lib/bootm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c
index 4cb0f530ae1..a7c8978f231 100644
--- a/arch/nds32/lib/bootm.c
+++ b/arch/nds32/lib/bootm.c
@@ -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);
+}