]> git.sur5r.net Git - u-boot/blobdiff - lib_arm/bootm.c
microblaze: Correct ffs regression for Microblaze
[u-boot] / lib_arm / bootm.c
index 31c2d672257577914f37b1cf3d70d286ec6cbfb7..128b7e313cdfa6a11719716726dc6956ad5dd43b 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 #include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
 #include <asm/byteorder.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -43,9 +43,6 @@ static void setup_memory_tags (bd_t *bd);
 # endif
 static void setup_commandline_tag (bd_t *bd, char *commandline);
 
-#if 0
-static void setup_ramdisk_tag (bd_t *bd);
-#endif
 # ifdef CONFIG_INITRD_TAG
 static void setup_initrd_tag (bd_t *bd, ulong initrd_start,
                              ulong initrd_end);
@@ -56,24 +53,24 @@ static void setup_end_tag (bd_t *bd);
 static void setup_videolfb_tag (gd_t *gd);
 # endif
 
-
 static struct tag *params;
 #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
 
-void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                    image_header_t *hdr, int verify)
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
-       ulong initrd_start, initrd_end;
-       void (*theKernel)(int zero, int arch, uint params);
-       bd_t *bd = gd->bd;
-       int machid = bd->bi_arch_number;
-       char *s;
+       bd_t    *bd = gd->bd;
+       char    *s;
+       int     machid = bd->bi_arch_number;
+       void    (*theKernel)(int zero, int arch, uint params);
 
 #ifdef CONFIG_CMDLINE_TAG
        char *commandline = getenv ("bootargs");
 #endif
 
-       theKernel = (void (*)(int, int, uint))image_get_ep (hdr);
+       if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
+               return 1;
+
+       theKernel = (void (*)(int, int, uint))images->ep;
 
        s = getenv ("machid");
        if (s) {
@@ -81,9 +78,6 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
                printf ("Using machid 0x%x from environment\n", machid);
        }
 
-       get_ramdisk (cmdtp, flag, argc, argv, hdr, verify,
-                       IH_ARCH_ARM, &initrd_start, &initrd_end);
-
        show_boot_progress (15);
 
        debug ("## Transferring control to Linux (at address %08lx) ...\n",
@@ -110,8 +104,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        setup_commandline_tag (bd, commandline);
 #endif
 #ifdef CONFIG_INITRD_TAG
-       if (initrd_start && initrd_end)
-               setup_initrd_tag (bd, initrd_start, initrd_end);
+       if (images->rd_start && images->rd_end)
+               setup_initrd_tag (bd, images->rd_start, images->rd_end);
 #endif
 #if defined (CONFIG_VFD) || defined (CONFIG_LCD)
        setup_videolfb_tag ((gd_t *) gd);
@@ -132,6 +126,9 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        cleanup_before_linux ();
 
        theKernel (0, machid, bd->bi_boot_params);
+       /* does not return */
+
+       return 1;
 }