]> git.sur5r.net Git - u-boot/blobdiff - lib_i386/bootm.c
USB add macros for debugging usb device setup.
[u-boot] / lib_i386 / bootm.c
index 107ebaaa67fe7262342cfbea61ff541a40931765..f96d7bd6daa329fb9fe8f9d663306f60ba3d97e9 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
 #include <asm/byteorder.h>
 #include <asm/zimage.h>
 
 /*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
-void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               bootm_headers_t *images)
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
        void            *base_ptr;
        ulong           os_data, os_len;
-       ulong           initrd_start, initrd_end;
-       ulong           ep;
        image_header_t  *hdr;
-       int             ret;
+
 #if defined(CONFIG_FIT)
        const void      *data;
        size_t          len;
 #endif
 
-       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386,
-                       &initrd_start, &initrd_end);
-       if (ret)
-               goto error;
+       if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
+               return 1;
 
        if (images->legacy_hdr_valid) {
                hdr = images->legacy_hdr_os;
@@ -77,7 +70,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        }
 
        base_ptr = load_zimage ((void*)os_data, os_len,
-                       initrd_start, initrd_end - initrd_start, 0);
+                       images->rd_start, images->rd_end - images->rd_start, 0);
 
        if (NULL == base_ptr) {
                printf ("## Kernel loading failed ...\n");
@@ -85,9 +78,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        }
 
-       if (!images->autostart)
-               return ;
-
 #ifdef DEBUG
        printf ("## Transferring control to Linux (at address %08x) ...\n",
                (u32)base_ptr);
@@ -98,10 +88,7 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        boot_zimage(base_ptr);
        /* does not return */
-       return;
 
 error:
-       if (images->autostart)
-               do_reset (cmdtp, flag, argc, argv);
-       return;
+       return 1;
 }