diff mbox series

[20/40] lmb: remove lmb_init_and_reserve_range() function

Message ID 20240724060224.3071065-21-sughosh.ganu@linaro.org
State New
Headers show
Series Make LMB memory map global and persistent | expand

Commit Message

Sughosh Ganu July 24, 2024, 6:02 a.m. UTC
With the move to make the LMB allocations persistent and the common
memory regions being reserved during board init, there is no need for
an explicit reservation of a memory range. Remove the
lmb_init_and_reserve_range() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
Changes since rfc: None

 boot/bootm.c  | 15 +--------------
 include/lmb.h |  3 ---
 lib/lmb.c     |  8 --------
 3 files changed, 1 insertion(+), 25 deletions(-)

Comments

Simon Glass July 25, 2024, 11:32 p.m. UTC | #1
On Wed, 24 Jul 2024 at 00:04, Sughosh Ganu <sughosh.ganu@linaro.org> wrote:
>
> With the move to make the LMB allocations persistent and the common
> memory regions being reserved during board init, there is no need for
> an explicit reservation of a memory range. Remove the
> lmb_init_and_reserve_range() function.
>
> Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
> Changes since rfc: None
>
>  boot/bootm.c  | 15 +--------------
>  include/lmb.h |  3 ---
>  lib/lmb.c     |  8 --------
>  3 files changed, 1 insertion(+), 25 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/boot/bootm.c b/boot/bootm.c
index 5ce84b73b5..d44fd2ed87 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -239,18 +239,7 @@  static int boot_get_kernel(const char *addr_fit, struct bootm_headers *images,
 	return 0;
 }
 
-#if CONFIG_IS_ENABLED(LMB)
-static void boot_start_lmb(void)
-{
-	phys_addr_t	mem_start;
-	phys_size_t	mem_size;
-
-	mem_start = env_get_bootm_low();
-	mem_size = env_get_bootm_size();
-
-	lmb_init_and_reserve_range(mem_start, mem_size, NULL);
-}
-#else
+#if !CONFIG_IS_ENABLED(LMB)
 #define lmb_reserve(base, size)
 static inline void boot_start_lmb(void) { }
 #endif
@@ -260,8 +249,6 @@  static int bootm_start(void)
 	memset((void *)&images, 0, sizeof(images));
 	images.verify = env_get_yesno("verify");
 
-	boot_start_lmb();
-
 	bootstage_mark_name(BOOTSTAGE_ID_BOOTM_START, "bootm_start");
 	images.state = BOOTM_STATE_START;
 
diff --git a/include/lmb.h b/include/lmb.h
index 50977e6561..2d8f9a6b71 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -37,9 +37,6 @@  struct lmb_region {
 	enum lmb_flags flags;
 };
 
-void lmb_init_and_reserve_range(phys_addr_t base, phys_size_t size,
-				void *fdt_blob);
-
 /**
  * lmb_add_memory() - Add memory range for LMB allocations
  *
diff --git a/lib/lmb.c b/lib/lmb.c
index ce1b0204c9..5afdfc32fb 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -292,14 +292,6 @@  __weak void lmb_add_memory(void)
 	}
 }
 
-/* Initialize the struct, add memory and call arch/board reserve functions */
-void lmb_init_and_reserve_range(phys_addr_t base, phys_size_t size,
-				void *fdt_blob)
-{
-	lmb_add(base, size);
-	lmb_reserve_common(fdt_blob);
-}
-
 static bool lmb_region_flags_match(struct lmb_region *rgn, unsigned long r1,
 				   enum lmb_flags flags)
 {