Re: [PATCH 08/14] lmb: nds32: Add arch_lmb_reserve()

2021-09-01 Thread Rick Chen
> From: Marek Vasut 
> Sent: Monday, August 16, 2021 2:13 AM
> To: u-boot@lists.denx.de
> Cc: Marek Vasut ; Rick Jian-Zhi Chen(陳建志) 
> ; Simon Goldschmidt ; 
> Tom Rini 
> Subject: [PATCH 08/14] lmb: nds32: 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 
> Cc: Rick Chen 
> Cc: Simon Goldschmidt 
> Cc: Tom Rini 
> ---
>  arch/nds32/lib/bootm.c | 13 +
>  1 file changed, 13 insertions(+)

Reviewed-by: Rick Chen 


[PATCH 08/14] lmb: nds32: Add arch_lmb_reserve()

2021-08-15 Thread Marek Vasut
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 
Cc: Rick Chen 
Cc: Simon Goldschmidt 
Cc: Tom Rini 
---
 arch/nds32/lib/bootm.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/nds32/lib/bootm.c b/arch/nds32/lib/bootm.c
index 4cb0f530ae..a7c8978f23 100644
--- a/arch/nds32/lib/bootm.c
+++ b/arch/nds32/lib/bootm.c
@@ -245,3 +245,16 @@ static void setup_end_tag(struct bd_info *bd)
 }
 
 #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG 
*/
+
+static ulong get_sp(void)
+{
+   ulong ret;
+
+   asm("move %0, $sp" : "=r"(ret) : );
+   return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+   arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
+}
-- 
2.30.2