From 1e0e5577742baece8cc3aac3cf3da61a6b3276b0 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 10 Sep 2021 22:47:16 +0200 Subject: [PATCH] lmb: sh: Add arch_lmb_reserve() 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 Cc: Simon Goldschmidt Cc: Tom Rini --- arch/sh/lib/bootm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c index dc94f83785..9b71424dfe 100644 --- a/arch/sh/lib/bootm.c +++ b/arch/sh/lib/bootm.c @@ -12,8 +12,11 @@ #include #include #include +#include #include +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); +} -- 2.39.5