[RFC PATCH 07/31] lmb: remove lmb_init_and_reserve_range() function

Ilias Apalodimas ilias.apalodimas at linaro.org
Mon Jun 10 23:42:18 CEST 2024


On Sat, Jun 08, 2024 at 12:22:16AM +0530, Sughosh Ganu wrote:
> With the move to make the LMB allocations persistent and the common
> memory regions being reserved during board init, the
> lmb_init_and_reserve_range() API can be replaced with a simple
> lmb_add() call.
> 
> Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> ---
>  boot/bootm.c  | 2 +-
>  include/lmb.h | 2 --
>  lib/lmb.c     | 8 --------
>  3 files changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/boot/bootm.c b/boot/bootm.c
> index cd1003120c..73e72a710d 100644
> --- a/boot/bootm.c
> +++ b/boot/bootm.c
> @@ -248,7 +248,7 @@ static void boot_start_lmb(void)
>  	mem_start = env_get_bootm_low();
>  	mem_size = env_get_bootm_size();
>  
> -	lmb_init_and_reserve_range(mem_start, mem_size, NULL);
> +	lmb_add(mem_start, mem_size);
>  }
>  #else
>  #define lmb_reserve(base, size)
> diff --git a/include/lmb.h b/include/lmb.h
> index d2b829ace1..f3e3f716e5 100644
> --- a/include/lmb.h
> +++ b/include/lmb.h
> @@ -85,8 +85,6 @@ struct lmb {
>  };
>  
>  void lmb_init_and_reserve(struct bd_info *bd, void *fdt_blob);
> -void lmb_init_and_reserve_range(phys_addr_t base, phys_size_t size,
> -				void *fdt_blob);
>  long lmb_add(phys_addr_t base, phys_size_t size);
>  long lmb_reserve(phys_addr_t base, phys_size_t size);
>  /**
> diff --git a/lib/lmb.c b/lib/lmb.c
> index 8003aae6f7..5c056800c3 100644
> --- a/lib/lmb.c
> +++ b/lib/lmb.c
> @@ -253,14 +253,6 @@ void lmb_init_and_reserve(struct bd_info *bd, void *fdt_blob)
>  	lmb_reserve_common(fdt_blob);
>  }
>  
> -/* 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);
> -}
> -
>  /* This routine called with relocation disabled. */
>  static long lmb_add_region_flags(struct lmb_region *rgn, phys_addr_t base,
>  				 phys_size_t size, enum lmb_flags flags)
> -- 
> 2.34.1
> 
Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>



More information about the U-Boot mailing list