summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_bootm.c6
-rw-r--r--common/image.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 5e5d572ebf..9ad2535d4b 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -1629,9 +1629,11 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD(
bootz, CONFIG_SYS_MAXARGS, 1, do_bootz,
"boot Linux zImage image from memory",
- "[addr [initrd] [fdt]]\n - boot Linux zImage stored in memory\n"
+ "[addr [initrd[:size]] [fdt]]\n"
+ " - boot Linux zImage stored in memory\n"
"\tThe argument 'initrd' is optional and specifies the address\n"
- "\tof the initrd in memory.\n"
+ "\tof the initrd in memory. The optional argument ':size' allows\n"
+ "\tspecifying the size of RAW initrd.\n"
#if defined(CONFIG_OF_LIBFDT)
"\tWhen booting a Linux kernel which requires a flat device-tree\n"
"\ta third argument is required which is the address of the\n"
diff --git a/common/image.c b/common/image.c
index 8c644b7dac..103e0e6e75 100644
--- a/common/image.c
+++ b/common/image.c
@@ -797,6 +797,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
ulong rd_addr, rd_load;
ulong rd_data, rd_len;
const image_header_t *rd_hdr;
+ char *end;
#if defined(CONFIG_FIT)
void *fit_hdr;
const char *fit_uname_config = NULL;
@@ -994,9 +995,17 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
break;
#endif
default:
- puts("Wrong Ramdisk Image Format\n");
- rd_data = rd_len = rd_load = 0;
- return 1;
+#ifdef CONFIG_SUPPORT_RAW_INITRD
+ if (argc >= 3 && (end = strchr(argv[2], ':'))) {
+ rd_len = simple_strtoul(++end, NULL, 16);
+ rd_data = rd_addr;
+ } else
+#endif
+ {
+ puts("Wrong Ramdisk Image Format\n");
+ rd_data = rd_len = rd_load = 0;
+ return 1;
+ }
}
} else if (images->legacy_hdr_valid &&
image_check_type(&images->legacy_hdr_os_copy,