#include <common.h>
#include <command.h>
#include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
#include <asm/byteorder.h>
DECLARE_GLOBAL_DATA_PTR;
# 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);
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);
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);
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;
}