]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/avr32/lib/board.c
relocation: fixup cmdtable
[karo-tx-uboot.git] / arch / avr32 / lib / board.c
index aa589bb4b00dd98c6772507b8dedf86b8f8846e4..e6b81cca73645538c92edd4d95d1835dd5c8933d 100644 (file)
@@ -273,30 +273,13 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 
        monitor_flash_len = _edata - _text;
 
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
        /*
         * We have to relocate the command table manually
         */
-       for (cmdtp = &__u_boot_cmd_start;
-            cmdtp !=  &__u_boot_cmd_end; cmdtp++) {
-               unsigned long addr;
-
-               addr = (unsigned long)cmdtp->cmd + gd->reloc_off;
-               cmdtp->cmd = (typeof(cmdtp->cmd))addr;
-
-               addr = (unsigned long)cmdtp->name + gd->reloc_off;
-               cmdtp->name = (typeof(cmdtp->name))addr;
-
-               if (cmdtp->usage) {
-                       addr = (unsigned long)cmdtp->usage + gd->reloc_off;
-                       cmdtp->usage = (typeof(cmdtp->usage))addr;
-               }
-#ifdef CONFIG_SYS_LONGHELP
-               if (cmdtp->help) {
-                       addr = (unsigned long)cmdtp->help + gd->reloc_off;
-                       cmdtp->help = (typeof(cmdtp->help))addr;
-               }
-#endif
-       }
+       fixup_cmdtable(&__u_boot_cmd_start,
+               (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
+#endif /* !defined(CONFIG_RELOC_FIXUP_WORKS) */
 
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE