lmb: remove the lmb_init_and_reserve() function

With the changes to make the LMB reservations persistent, the common
memory regions are being added during board init. Remove the
now superfluous lmb_init_and_reserve() function.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Sughosh Ganu 2024-08-26 17:29:25 +05:30 committed by Tom Rini
parent f4fb154f0a
commit c7ce26cb36
10 changed files with 0 additions and 29 deletions

View file

@ -775,8 +775,6 @@ int board_late_init(void)
{
u32 status = 0;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
/* somewhat based on the Linux Kernel boot requirements:
* align by 2M and maximal FDT size 2M
*/

View file

@ -282,8 +282,6 @@ int board_late_init(void)
{
u32 status = 0;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
/* We need to be fairly conservative here as we support boards with just 1G of TOTAL RAM */
status |= env_set_hex("kernel_addr_r", addr_alloc(SZ_128M));
status |= env_set_hex("ramdisk_addr_r", addr_alloc(SZ_128M));

View file

@ -141,9 +141,6 @@ int mach_cpu_init(void)
void enable_caches(void)
{
/* parse device tree when data cache is still activated */
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
/* I-cache is already enabled in start.S: icache_enable() not needed */
/* deactivate the data cache, early enabled in arch_cpu_init() */

View file

@ -162,7 +162,6 @@ static int bdinfo_print_all(struct bd_info *bd)
bdinfo_print_num_l("multi_dtb_fit", (ulong)gd->multi_dtb_fit);
#endif
if (IS_ENABLED(CONFIG_LMB) && gd->fdt_blob) {
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
lmb_dump_all_force();
if (IS_ENABLED(CONFIG_OF_REAL))
printf("devicetree = %s\n", fdtdec_get_srcname());

View file

@ -153,8 +153,6 @@ static ulong load_serial(long offset)
int line_count = 0;
long ret;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
while (read_record(record, SREC_MAXRECLEN + 1) >= 0) {
type = srec_decode(record, &binlen, &addr, binbuf);

View file

@ -549,7 +549,6 @@ static int fs_read_lmb_check(const char *filename, ulong addr, loff_t offset,
if (len && len < read_len)
read_len = len;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
lmb_dump_all();
if (lmb_alloc_addr(addr, read_len) == addr)

View file

@ -63,7 +63,6 @@ struct lmb {
*/
int lmb_init(void);
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);

View file

@ -227,19 +227,6 @@ static void lmb_reserve_common(void *fdt_blob)
efi_lmb_reserve();
}
/* Initialize the struct, add memory and call arch/board reserve functions */
void lmb_init_and_reserve(struct bd_info *bd, void *fdt_blob)
{
int i;
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
if (bd->bi_dram[i].size)
lmb_add(bd->bi_dram[i].start, bd->bi_dram[i].size);
}
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)

View file

@ -718,8 +718,6 @@ static int tftp_init_load_addr(void)
if (CONFIG_IS_ENABLED(LMB)) {
phys_size_t max_size;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
max_size = lmb_get_free_size(image_load_addr);
if (!max_size)
return -1;

View file

@ -75,8 +75,6 @@ static int wget_init_load_size(void)
{
phys_size_t max_size;
lmb_init_and_reserve(gd->bd, (void *)gd->fdt_blob);
max_size = lmb_get_free_size(image_load_addr);
if (!max_size)
return -1;