]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_f: Move fdt_size to board
authorSimon Glass <sjg@chromium.org>
Wed, 21 Aug 2024 16:19:10 +0000 (10:19 -0600)
committerTom Rini <trini@konsulko.com>
Mon, 26 Aug 2024 20:05:38 +0000 (14:05 -0600)
This value is only really used before relocation. There is not much use
to showing its value in bdinfo, so drop it. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/bdinfo.c
common/board_f.c
include/asm-generic/global_data.h
include/board_f.h
test/cmd/bdinfo.c

index b53b51acca4f2e7bff652e9b7c302c6c0edeed8b..59fbaea498ba061d630e5f2fcb7ec57f145ccb86 100644 (file)
@@ -154,7 +154,6 @@ static int bdinfo_print_all(struct bd_info *bd)
        if (IS_ENABLED(CONFIG_CMD_NET))
                print_eth();
        bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob));
-       bdinfo_print_num_l("fdt_size", (ulong)gd->fdt_size);
        if (IS_ENABLED(CONFIG_VIDEO))
                show_video_info();
 #if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
index 8f7c56e812fb904f8b7e448dc2a516f15d2ada6a..046d9f45f8bdb4c19f2c342041e329c741e270cc 100644 (file)
@@ -575,12 +575,15 @@ static int reserve_fdt(void)
                 * section, then it will be relocated with other data.
                 */
                if (gd->fdt_blob) {
-                       gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob), 32);
+                       gd->boardf->fdt_size =
+                               ALIGN(fdt_totalsize(gd->fdt_blob), 32);
 
-                       gd->start_addr_sp = reserve_stack_aligned(gd->fdt_size);
-                       gd->boardf->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
+                       gd->start_addr_sp = reserve_stack_aligned(
+                               gd->boardf->fdt_size);
+                       gd->boardf->new_fdt = map_sysmem(gd->start_addr_sp,
+                                                        gd->boardf->fdt_size);
                        debug("Reserving %lu Bytes for FDT at: %08lx\n",
-                             gd->fdt_size, gd->start_addr_sp);
+                             gd->boardf->fdt_size, gd->start_addr_sp);
                }
        }
 
index 8a1a4e298acac29e081b8152690e1acf75e1775a..325777dc5395639af442889223ef19cb4dbf3706 100644 (file)
@@ -226,10 +226,6 @@ struct global_data {
         * @fdt_blob: U-Boot's own device tree, NULL if none
         */
        const void *fdt_blob;
-       /**
-        * @fdt_size: space reserved for relocated device space
-        */
-       unsigned long fdt_size;
        /**
         * @fdt_src: Source of FDT
         */
index 74fca6df75c83eec60204290b155beba9de4990e..d9c793fbeb1f89e3098904821a969576639ef14c 100644 (file)
@@ -18,6 +18,10 @@ struct board_f {
         * @new_fdt: relocated device tree
         */
        void *new_fdt;
+       /**
+        * @fdt_size: space reserved for relocated device space
+        */
+       unsigned long fdt_size;
 };
 
 #endif
index 60adc4aa960de2cb31ba37290f596abc76306bae..591390560b7383b702c21ff30585df51d5fa6317 100644 (file)
@@ -185,7 +185,6 @@ static int bdinfo_test_all(struct unit_test_state *uts)
        ut_assert(map_to_sysmem(gd->fdt_blob) == env_get_hex("fdtcontroladdr", 0x1234));
        ut_assertok(test_num_l(uts, "fdt_blob",
                               (ulong)map_to_sysmem(gd->fdt_blob)));
-       ut_assertok(test_num_l(uts, "fdt_size", (ulong)gd->fdt_size));
 
        if (IS_ENABLED(CONFIG_VIDEO))
                ut_assertok(test_video_info(uts));