diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2012-03-18 11:47:58 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-03-30 23:00:47 +0200 |
commit | 017e1f3f9fc8745cc12bbd924b0cbc4d6ee5dbf8 (patch) | |
tree | 7c44cb0303a56be05468b3a4960b5e1eced117b0 /common/image.c | |
parent | 44f074c771c4b70d250b0d7ed2f7513488c678bb (diff) | |
download | u-boot-imx-017e1f3f9fc8745cc12bbd924b0cbc4d6ee5dbf8.zip u-boot-imx-017e1f3f9fc8745cc12bbd924b0cbc4d6ee5dbf8.tar.gz u-boot-imx-017e1f3f9fc8745cc12bbd924b0cbc4d6ee5dbf8.tar.bz2 |
BOOT: Add RAW ramdisk support to bootz
This patch allows loading RAW ramdisk via bootz command. The raw ramdisk is
loaded only in case it's size is specified:
bootz <kernel addr> <ramdisk addr>:<ramdisk size> <fdt addr>
For example:
bootz 0x42000000 0x43000000:0x12345 0x44000000
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Tom Warren <TWarren@nvidia.com>
Cc: albert.u.boot@aribaud.net
Cc: afleming@gmail.com
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'common/image.c')
-rw-r--r-- | common/image.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/common/image.c b/common/image.c index 8c644b7..103e0e6 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, |