# 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);
char *s;
int machid = bd->bi_arch_number;
void (*theKernel)(int zero, int arch, uint params);
+ int ret;
#ifdef CONFIG_CMDLINE_TAG
char *commandline = getenv ("bootargs");
/* find kernel entry point */
if (images->legacy_hdr_valid) {
- ep = image_get_ep (images->legacy_hdr_os);
+ ep = image_get_ep (&images->legacy_hdr_os_copy);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("ARM linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ ret = fit_image_get_entry (images->fit_hdr_os,
+ images->fit_noffset_os, &ep);
+ if (ret) {
+ puts ("Can't get entry point property!\n");
+ goto error;
+ }
#endif
} else {
puts ("Could not find kernel entry point!\n");
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
}
theKernel = (void (*)(int, int, uint))ep;
printf ("Using machid 0x%x from environment\n", machid);
}
- get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_ARM, &initrd_start, &initrd_end);
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
+ &initrd_start, &initrd_end);
+ if (ret)
+ goto error;
show_boot_progress (15);
setup_end_tag (bd);
#endif
+ if (!images->autostart)
+ return ;
+
/* we assume that the kernel is in place */
printf ("\nStarting kernel ...\n\n");
cleanup_before_linux ();
theKernel (0, machid, bd->bi_boot_params);
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}