#include <common.h>
#include <command.h>
#include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
#include <asm/byteorder.h>
#include <asm/addrspace.h>
static void linux_params_init (ulong start, char * commandline);
static void linux_env_set (char * env_name, char * env_val);
-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)
{
- ulong initrd_start, initrd_end;
- ulong ep = 0;
void (*theKernel) (int, char **, char **, int *);
char *commandline = getenv ("bootargs");
char env_buf[12];
- int ret;
char *cp;
- /* find kernel entry point */
- if (images->legacy_hdr_valid) {
- ep = image_get_ep (&images->legacy_hdr_os_copy);
-#if defined(CONFIG_FIT)
- } else if (images->fit_uname_os) {
- 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");
- goto error;
- }
- theKernel = (void (*)(int, char **, char **, int *))ep;
+ if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
+ return 1;
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS,
- &initrd_start, &initrd_end);
- if (ret)
- goto error;
+ /* find kernel entry point */
+ theKernel = (void (*)(int, char **, char **, int *))images->ep;
show_boot_progress (15);
linux_env_set ("memsize", env_buf);
- sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (initrd_start));
+ sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (images->rd_start));
linux_env_set ("initrd_start", env_buf);
- sprintf (env_buf, "0x%X", (uint) (initrd_end - initrd_start));
+ sprintf (env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
linux_env_set ("initrd_size", env_buf);
sprintf (env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));
linux_env_set("eth1addr", cp);
}
- if (!images->autostart)
- return ;
-
/* we assume that the kernel is in place */
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;
+ return 1;
}
static void linux_params_init (ulong start, char *line)