]> git.sur5r.net Git - u-boot/blobdiff - arch/mips/lib/board.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx
[u-boot] / arch / mips / lib / board.c
index ab4a17c9432a847a7a74cd454ae3eaa2722468c7..623c4d7f0d58a2ee0018c3dbecfdf2ed07c51e04 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
-      (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \
-    defined(CONFIG_ENV_IS_IN_NVRAM)
-#define        TOTAL_MALLOC_LEN        (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE)
-#else
-#define        TOTAL_MALLOC_LEN        CONFIG_SYS_MALLOC_LEN
-#endif
-
 #undef DEBUG
 
 extern int timer_init(void);
@@ -170,9 +162,6 @@ void board_init_f(ulong bootflag)
        init_fnc_t **init_fnc_ptr;
        ulong addr, addr_sp, len = (ulong)&uboot_end - CONFIG_SYS_MONITOR_BASE;
        ulong *s;
-#ifdef CONFIG_PURPLE
-       void copy_code (ulong);
-#endif
 
        /* Pointer is writable since we allocated a register for it.
         */
@@ -261,13 +250,6 @@ void board_init_f(ulong bootflag)
 
        memcpy (id, (void *)gd, sizeof (gd_t));
 
-       /* On the purple board we copy the code in a special way
-        * in order to solve flash problems
-        */
-#ifdef CONFIG_PURPLE
-       copy_code(addr);
-#endif
-
        relocate_code (addr_sp, id, addr);
 
        /* NOTREACHED - relocate_code() does not return */
@@ -284,7 +266,6 @@ void board_init_f(ulong bootflag)
 
 void board_init_r (gd_t *id, ulong dest_addr)
 {
-       cmd_tbl_t *cmdtp;
 #ifndef CONFIG_SYS_NO_FLASH
        ulong size;
 #endif
@@ -304,34 +285,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
 
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
-       for (cmdtp = &__u_boot_cmd_start; cmdtp !=  &__u_boot_cmd_end; cmdtp++) {
-               ulong addr;
+       fixup_cmdtable(&__u_boot_cmd_start,
+               (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
+#endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
-               addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
-#if 0
-               printf ("Command \"%s\": 0x%08lx => 0x%08lx\n",
-                               cmdtp->name, (ulong) (cmdtp->cmd), addr);
-#endif
-               cmdtp->cmd =
-                       (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
-
-               addr = (ulong)(cmdtp->name) + gd->reloc_off;
-               cmdtp->name = (char *)addr;
-
-               if (cmdtp->usage) {
-                       addr = (ulong)(cmdtp->usage) + gd->reloc_off;
-                       cmdtp->usage = (char *)addr;
-               }
-#ifdef CONFIG_SYS_LONGHELP
-               if (cmdtp->help) {
-                       addr = (ulong)(cmdtp->help) + gd->reloc_off;
-                       cmdtp->help = (char *)addr;
-               }
-#endif
-       }
        /* there are some other pointer constants we must deal with */
 #ifndef CONFIG_ENV_IS_NOWHERE
        env_name_spec += gd->reloc_off;