#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;
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;
}
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");
}
- if (!images->autostart)
- return ;
-
#ifdef DEBUG
printf ("## Transferring control to Linux (at address %08x) ...\n",
(u32)base_ptr);
boot_zimage(base_ptr);
/* does not return */
- return;
error:
- if (images->autostart)
- do_reset (cmdtp, flag, argc, argv);
- return;
+ return 1;
}