DECLARE_GLOBAL_DATA_PTR;
-static image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, int flag,
- int argc, char *argv[],
- ulong rd_addr, uint8_t arch, int verify);
+static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
+ int verify);
#else
#include "mkimage.h"
#include <time.h>
#ifndef USE_HOSTCC
/**
* image_get_ramdisk - get and verify ramdisk image
- * @cmdtp: command table pointer
- * @flag: command flag
- * @argc: command argument count
- * @argv: command argument list
* @rd_addr: ramdisk image start address
* @arch: expected ramdisk architecture
* @verify: checksum verification flag
* pointer to a ramdisk image header, if image was found and valid
* otherwise, return NULL
*/
-static image_header_t* image_get_ramdisk (cmd_tbl_t *cmdtp, int flag,
- int argc, char *argv[],
- ulong rd_addr, uint8_t arch, int verify)
+static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
+ int verify)
{
image_header_t *rd_hdr;
/**
* boot_get_ramdisk - main ramdisk handling routine
- * @cmdtp: command table pointer
- * @flag: command flag
* @argc: command argument count
* @argv: command argument list
* @images: pointer to the bootm images structure
* - commandline provided address of decicated ramdisk image.
*
* returns:
+ * 0, if ramdisk image was found and valid, or skiped
* rd_start and rd_end are set to ramdisk start/end addresses if
* ramdisk image is found and valid
+ *
+ * 1, if ramdisk image is found but corrupted
* rd_start and rd_end are set to 0 if no ramdisk exists
- * return 1 if ramdisk image is found but corrupted
*/
-int boot_get_ramdisk (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
- bootm_headers_t *images, uint8_t arch,
- ulong *rd_start, ulong *rd_end)
+int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+ uint8_t arch, ulong *rd_start, ulong *rd_end)
{
ulong rd_addr, rd_load;
ulong rd_data, rd_len;
printf ("## Loading init Ramdisk from Legacy "
"Image at %08lx ...\n", rd_addr);
- rd_hdr = image_get_ramdisk (cmdtp, flag, argc, argv,
- rd_addr, arch, images->verify);
+ rd_hdr = image_get_ramdisk (rd_addr, arch,
+ images->verify);
if (rd_hdr == NULL)
return 1;
break;
#endif
default:
- printf ("Wrong Image Format for %s command\n",
- cmdtp->name);
+ puts ("Wrong Ramdisk Image Format\n");
rd_data = rd_len = rd_load = 0;
}
int genimg_get_format (void *img_addr);
ulong genimg_get_image (ulong img_addr);
-int boot_get_ramdisk (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
- bootm_headers_t *images, uint8_t arch,
- ulong *rd_start, ulong *rd_end);
+int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+ uint8_t arch, ulong *rd_start, ulong *rd_end);
#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
printf ("Using machid 0x%x from environment\n", machid);
}
- boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_ARM, &initrd_start, &initrd_end);
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
+ &initrd_start, &initrd_end);
+ if (ret)
+ do_reset (cmdtp, flag, argc, argv);
show_boot_progress (15);
}
theKernel = (void *)ep;
- boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_AVR32, &initrd_start, &initrd_end);
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32,
+ &initrd_start, &initrd_end);
+ if (ret)
+ do_reset (cmdtp, flag, argc, argv);
show_boot_progress (15);
ulong initrd_start, initrd_end;
ulong ep;
image_header_t *hdr;
+ int ret;
- boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_I386, &initrd_start, &initrd_end);
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386,
+ &initrd_start, &initrd_end);
+ if (ret)
+ do_reset (cmdtp, flag, argc, argv);
if (images->legacy_hdr_valid) {
hdr = images->legacy_hdr_os;
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
/* find ramdisk */
- ret = boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_M68K, &rd_data_start, &rd_data_end);
-
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_M68K,
+ &rd_data_start, &rd_data_end);
if (ret)
goto error;
void (*theKernel) (int, char **, char **, int *);
char *commandline = getenv ("bootargs");
char env_buf[12];
+ int ret;
/* find kernel entry point */
if (images->legacy_hdr_valid) {
}
theKernel = (void (*)(int, char **, char **, int *))ep;
- boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_MIPS, &initrd_start, &initrd_end);
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS,
+ &initrd_start, &initrd_end);
+ if (ret)
+ do_reset (cmdtp, flag, argc, argv);
show_boot_progress (15);
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
/* find ramdisk */
- ret = boot_get_ramdisk (cmdtp, flag, argc, argv, images,
- IH_ARCH_PPC, &rd_data_start, &rd_data_end);
-
+ ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC,
+ &rd_data_start, &rd_data_end);
if (ret)
goto error;