[PATCH 13/14] lmb: Mark arch_lmb_reserve() as weak symbol

Marek Vasut marek.vasut at gmail.com
Sun Aug 15 20:13:13 CEST 2021


Mark arch_lmb_reserve() weak on architecture level, so it can be
overridden if necessary. This might be necessary if there is some
sort of architectural exception where e.g. more LMB areas have to
be reserved.

Note that sandbox now needs an empty implementation of
arch_lmb_reserve().

Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
Cc: Alexey Brodkin <alexey.brodkin at synopsys.com>
Cc: Angelo Dureghello <angelo at sysam.it>
Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
Cc: Hai Pham <hai.pham.ud at renesas.com>
Cc: Michal Simek <monstr at monstr.eu>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: Wolfgang Denk <wd at denx.de>
---
 arch/arc/lib/cache.c        | 2 +-
 arch/arm/lib/stack.c        | 2 +-
 arch/m68k/lib/bootm.c       | 2 +-
 arch/microblaze/lib/bootm.c | 2 +-
 arch/mips/lib/bootm.c       | 2 +-
 arch/powerpc/lib/bootm.c    | 2 +-
 arch/riscv/lib/bootm.c      | 2 +-
 arch/sandbox/lib/bootm.c    | 5 +++++
 arch/sh/lib/bootm.c         | 2 +-
 arch/x86/lib/bootm.c        | 2 +-
 arch/xtensa/lib/bootm.c     | 2 +-
 lib/lmb.c                   | 5 -----
 12 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index 4c696cb53a..23bca1fffc 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -830,7 +830,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/arm/lib/stack.c b/arch/arm/lib/stack.c
index 52d9f15298..93a69a1688 100644
--- a/arch/arm/lib/stack.c
+++ b/arch/arm/lib/stack.c
@@ -43,7 +43,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c
index 27729db67e..fb4784187a 100644
--- a/arch/m68k/lib/bootm.c
+++ b/arch/m68k/lib/bootm.c
@@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static ulong get_sp (void);
 static void set_clocks_in_mhz (struct bd_info *kbd);
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 1024);
 }
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index 3a6da6e29f..2621770082 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -32,7 +32,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index cab8da4860..57873f200b 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -37,7 +37,7 @@ static ulong arch_get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, arch_get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index 8d65047aa4..482bacdfe6 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -116,7 +116,7 @@ static void boot_jump_linux(bootm_headers_t *images)
 	return ;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	phys_size_t bootm_size;
 	ulong size, bootmap_base;
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index ff1bdf7131..377c77b909 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -144,7 +144,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c
index d1d460b84a..17c02fc9f7 100644
--- a/arch/sandbox/lib/bootm.c
+++ b/arch/sandbox/lib/bootm.c
@@ -61,3 +61,8 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 
 	return 0;
 }
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+	/* do nothing */
+}
diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c
index 9b71424dfe..ec4a74b43c 100644
--- a/arch/sh/lib/bootm.c
+++ b/arch/sh/lib/bootm.c
@@ -123,7 +123,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 667e5e689e..b46411d93d 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -237,7 +237,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/arch/xtensa/lib/bootm.c b/arch/xtensa/lib/bootm.c
index 277af18168..a8ad62aa54 100644
--- a/arch/xtensa/lib/bootm.c
+++ b/arch/xtensa/lib/bootm.c
@@ -205,7 +205,7 @@ static ulong get_sp(void)
 	return ret;
 }
 
-void arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
 	arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
 }
diff --git a/lib/lmb.c b/lib/lmb.c
index fed3c341a7..00498944a0 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -504,8 +504,3 @@ __weak void board_lmb_reserve(struct lmb *lmb)
 {
 	/* please define platform specific board_lmb_reserve() */
 }
-
-__weak void arch_lmb_reserve(struct lmb *lmb)
-{
-	/* please define platform specific arch_lmb_reserve() */
-}
-- 
2.30.2



More information about the U-Boot mailing list