summaryrefslogtreecommitdiff
path: root/arch/x86/lib/bootm.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2021-09-10 23:47:18 +0300
committerTom Rini <trini@konsulko.com>2021-09-23 21:15:32 +0300
commita69753f31d5863c692522f0b92db6e9cad06d553 (patch)
treea0bdd68216d13d93aa02dd47851f69a0f545ffab /arch/x86/lib/bootm.c
parent7996b7e9f5826d172b820cea0d072e68cfe485ba (diff)
downloadu-boot-a69753f31d5863c692522f0b92db6e9cad06d553.tar.xz
lmb: x86: 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 Glass <sjg@chromium.org> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/x86/lib/bootm.c')
-rw-r--r--arch/x86/lib/bootm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 733dd71257..667e5e689e 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -223,3 +223,21 @@ int do_bootm_linux(int flag, int argc, char *const argv[],
return boot_jump_linux(images);
}
+
+static ulong get_sp(void)
+{
+ ulong ret;
+
+#if CONFIG_IS_ENABLED(X86_64)
+ ret = gd->start_addr_sp;
+#else
+ asm("mov %%esp, %0" : "=r"(ret) : );
+#endif
+
+ return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+ arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
+}