diff mbox series

[10/12] lmb: sh: Add arch_lmb_reserve()

Message ID 20210910204718.17765-10-marek.vasut+renesas@gmail.com
State Accepted
Commit 1e0e5577742baece8cc3aac3cf3da61a6b3276b0
Delegated to: Tom Rini
Headers show
Series [01/12] lmb: Always compile arch_lmb_reserve() into U-Boot on arm | expand

Commit Message

Marek Vasut Sept. 10, 2021, 8:47 p.m. UTC
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 <marek.vasut+renesas@gmail.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
---
V2: No change
---
 arch/sh/lib/bootm.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Tom Rini Sept. 24, 2021, 2:42 a.m. UTC | #1
On Fri, Sep 10, 2021 at 10:47:16PM +0200, Marek Vasut wrote:

> 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 <marek.vasut+renesas@gmail.com>
> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> Cc: Tom Rini <trini@konsulko.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

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 <env.h>
 #include <image.h>
 #include <asm/byteorder.h>
+#include <asm/global_data.h>
 #include <asm/zimage.h>
 
+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);
+}