[PATCH] board_f: Copy GD to new GD even if relocation disabled

Marek Vasut marek.vasut+renesas at gmail.com
Sun Oct 10 23:44:10 CEST 2021

Even if U-Boot has relocation disabled via GD_FLG_SKIP_RELOC , the
relocated stage of U-Boot still picks GD from new_gd location. The
U-Boot itself is not relocated, but GD might be, so copy the GD to
new GD location even if relocation is disabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at konsulko.com>
 common/board_f.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/board_f.c b/common/board_f.c
index 3dc0eaa59c..2161a7411d 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -674,6 +674,7 @@ static int reloc_bloblist(void)
 static int setup_reloc(void)
 	if (gd->flags & GD_FLG_SKIP_RELOC) {
+		memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
 		debug("Skipping relocation due to flag\n");
 		return 0;

More information about the U-Boot mailing list