]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lmb: remove the lmb_init_and_reserve() function
authorSughosh Ganu <sughosh.ganu@linaro.org>
Mon, 26 Aug 2024 11:59:25 +0000 (17:29 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 3 Sep 2024 20:08:50 +0000 (14:08 -0600)
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>
arch/arm/mach-apple/board.c
arch/arm/mach-snapdragon/board.c
arch/arm/mach-stm32mp/stm32mp1/cpu.c
cmd/bdinfo.c
cmd/load.c
fs/fs.c
include/lmb.h
lib/lmb.c
net/tftp.c
net/wget.c

index 213390d6e880c367df6ea26e584c7336a0089eb7..0b6d290b8ac41eea14455b920475e2086f77ccc1 100644 (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
         */
index a63c8bec45072e92e0e16af8faac855a5d7c8cc0..22a7d2a637dc67f548c58d5bbce96c82c2489a33 100644 (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));
index a913737342b488549b326b8b2527a262f8bbd116..64480da9f8d8f2e224ce86491bb1d8866181d434 100644 (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() */
index b31e0208df73a38886911596a1aae4883591fb64..3c40dee1430f42b806f7dc138915d998f0d71852 100644 (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());
index 56da3a4c5de7844575d21a60b110b9d4eb9c1f2e..20d802502ae65aea69718ea16dec549ce6d17bed 100644 (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);
 
diff --git a/fs/fs.c b/fs/fs.c
index 3fb00590be69c37e74571010fdcb8a130e14bfc9..4bc28d1dffb5435e14364a2ab21110b6ae117d92 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -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)
index 70191456e5eaee9a445e764438aea934565e0b48..04558724a78342cdd85a82e8bb81426718ebcb7c 100644 (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);
 
index 9b1854223d73bb1b68759b45d16c48bea735c85f..de4d0d180327aac5281b719f30f3aaad98138684 100644 (file)
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -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)
index 99b2ab9fca6f63f738b61ccb2923f0fcf7a047d8..b5d227d8bc2f86c3eba9033903206eaf3a9c146c 100644 (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;
index 241465b9b419350a0315950cd0fea63d2183ffa5..4a168641c653b4436374d52f8cd45b474c77c426 100644 (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;