summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2021-09-10 22:47:13 +0200
committerTom Rini <trini@konsulko.com>2021-09-23 14:15:32 -0400
commita02c18f31f8b99418be8b17135c7a10910dc10e8 (patch)
tree8ece1adf871d2079d52d290136065190926982cd
parentc16de86ec0ac7dc208cd397eeb3f6bdf4406aad7 (diff)
downloadu-boot-a02c18f31f8b99418be8b17135c7a10910dc10e8.tar.gz
lmb: nios2: 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. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Thomas Chou <thomas@wytron.com.tw> Cc: Tom Rini <trini@konsulko.com>
-rw-r--r--arch/nios2/lib/bootm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c
index 5037467151..3cb59bd977 100644
--- a/arch/nios2/lib/bootm.c
+++ b/arch/nios2/lib/bootm.c
@@ -10,6 +10,9 @@
#include <image.h>
#include <irq_func.h>
#include <log.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */
@@ -60,3 +63,16 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
return 1;
}
+
+static ulong get_sp(void)
+{
+ ulong ret;
+
+ asm("mov %0, sp" : "=r"(ret) : );
+ return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+ arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
+}