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");
ep = image_get_ep (images->legacy_hdr_os);
#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;
ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
&initrd_start, &initrd_end);
if (ret)
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
show_boot_progress (15);
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;
}
void (*theKernel)(int magic, void *tagtable);
struct tag *params, *params_start;
char *commandline = getenv("bootargs");
+ int ret;
/* find kernel entry point */
if (images->legacy_hdr_valid) {
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("AVR32 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 *)ep;
ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32,
&initrd_start, &initrd_end);
if (ret)
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
show_boot_progress (15);
prepare_to_boot();
theKernel(ATAG_MAGIC, params_start);
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("AVR32 linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ int 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;
}
appl = (int (*)(char *))ep;
dcache_disable();
}
(*appl) (cmdline);
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
char *make_command_line(void)
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)
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
if (images->legacy_hdr_valid) {
hdr = images->legacy_hdr_os;
}
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("I386 linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ ret = fit_image_get_data (images->fit_hdr_os,
+ images->fit_noffset_os, &data, &len);
+ if (ret) {
+ puts ("Can't get image data/size!\n");
+ goto error;
+ }
+ os_data = (ulong)data;
+ os_len = (ulong)len;
#endif
} else {
puts ("Could not find kernel image!\n");
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
}
base_ptr = load_zimage ((void*)os_data, os_len,
if (NULL == base_ptr) {
printf ("## Kernel loading failed ...\n");
- do_reset(cmdtp, flag, argc, argv);
+ goto error;
}
printf("\nStarting kernel ...\n\n");
boot_zimage(base_ptr);
+ /* does not return */
+ return;
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
DECLARE_GLOBAL_DATA_PTR;
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
#define PHYSADDR(x) x
#define LINUX_MAX_ENVS 256
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("M68K 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;
}
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("MICROBLAZE linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ int 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 (*)(char *))ep;
return ;
theKernel (commandline);
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("MIPS 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, char **, char **, int *))ep;
ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS,
&initrd_start, &initrd_end);
if (ret)
- do_reset (cmdtp, flag, argc, argv);
+ goto error;
show_boot_progress (15);
printf ("\nStarting kernel ...\n\n");
theKernel (linux_argc, linux_argv, linux_env, 0);
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
static void linux_params_init (ulong start, char *line)
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("NIOS2 linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ int 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;
}
void (*kernel)(void) = (void (*)(void))ep;
* needs to be called ;-)
*/
kernel ();
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("PPC linux bootm");
- goto error;
+ 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");
ep = image_get_ep (images->legacy_hdr_os);
#if defined(CONFIG_FIT)
} else if (images->fit_uname_os) {
- fit_unsupported_reset ("SH linux bootm");
- do_reset (cmdtp, flag, argc, argv);
+ int 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;
}
void (*kernel) (void) = (void (*)(void))ep;
strcpy(COMMAND_LINE, bootargs);
kernel();
+ /* does not return */
+ return;
+
+error:
+ if (images->autostart)
+ do_reset (cmdtp, flag, argc, argv);
+ return;
}