]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_arm/bootm.c
USB: descriptor handling
[karo-tx-uboot.git] / lib_arm / bootm.c
index 529b0975ec9824a02404421f7f740b4f7cd2d9c4..7dbde7df5cebef36dc349d4d3189d111bd940cf6 100644 (file)
@@ -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,25 +53,30 @@ 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;
+       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;
 
-       get_ramdisk (cmdtp, flag, argc, argv, hdr, verify,
-                       IH_ARCH_ARM, &initrd_start, &initrd_end);
+       theKernel = (void (*)(int, int, uint))images->ep;
+
+       s = getenv ("machid");
+       if (s) {
+               machid = simple_strtoul (s, NULL, 16);
+               printf ("Using machid 0x%x from environment\n", machid);
+       }
 
        show_boot_progress (15);
 
@@ -102,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);
@@ -123,7 +125,10 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        cleanup_before_linux ();
 
-       theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
+       theKernel (0, machid, bd->bi_boot_params);
+       /* does not return */
+
+       return 1;
 }