]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_bootm.c
Blackfin: TWI/I2C: implement bus speed get/set functions
[u-boot] / common / cmd_bootm.c
index 86c81220d2cd88030c8d6c0e2050b3ddf06d6d49..8f8359856162e47b450c0d41cd779c97981c3778 100644 (file)
@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb)
 }
 void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));
 
+/* Allow for arch specific config before we boot */
+void __arch_preboot_os(void)
+{
+       /* please define platform specific arch_preboot_os() */
+}
+void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
+
 #if defined(__ARM__)
   #define IH_INITRD_ARCH IH_ARCH_ARM
 #elif defined(__avr32__)
@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        break;
                case BOOTM_STATE_OS_GO:
                        disable_interrupts();
+                       arch_preboot_os();
                        boot_fn(BOOTM_STATE_OS_GO, argc, argv, &images);
                        break;
        }
@@ -553,7 +561,6 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 /*******************************************************************/
 /* bootm - boot application image from image in memory */
 /*******************************************************************/
-static int relocated = 0;
 
 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -561,6 +568,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        ulong           load_end = 0;
        int             ret;
        boot_os_fn      *boot_fn;
+#ifndef CONFIG_RELOC_FIXUP_WORKS
+       static int relocated = 0;
 
        /* relocate boot function table */
        if (!relocated) {
@@ -570,6 +579,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                boot_os[i] += gd->reloc_off;
                relocated = 1;
        }
+#endif
 
        /* determine if we have a sub command */
        if (argc > 1) {
@@ -673,6 +683,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
+       arch_preboot_os();
+
        boot_fn(0, argc, argv, &images);
 
        show_boot_progress (-9);