- ulong rd_data, rd_len;
- ulong initrd_start, initrd_end;
- image_header_t *rd_hdr;
-
- void (*theKernel) (int, char **, char **, int *);
- char *commandline = getenv ("bootargs");
- char env_buf[12];
-
- theKernel =
- (void (*)(int, char **, char **, int *))image_get_ep (hdr);
-
- /*
- * Check if there is an initrd image
- */
- if (argc >= 3) {
- show_boot_progress (9);
-
- rd_hdr = (image_header_t *)simple_strtoul (argv[2], NULL, 16);
- printf ("## Loading Ramdisk Image at %08lx ...\n", rd_hdr);
-
- if (!image_check_magic (rd_hdr)) {
- printf ("Bad Magic Number\n");
- show_boot_progress (-10);
- do_reset (cmdtp, flag, argc, argv);
- }
-
- if (!image_check_hcrc (rd_hdr)) {
- printf ("Bad Header Checksum\n");
- show_boot_progress (-11);
- do_reset (cmdtp, flag, argc, argv);
- }
-
- show_boot_progress (10);
- print_image_hdr (rd_hdr);
-
- rd_data = image_get_data (rd_hdr);
- rd_len = image_get_data_size (rd_hdr);
-
- if (verify) {
- printf (" Verifying Checksum ... ");
- if (!image_check_dcrc (rd_hdr)) {
- printf ("Bad Data CRC\n");
- show_boot_progress (-12);
- do_reset (cmdtp, flag, argc, argv);
- }
- printf ("OK\n");
- }
-
- show_boot_progress (11);
-
- if (!image_check_os (rd_hdr, IH_OS_LINUX) ||
- !image_check_arch (rd_hdr, IH_ARCH_MIPS) ||
- !image_check_type (rd_hdr, IH_TYPE_RAMDISK)) {
- printf ("No Linux MIPS Ramdisk Image\n");
- show_boot_progress (-13);
- do_reset (cmdtp, flag, argc, argv);
+ 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;