Merge branch 'master' of git://git.denx.de/u-boot-arm
[kernel/u-boot.git] / common / board_r.c
index 86ca1cb..899f377 100644 (file)
@@ -128,8 +128,8 @@ __weak int fixup_cpu(void)
 
 static int initr_reloc_global_data(void)
 {
-#ifdef CONFIG_SYS_SYM_OFFSETS
-       monitor_flash_len = _end_ofs;
+#ifdef __ARM__
+       monitor_flash_len = _end - __image_copy_start;
 #elif !defined(CONFIG_SANDBOX)
        monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
 #endif
@@ -903,9 +903,19 @@ init_fnc_t init_sequence_r[] = {
 
 void board_init_r(gd_t *new_gd, ulong dest_addr)
 {
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+       int i;
+#endif
+
 #ifndef CONFIG_X86
        gd = new_gd;
 #endif
+
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+       for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++)
+               init_sequence_r[i] += gd->reloc_off;
+#endif
+
        if (initcall_run_list(init_sequence_r))
                hang();