[PATCH v2 19/35] board_f: Move new_bootstage to boardf

Simon Glass sjg at chromium.org
Wed Aug 21 18:19:11 CEST 2024


This value is only used before relocation. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 common/board_f.c                  | 7 +++----
 include/asm-generic/global_data.h | 4 ----
 include/board_f.h                 | 4 ++++
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 046d9f45f8b..0c24e3ae618 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -596,7 +596,7 @@ static int reserve_bootstage(void)
 	int size = bootstage_get_size();
 
 	gd->start_addr_sp = reserve_stack_aligned(size);
-	gd->new_bootstage = map_sysmem(gd->start_addr_sp, size);
+	gd->boardf->new_bootstage = map_sysmem(gd->start_addr_sp, size);
 	debug("Reserving %#x Bytes for bootstage at: %08lx\n", size,
 	      gd->start_addr_sp);
 #endif
@@ -686,9 +686,8 @@ static int reloc_bootstage(void)
 #ifdef CONFIG_BOOTSTAGE
 	if (gd->flags & GD_FLG_SKIP_RELOC)
 		return 0;
-	if (gd->new_bootstage) {
-		bootstage_relocate(gd->new_bootstage);
-	}
+	if (gd->boardf->new_bootstage)
+		bootstage_relocate(gd->boardf->new_bootstage);
 #endif
 
 	return 0;
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index 325777dc539..915dad503a2 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -335,10 +335,6 @@ struct global_data {
 	 * @bootstage: boot stage information
 	 */
 	struct bootstage_data *bootstage;
-	/**
-	 * @new_bootstage: relocated boot stage information
-	 */
-	struct bootstage_data *new_bootstage;
 #endif
 #ifdef CONFIG_LOG
 	/**
diff --git a/include/board_f.h b/include/board_f.h
index d9c793fbeb1..1eba236a961 100644
--- a/include/board_f.h
+++ b/include/board_f.h
@@ -22,6 +22,10 @@ struct board_f {
 	 * @fdt_size: space reserved for relocated device space
 	 */
 	unsigned long fdt_size;
+	/**
+	 * @new_bootstage: relocated boot stage information
+	 */
+	struct bootstage_data *new_bootstage;
 };
 
 #endif
-- 
2.34.1



More information about the U-Boot mailing list