summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-21 10:19:10 -0600
committerTom Rini <trini@konsulko.com>2024-08-26 14:05:38 -0600
commit5019d3282cb738604cdc33102809ed7a0ceaf08e (patch)
tree38dc64c46fd5b6580da096a9f81f3ce865d4f751
parent6abd992ada96cd7aa4757eeca44dae8942d7ba63 (diff)
board_f: Move fdt_size to board
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>
-rw-r--r--cmd/bdinfo.c1
-rw-r--r--common/board_f.c11
-rw-r--r--include/asm-generic/global_data.h4
-rw-r--r--include/board_f.h4
-rw-r--r--test/cmd/bdinfo.c1
5 files changed, 11 insertions, 10 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index b53b51acca4..59fbaea498b 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -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)
diff --git a/common/board_f.c b/common/board_f.c
index 8f7c56e812f..046d9f45f8b 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -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);
}
}
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 8a1a4e298ac..325777dc539 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -227,10 +227,6 @@ struct global_data {
*/
const void *fdt_blob;
/**
- * @fdt_size: space reserved for relocated device space
- */
- unsigned long fdt_size;
- /**
* @fdt_src: Source of FDT
*/
enum fdt_source_t fdt_src;
diff --git a/include/board_f.h b/include/board_f.h
index 74fca6df75c..d9c793fbeb1 100644
--- a/include/board_f.h
+++ b/include/board_f.h
@@ -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
diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c
index 60adc4aa960..591390560b7 100644
--- a/test/cmd/bdinfo.c
+++ b/test/cmd/bdinfo.c
@@ -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));