mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
board_f: Copy GD to new GD even if relocation disabled
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@gmail.com> Cc: Peng Fan <peng.fan@oss.nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
50f7b2effd
commit
47d7d03622
@ -673,11 +673,7 @@ static int reloc_bloblist(void)
|
|||||||
|
|
||||||
static int setup_reloc(void)
|
static int setup_reloc(void)
|
||||||
{
|
{
|
||||||
if (gd->flags & GD_FLG_SKIP_RELOC) {
|
if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
|
||||||
debug("Skipping relocation due to flag\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_TEXT_BASE
|
#ifdef CONFIG_SYS_TEXT_BASE
|
||||||
#ifdef ARM
|
#ifdef ARM
|
||||||
gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
|
gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
|
||||||
@ -691,12 +687,18 @@ static int setup_reloc(void)
|
|||||||
gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
|
gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
|
memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));
|
||||||
|
|
||||||
|
if (gd->flags & GD_FLG_SKIP_RELOC) {
|
||||||
|
debug("Skipping relocation due to flag\n");
|
||||||
|
} else {
|
||||||
debug("Relocation Offset is: %08lx\n", gd->reloc_off);
|
debug("Relocation Offset is: %08lx\n", gd->reloc_off);
|
||||||
debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n",
|
debug("Relocating to %08lx, new gd at %08lx, sp at %08lx\n",
|
||||||
gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd),
|
gd->relocaddr, (ulong)map_to_sysmem(gd->new_gd),
|
||||||
gd->start_addr_sp);
|
gd->start_addr_sp);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user