From: Marek Vasut Date: Fri, 10 Sep 2021 20:47:15 +0000 (+0200) Subject: lmb: riscv: Add arch_lmb_reserve() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=eeaa3fe65270758ab0bdb1515e14f9bf936d3a25;p=u-boot.git lmb: riscv: 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 Signed-off-by: Marek Vasut Cc: Atish Patra Cc: Leo Cc: Rick Chen Cc: Simon Goldschmidt Cc: Tom Rini --- diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 8dd1820540..ff1bdf7131 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -135,3 +135,16 @@ int do_bootm_vxworks(int flag, int argc, char *const argv[], { return do_bootm_linux(flag, argc, argv, images); } + +static ulong get_sp(void) +{ + ulong ret; + + asm("mv %0, sp" : "=r"(ret) : ); + return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ + arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096); +}