summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorLothar Waßmann <LW@KARO-electronics.de>2017-06-08 10:18:25 +0200
committerTom Rini <trini@konsulko.com>2017-06-12 08:38:41 -0400
commit53207bfd704250354c56aa74c7e96151fddee1f1 (patch)
treeebe5a2d0779d30abe485a9efd16999df6adf60a2 /common/board_f.c
parent69c5d76f2fd8bf645cde9f0a8225daba25d65e01 (diff)
downloadu-boot-53207bfd704250354c56aa74c7e96151fddee1f1.tar.gz
u-boot-53207bfd704250354c56aa74c7e96151fddee1f1.tar.bz2
u-boot-53207bfd704250354c56aa74c7e96151fddee1f1.zip
board_f: fix calculation of reloc_off
relocate_code() calculates the relocation offset wrt. the symbol __image_copy_start which happens to have the same value as CONFIG_TEXT_BASE on most systems. When creating an i.MX boot image with an integrated IVT it is convenient to have CONFIG_TEXT_BASE point to the start of the IVT that is prepended to the actual code. Thus CONFIG_TEXT_BASE will differ from __image_copy_start, while the calculation 'gd->relocaddr - __image_copy_start' still gives the right relocation offset. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/board_f.c b/common/board_f.c
index f5054985d0..8bf9acca48 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -644,13 +644,16 @@ static int setup_reloc(void)
}
#ifdef CONFIG_SYS_TEXT_BASE
- gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
-#ifdef CONFIG_M68K
+#ifdef ARM
+ gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
+#elif defined(CONFIG_M68K)
/*
* On all ColdFire arch cpu, monitor code starts always
* just after the default vector table location, so at 0x400
*/
gd->reloc_off = gd->relocaddr - (CONFIG_SYS_TEXT_BASE + 0x400);
+#else
+ gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE;
#endif
#endif
memcpy(gd->new_gd, (char *)gd, sizeof(gd_t));