Skip to content

Commit

Permalink
lmb: riscv: Add arch_lmb_reserve()
Browse files Browse the repository at this point in the history
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 <rick@andestech.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Atish Patra <atish.patra@wdc.com>
Cc: Leo <ycliang@andestech.com>
Cc: Rick Chen <rick@andestech.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
  • Loading branch information
marex authored and trini committed Sep 23, 2021
1 parent 6a0890a commit eeaa3fe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/riscv/lib/bootm.c
Expand Up @@ -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);
}

0 comments on commit eeaa3fe

Please sign in to comment.