diff options
| author | Marek Vasut <[email protected]> | 2021-09-10 22:47:15 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-09-23 14:15:32 -0400 |
| commit | eeaa3fe65270758ab0bdb1515e14f9bf936d3a25 (patch) | |
| tree | 031030453080465ee7bd67079fa49ebdb6e7afe0 | |
| parent | 6a0890a61e10d5f8b71e99c7d732bd65cebe31b4 (diff) | |
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 <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Cc: Atish Patra <[email protected]>
Cc: Leo <[email protected]>
Cc: Rick Chen <[email protected]>
Cc: Simon Goldschmidt <[email protected]>
Cc: Tom Rini <[email protected]>
| -rw-r--r-- | arch/riscv/lib/bootm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 8dd18205403..ff1bdf71318 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); +} |
