* [U-Boot] [PATCH V2] BOOT: Add RAW ramdisk support to bootz [not found] <Message-Id: <1331857196-29512-1-git-send-email-marex@denx.de> @ 2012-03-16 14:02 ` Marek Vasut 2012-03-16 15:54 ` Rob Herring 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-16 14:02 UTC (permalink / raw) To: u-boot 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> Cc: Tom Warren <TWarren@nvidia.com> Cc: albert.u.boot at aribaud.net Cc: afleming at 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> --- README | 5 +++++ common/cmd_bootm.c | 6 ++++-- common/image.c | 31 +++++++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 6 deletions(-) V2: Make this feature configurable Document this feature diff --git a/README b/README index b273070..43fa160 100644 --- a/README +++ b/README @@ -4422,6 +4422,11 @@ On some platforms, it's possible to boot Linux zImage. This is done using the "bootz" command. The syntax of "bootz" command is the same as the syntax of "bootm" command. +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply +kernel with raw initrd images. The syntax is slightly different, the +address of the initrd must be augmented by it's size, in the following +format: "<initrd addres>:<initrd size>". + Standalone HOWTO: ================= diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 9efac8b..872a49c 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1628,9 +1628,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 95c7a15..1908df6 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; @@ -845,10 +846,21 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, } else #endif { - rd_addr = simple_strtoul(argv[2], NULL, 16); + rd_addr = simple_strtoul(argv[2], &end, 16); debug("* ramdisk: cmdline image address = " "0x%08lx\n", rd_addr); + +#ifdef CONFIG_SUPPORT_RAW_INITRD + if (end[0] == ':') { + rd_len = simple_strtoul(++end, + NULL, 16); + debug("* ramdisk: cmdline image " + "length = 0x%08lx\n", + rd_len); + } +#endif + } #if defined(CONFIG_FIT) } else { @@ -990,9 +1002,20 @@ 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 + /* + * Check if rd_len was manually overridden, if it was, + * we're loading RAW ramdisk. + */ + if (rd_len != 0) { + 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, -- 1.7.9 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH V2] BOOT: Add RAW ramdisk support to bootz 2012-03-16 14:02 ` [U-Boot] [PATCH V2] BOOT: Add RAW ramdisk support to bootz Marek Vasut @ 2012-03-16 15:54 ` Rob Herring 2012-03-16 21:30 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Rob Herring @ 2012-03-16 15:54 UTC (permalink / raw) To: u-boot On 03/16/2012 09:02 AM, Marek Vasut wrote: > 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> > Cc: Tom Warren <TWarren@nvidia.com> > Cc: albert.u.boot at aribaud.net > Cc: afleming at 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> > --- > README | 5 +++++ > common/cmd_bootm.c | 6 ++++-- > common/image.c | 31 +++++++++++++++++++++++++++---- > 3 files changed, 36 insertions(+), 6 deletions(-) > > V2: Make this feature configurable > Document this feature > > diff --git a/README b/README > index b273070..43fa160 100644 > --- a/README > +++ b/README > @@ -4422,6 +4422,11 @@ On some platforms, it's possible to boot Linux zImage. This is done > using the "bootz" command. The syntax of "bootz" command is the same > as the syntax of "bootm" command. > > +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply > +kernel with raw initrd images. The syntax is slightly different, the > +address of the initrd must be augmented by it's size, in the following > +format: "<initrd addres>:<initrd size>". > + > > Standalone HOWTO: > ================= > diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > index 9efac8b..872a49c 100644 > --- a/common/cmd_bootm.c > +++ b/common/cmd_bootm.c > @@ -1628,9 +1628,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 95c7a15..1908df6 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; > @@ -845,10 +846,21 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, > } else > #endif > { > - rd_addr = simple_strtoul(argv[2], NULL, 16); > + rd_addr = simple_strtoul(argv[2], &end, 16); V1 did not work for me and it looks like V2 has the same problem. You'll never get to this else because of the call to fit_parse_subimage above: * fit_parse_subimage() expects subimage spec in the for of * [<addr>]:<subimage>, where <addr> is a FIT image address that contains * subimage with a <subimg> unit name. With debug turned on, it thinks my size is the sub-image name: * ramdisk: subimage '3DC72E' from image at 0x01000000 ramdisk start = 0x1ff912fc, ramdisk end = 0x3fe98ab4 Rob > debug("* ramdisk: cmdline image address = " > "0x%08lx\n", > rd_addr); > + > +#ifdef CONFIG_SUPPORT_RAW_INITRD > + if (end[0] == ':') { > + rd_len = simple_strtoul(++end, > + NULL, 16); > + debug("* ramdisk: cmdline image " > + "length = 0x%08lx\n", > + rd_len); > + } > +#endif > + > } > #if defined(CONFIG_FIT) > } else { > @@ -990,9 +1002,20 @@ 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 > + /* > + * Check if rd_len was manually overridden, if it was, > + * we're loading RAW ramdisk. > + */ > + if (rd_len != 0) { > + 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, ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH V2] BOOT: Add RAW ramdisk support to bootz 2012-03-16 15:54 ` Rob Herring @ 2012-03-16 21:30 ` Marek Vasut 2012-03-18 21:47 ` [U-Boot] [PATCH] " Rob Herring 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-16 21:30 UTC (permalink / raw) To: u-boot Dear Rob Herring, > On 03/16/2012 09:02 AM, Marek Vasut wrote: > > 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> > > Cc: Tom Warren <TWarren@nvidia.com> > > Cc: albert.u.boot at aribaud.net > > Cc: afleming at 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> > > --- > > > > README | 5 +++++ > > common/cmd_bootm.c | 6 ++++-- > > common/image.c | 31 +++++++++++++++++++++++++++---- > > 3 files changed, 36 insertions(+), 6 deletions(-) > > > > V2: Make this feature configurable > > > > Document this feature > > > > diff --git a/README b/README > > index b273070..43fa160 100644 > > --- a/README > > +++ b/README > > @@ -4422,6 +4422,11 @@ On some platforms, it's possible to boot Linux > > zImage. This is done > > > > using the "bootz" command. The syntax of "bootz" command is the same > > as the syntax of "bootm" command. > > > > +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply > > +kernel with raw initrd images. The syntax is slightly different, the > > +address of the initrd must be augmented by it's size, in the following > > +format: "<initrd addres>:<initrd size>". > > + > > > > Standalone HOWTO: > > ================= > > > > diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > > index 9efac8b..872a49c 100644 > > --- a/common/cmd_bootm.c > > +++ b/common/cmd_bootm.c > > @@ -1628,9 +1628,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 95c7a15..1908df6 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; > > > > @@ -845,10 +846,21 @@ int boot_get_ramdisk(int argc, char * const argv[], > > bootm_headers_t *images, > > > > } else > > > > #endif > > > > { > > > > - rd_addr = simple_strtoul(argv[2], NULL, 16); > > + rd_addr = simple_strtoul(argv[2], &end, 16); > > V1 did not work for me and it looks like V2 has the same problem. You'll > never get to this else because of the call to fit_parse_subimage above: > > * fit_parse_subimage() expects subimage spec in the for of > * [<addr>]:<subimage>, where <addr> is a FIT image address that contains > * subimage with a <subimg> unit name. > > > With debug turned on, it thinks my size is the sub-image name: > > * ramdisk: subimage '3DC72E' from image at 0x01000000 > ramdisk start = 0x1ff912fc, ramdisk end = 0x3fe98ab4 Good catch, thanks for testing ... will poke around further. But if you have any suggestions now that you dug in it, they're welcome :) > > Rob > > > debug("* ramdisk: cmdline image address = " > > > > "0x%08lx\n", > > rd_addr); > > > > + > > +#ifdef CONFIG_SUPPORT_RAW_INITRD > > + if (end[0] == ':') { > > + rd_len = simple_strtoul(++end, > > + NULL, 16); > > + debug("* ramdisk: cmdline image " > > + "length = 0x%08lx\n", > > + rd_len); > > + } > > +#endif > > + > > > > } > > > > #if defined(CONFIG_FIT) > > > > } else { > > > > @@ -990,9 +1002,20 @@ 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 > > + /* > > + * Check if rd_len was manually overridden, if it was, > > + * we're loading RAW ramdisk. > > + */ > > + if (rd_len != 0) { > > + 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, ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-16 21:30 ` Marek Vasut @ 2012-03-18 21:47 ` Rob Herring 2012-03-22 9:10 ` Marek Vasut ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Rob Herring @ 2012-03-18 21:47 UTC (permalink / raw) To: u-boot From: Marek Vasut <marek.vasut@gmail.com> 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 at aribaud.net Cc: afleming at 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> --- V3: - fix operation when CONFIG_FIT is enabled as FIT images use <addr>[:<subimage>] README | 5 +++++ common/cmd_bootm.c | 6 ++++-- common/image.c | 15 ++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README b/README index 5141751..068ec71 100644 --- a/README +++ b/README @@ -4330,6 +4330,11 @@ On some platforms, it's possible to boot Linux zImage. This is done using the "bootz" command. The syntax of "bootz" command is the same as the syntax of "bootm" command. +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply +kernel with raw initrd images. The syntax is slightly different, the +address of the initrd must be augmented by it's size, in the following +format: "<initrd addres>:<initrd size>". + Standalone HOWTO: ================= diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index b49d4f7..2f9b214 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1634,9 +1634,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 77ca6e4..2a25f5f 100644 --- a/common/image.c +++ b/common/image.c @@ -796,6 +796,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; @@ -989,9 +990,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, -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-18 21:47 ` [U-Boot] [PATCH] " Rob Herring @ 2012-03-22 9:10 ` Marek Vasut 2012-03-22 12:14 ` Rob Herring 2012-03-30 21:01 ` Wolfgang Denk 2012-03-30 21:12 ` Wolfgang Denk 2 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-22 9:10 UTC (permalink / raw) To: u-boot Dear Rob Herring, > From: Marek Vasut <marek.vasut@gmail.com> > > 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 at aribaud.net > Cc: afleming at 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> Doesn't this still colide with CONFIG_FIT? Aka. in case of CONFIG_FIT enabled, you can't use raw ramdisk? btw. maybe we should use "@" instead of ":" and be done with it? > --- > V3: > - fix operation when CONFIG_FIT is enabled as FIT images use > <addr>[:<subimage>] > > README | 5 +++++ > common/cmd_bootm.c | 6 ++++-- > common/image.c | 15 ++++++++++++--- > 3 files changed, 21 insertions(+), 5 deletions(-) > > diff --git a/README b/README > index 5141751..068ec71 100644 > --- a/README > +++ b/README > @@ -4330,6 +4330,11 @@ On some platforms, it's possible to boot Linux > zImage. This is done using the "bootz" command. The syntax of "bootz" > command is the same as the syntax of "bootm" command. > > +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply > +kernel with raw initrd images. The syntax is slightly different, the > +address of the initrd must be augmented by it's size, in the following > +format: "<initrd addres>:<initrd size>". > + > > Standalone HOWTO: > ================= > diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > index b49d4f7..2f9b214 100644 > --- a/common/cmd_bootm.c > +++ b/common/cmd_bootm.c > @@ -1634,9 +1634,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 77ca6e4..2a25f5f 100644 > --- a/common/image.c > +++ b/common/image.c > @@ -796,6 +796,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; > @@ -989,9 +990,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, Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 9:10 ` Marek Vasut @ 2012-03-22 12:14 ` Rob Herring 2012-03-22 12:45 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Rob Herring @ 2012-03-22 12:14 UTC (permalink / raw) To: u-boot On 03/22/2012 04:10 AM, Marek Vasut wrote: > Dear Rob Herring, > >> From: Marek Vasut <marek.vasut@gmail.com> >> >> 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 at aribaud.net >> Cc: afleming at 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> > > Doesn't this still colide with CONFIG_FIT? Aka. in case of CONFIG_FIT enabled, > you can't use raw ramdisk? No. All the parsing now is done after trying to read the image type. Only if a valid legacy or FIT uImage is not found, do we hit the raw image code and parse the size. I tested both with and without CONFIG_FIT enabled. > > btw. maybe we should use "@" instead of ":" and be done with it? Sub images will have an @ in the name. I thought about parsing for that, but DT has no requirement that you have to have an @ in the node name and it's not clear to me if u-boot convention requires it or not. Then I came up with the current patch, so it doesn't matter. Rob > >> --- >> V3: >> - fix operation when CONFIG_FIT is enabled as FIT images use >> <addr>[:<subimage>] >> >> README | 5 +++++ >> common/cmd_bootm.c | 6 ++++-- >> common/image.c | 15 ++++++++++++--- >> 3 files changed, 21 insertions(+), 5 deletions(-) >> >> diff --git a/README b/README >> index 5141751..068ec71 100644 >> --- a/README >> +++ b/README >> @@ -4330,6 +4330,11 @@ On some platforms, it's possible to boot Linux >> zImage. This is done using the "bootz" command. The syntax of "bootz" >> command is the same as the syntax of "bootm" command. >> >> +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply >> +kernel with raw initrd images. The syntax is slightly different, the >> +address of the initrd must be augmented by it's size, in the following >> +format: "<initrd addres>:<initrd size>". >> + >> >> Standalone HOWTO: >> ================= >> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c >> index b49d4f7..2f9b214 100644 >> --- a/common/cmd_bootm.c >> +++ b/common/cmd_bootm.c >> @@ -1634,9 +1634,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 77ca6e4..2a25f5f 100644 >> --- a/common/image.c >> +++ b/common/image.c >> @@ -796,6 +796,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; >> @@ -989,9 +990,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, > > Best regards, > Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 12:14 ` Rob Herring @ 2012-03-22 12:45 ` Marek Vasut 2012-03-22 13:33 ` Wolfgang Denk 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-22 12:45 UTC (permalink / raw) To: u-boot Dear Rob Herring, > On 03/22/2012 04:10 AM, Marek Vasut wrote: > > Dear Rob Herring, > > > >> From: Marek Vasut <marek.vasut@gmail.com> > >> > >> 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 at aribaud.net > >> Cc: afleming at 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> > > > > Doesn't this still colide with CONFIG_FIT? Aka. in case of CONFIG_FIT > > enabled, you can't use raw ramdisk? > > No. All the parsing now is done after trying to read the image type. > Only if a valid legacy or FIT uImage is not found, do we hit the raw > image code and parse the size. I tested both with and without CONFIG_FIT > enabled. > > > btw. maybe we should use "@" instead of ":" and be done with it? > > Sub images will have an @ in the name. I thought about parsing for that, > but DT has no requirement that you have to have an @ in the node name > and it's not clear to me if u-boot convention requires it or not. Then I > came up with the current patch, so it doesn't matter. Dear Wolfgang Denk, are we OK with applying this and bootz patch please? Can we get it into .04 release please? > > Rob > > >> --- > >> V3: > >> - fix operation when CONFIG_FIT is enabled as FIT images use > >> > >> <addr>[:<subimage>] > >> > >> README | 5 +++++ > >> common/cmd_bootm.c | 6 ++++-- > >> common/image.c | 15 ++++++++++++--- > >> 3 files changed, 21 insertions(+), 5 deletions(-) > >> > >> diff --git a/README b/README > >> index 5141751..068ec71 100644 > >> --- a/README > >> +++ b/README > >> @@ -4330,6 +4330,11 @@ On some platforms, it's possible to boot Linux > >> zImage. This is done using the "bootz" command. The syntax of "bootz" > >> command is the same as the syntax of "bootm" command. > >> > >> +Note, defining the CONFIG_SUPPORT_INITRD_RAW allows user to supply > >> +kernel with raw initrd images. The syntax is slightly different, the > >> +address of the initrd must be augmented by it's size, in the following > >> +format: "<initrd addres>:<initrd size>". > >> + > >> > >> Standalone HOWTO: > >> ================= > >> > >> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c > >> index b49d4f7..2f9b214 100644 > >> --- a/common/cmd_bootm.c > >> +++ b/common/cmd_bootm.c > >> @@ -1634,9 +1634,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 77ca6e4..2a25f5f 100644 > >> --- a/common/image.c > >> +++ b/common/image.c > >> @@ -796,6 +796,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; > >> > >> @@ -989,9 +990,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, > > > > Best regards, > > Marek Vasut Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 12:45 ` Marek Vasut @ 2012-03-22 13:33 ` Wolfgang Denk 2012-03-22 16:45 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Wolfgang Denk @ 2012-03-22 13:33 UTC (permalink / raw) To: u-boot Dear Marek, In message <201203221345.55217.marek.vasut@gmail.com> you wrote: > > > Sub images will have an @ in the name. I thought about parsing for that, > > but DT has no requirement that you have to have an @ in the node name > > and it's not clear to me if u-boot convention requires it or not. Then I > > came up with the current patch, so it doesn't matter. > > Dear Wolfgang Denk, are we OK with applying this and bootz patch please? Can we > get it into .04 release please? "this" - which patch version exactly are you referring to? In any case this has been submitted long after the close of the MW, so this is stuff for "next". Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Today is the yesterday you worried about tomorrow. ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 13:33 ` Wolfgang Denk @ 2012-03-22 16:45 ` Marek Vasut 2012-03-22 23:04 ` Wolfgang Denk 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-22 16:45 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Marek, > > In message <201203221345.55217.marek.vasut@gmail.com> you wrote: > > > Sub images will have an @ in the name. I thought about parsing for > > > that, but DT has no requirement that you have to have an @ in the node > > > name and it's not clear to me if u-boot convention requires it or not. > > > Then I came up with the current patch, so it doesn't matter. > > > > Dear Wolfgang Denk, are we OK with applying this and bootz patch please? > > Can we get it into .04 release please? > > "this" - which patch version exactly are you referring to? Revision V6. > > In any case this has been submitted long after the close of the MW, so > this is stuff for "next". I believe this patch is quite important to the linux-arm people and early adoption of this stuff would be very beneficial. Also, there are other patches that were applied after the MW was closed. Finally, this patch started long before .04 release cycle. > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 16:45 ` Marek Vasut @ 2012-03-22 23:04 ` Wolfgang Denk 2012-03-23 8:36 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Wolfgang Denk @ 2012-03-22 23:04 UTC (permalink / raw) To: u-boot Dear Marek Vasut, In message <201203221745.16226.marek.vasut@gmail.com> you wrote: > > > > Dear Wolfgang Denk, are we OK with applying this and bootz patch please? > > > Can we get it into .04 release please? > > > > "this" - which patch version exactly are you referring to? > > Revision V6. Could you please be a bit more specific? Like posting a link to the respective message on gmane, or in patchwork? The Subject: of this message is "BOOT: Add RAW ramdisk support to bootz", but I have not seen any V6 for this patch. Ican only guess that you might be referring to [PATCH V6] BOOT: Add "bootz" command to boot Linux zImage on ARM - but I'd rather be sure. > I believe this patch is quite important to the linux-arm people and early > adoption of this stuff would be very beneficial. Also, there are other patches > that were applied after the MW was closed. Finally, this patch started long > before .04 release cycle. Where/when? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A little suffering is good for the soul. -- Kirk, "The Corbomite Maneuver", stardate 1514.0 ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-22 23:04 ` Wolfgang Denk @ 2012-03-23 8:36 ` Marek Vasut 2012-03-28 20:54 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-23 8:36 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Marek Vasut, > > In message <201203221745.16226.marek.vasut@gmail.com> you wrote: > > > > Dear Wolfgang Denk, are we OK with applying this and bootz patch > > > > please? Can we get it into .04 release please? > > > > > > "this" - which patch version exactly are you referring to? > > > > Revision V6. > > Could you please be a bit more specific? Like posting a link to the > respective message on gmane, or in patchwork? http://patchwork.ozlabs.org/patch/146848/ http://patchwork.ozlabs.org/patch/147440/ > > The Subject: of this message is "BOOT: Add RAW ramdisk support to > bootz", but I have not seen any V6 for this patch. Ican only guess > that you might be referring to [PATCH V6] BOOT: Add "bootz" command to > boot Linux zImage on ARM - but I'd rather be sure. Yes, see above two links please. > > > I believe this patch is quite important to the linux-arm people and early > > adoption of this stuff would be very beneficial. Also, there are other > > patches that were applied after the MW was closed. Finally, this patch > > started long before .04 release cycle. > > Where/when? If you mean the patch, here: http://patchwork.ozlabs.org/patch/125318/ If you talk about accepting patches way past MW, almost all the time, at least in the ARM stuffs. And this works OK so far I believe, I see no breakage. Also, we didn't reach the RC phase yet either. Lastly, this change is not intrusive in any way. > > Best regards, > > Wolfgang Denk Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-23 8:36 ` Marek Vasut @ 2012-03-28 20:54 ` Marek Vasut 0 siblings, 0 replies; 18+ messages in thread From: Marek Vasut @ 2012-03-28 20:54 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > > Dear Marek Vasut, > > > > In message <201203221745.16226.marek.vasut@gmail.com> you wrote: > > > > > Dear Wolfgang Denk, are we OK with applying this and bootz patch > > > > > please? Can we get it into .04 release please? > > > > > > > > "this" - which patch version exactly are you referring to? > > > > > > Revision V6. > > > > Could you please be a bit more specific? Like posting a link to the > > respective message on gmane, or in patchwork? > > http://patchwork.ozlabs.org/patch/146848/ > http://patchwork.ozlabs.org/patch/147440/ > > > The Subject: of this message is "BOOT: Add RAW ramdisk support to > > bootz", but I have not seen any V6 for this patch. Ican only guess > > that you might be referring to [PATCH V6] BOOT: Add "bootz" command to > > boot Linux zImage on ARM - but I'd rather be sure. > > Yes, see above two links please. > > > > I believe this patch is quite important to the linux-arm people and > > > early adoption of this stuff would be very beneficial. Also, there are > > > other patches that were applied after the MW was closed. Finally, this > > > patch started long before .04 release cycle. > > > > Where/when? > > If you mean the patch, here: > http://patchwork.ozlabs.org/patch/125318/ > > If you talk about accepting patches way past MW, almost all the time, at > least in the ARM stuffs. And this works OK so far I believe, I see no > breakage. Also, we didn't reach the RC phase yet either. Lastly, this > change is not intrusive in any way. > > > Best regards, > > > > Wolfgang Denk Did you made up your mind on this patch please? Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-18 21:47 ` [U-Boot] [PATCH] " Rob Herring 2012-03-22 9:10 ` Marek Vasut @ 2012-03-30 21:01 ` Wolfgang Denk 2012-03-30 21:12 ` Wolfgang Denk 2 siblings, 0 replies; 18+ messages in thread From: Wolfgang Denk @ 2012-03-30 21:01 UTC (permalink / raw) To: u-boot Dear Rob Herring, In message <1332107278-24123-1-git-send-email-robherring2@gmail.com> you wrote: > From: Marek Vasut <marek.vasut@gmail.com> > > 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 at aribaud.net > Cc: afleming at 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> > --- > V3: > - fix operation when CONFIG_FIT is enabled as FIT images use > <addr>[:<subimage>] > > README | 5 +++++ > common/cmd_bootm.c | 6 ++++-- > common/image.c | 15 ++++++++++++--- > 3 files changed, 21 insertions(+), 5 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Never ascribe to malice that which can adequately be explained by stupidity. ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-18 21:47 ` [U-Boot] [PATCH] " Rob Herring 2012-03-22 9:10 ` Marek Vasut 2012-03-30 21:01 ` Wolfgang Denk @ 2012-03-30 21:12 ` Wolfgang Denk 2 siblings, 0 replies; 18+ messages in thread From: Wolfgang Denk @ 2012-03-30 21:12 UTC (permalink / raw) To: u-boot Dear Rob & Marek, In message <1332107278-24123-1-git-send-email-robherring2@gmail.com> you wrote: > From: Marek Vasut <marek.vasut@gmail.com> > > 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 at aribaud.net > Cc: afleming at 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> > --- > V3: > - fix operation when CONFIG_FIT is enabled as FIT images use > <addr>[:<subimage>] Argh... This causes build warnings: + ./MAKEALL TQM860L Configuring for TQM860L board... image.c: In function 'boot_get_ramdisk': image.c:800: warning: unused variable 'end' Why do I get this at all? I did not enable any of the related bootz stuff on my board! Please fix! Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Vulcans believe peace should not depend on force. -- Amanda, "Journey to Babel", stardate 3842.3 ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz @ 2012-03-16 0:19 Marek Vasut 2012-03-16 7:30 ` Wolfgang Denk 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-16 0:19 UTC (permalink / raw) To: u-boot 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> Cc: Tom Warren <TWarren@nvidia.com> Cc: albert.u.boot at aribaud.net Cc: afleming at 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> --- common/cmd_bootm.c | 6 ++++-- common/image.c | 25 +++++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) NOTE: This patch depends on previous zImage/bootz patch. Testers are very welcome! diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 9efac8b..872a49c 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1628,9 +1628,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 95c7a15..e9d87d8 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; @@ -845,10 +846,18 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, } else #endif { - rd_addr = simple_strtoul(argv[2], NULL, 16); + rd_addr = simple_strtoul(argv[2], &end, 16); debug("* ramdisk: cmdline image address = " "0x%08lx\n", rd_addr); + + if (end[0] == ':') { + rd_len = simple_strtoul(++end, + NULL, 16); + debug("* ramdisk: cmdline image " + "length = 0x%08lx\n", + rd_len); + } } #if defined(CONFIG_FIT) } else { @@ -990,9 +999,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; + /* + * Check if rd_len was manually overridden, if it was, + * we're loading RAW ramdisk. + */ + if (rd_len != 0) { + rd_data = rd_addr; + } else { + 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, -- 1.7.9 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-16 0:19 Marek Vasut @ 2012-03-16 7:30 ` Wolfgang Denk 2012-03-16 8:45 ` Marek Vasut 0 siblings, 1 reply; 18+ messages in thread From: Wolfgang Denk @ 2012-03-16 7:30 UTC (permalink / raw) To: u-boot Dear Marek Vasut, In message <1331857196-29512-1-git-send-email-marex@denx.de> you wrote: > 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 ... > --- 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; > @@ -845,10 +846,18 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, > } else > #endif > { > - rd_addr = simple_strtoul(argv[2], NULL, 16); > + rd_addr = simple_strtoul(argv[2], &end, 16); > debug("* ramdisk: cmdline image address = " > "0x%08lx\n", > rd_addr); > + > + if (end[0] == ':') { > + rd_len = simple_strtoul(++end, > + NULL, 16); > + debug("* ramdisk: cmdline image " > + "length = 0x%08lx\n", > + rd_len); > + } This is common code, which gets used not only for bootz. I see a number of problems: - You add code size even for systems which don't enable "bootz" support. - You change the syntax of all boot related commands where a ramdisk address may be passed (i. e. "bootm") without documenting it. - Using this syntax with a mkimage wrapped ramdisk image will cause bad things to happen, even if you specific the correct size. The API should be more robust. > + /* > + * Check if rd_len was manually overridden, if it was, > + * we're loading RAW ramdisk. > + */ This is undocumented policy, and I dislike such a side-effect based design (if we have a size parameter, it must be a raw image). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Do you suppose the reason the ends of the `Intel Inside' logo don't match up is that it was drawn on a Pentium? ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-16 7:30 ` Wolfgang Denk @ 2012-03-16 8:45 ` Marek Vasut 2012-03-16 11:09 ` Wolfgang Denk 0 siblings, 1 reply; 18+ messages in thread From: Marek Vasut @ 2012-03-16 8:45 UTC (permalink / raw) To: u-boot Dear Wolfgang Denk, > Dear Marek Vasut, > > In message <1331857196-29512-1-git-send-email-marex@denx.de> you wrote: > > 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 > > ... > > > --- 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; > > > > @@ -845,10 +846,18 @@ int boot_get_ramdisk(int argc, char * const argv[], > > bootm_headers_t *images, > > > > } else > > > > #endif > > > > { > > > > - rd_addr = simple_strtoul(argv[2], NULL, 16); > > + rd_addr = simple_strtoul(argv[2], &end, 16); > > > > debug("* ramdisk: cmdline image address = " > > > > "0x%08lx\n", > > rd_addr); > > > > + > > + if (end[0] == ':') { > > + rd_len = simple_strtoul(++end, > > + NULL, 16); > > + debug("* ramdisk: cmdline image " > > + "length = 0x%08lx\n", > > + rd_len); > > + } > > This is common code, which gets used not only for bootz. > > I see a number of problems: > > - You add code size even for systems which don't enable "bootz" > support. This is a good point, do you agree to introduce CONFIG_SUPPORT_RAW_RAMDISK to enable this feature? > > - You change the syntax of all boot related commands where a ramdisk > address may be passed (i. e. "bootm") without documenting it. Right, this should be documented in the top-level README file? Or is there some other place? > > - Using this syntax with a mkimage wrapped ramdisk image will cause > bad things to happen, even if you specific the correct size. The > API should be more robust. It actually won't. If you use mkimage warped ramdisk, it'll recognise it's magic numbers and simply ignore the stuff behind ":". Though I hope noone in sane mind would do that. > > > + /* > > + * Check if rd_len was manually overridden, if it was, > > + * we're loading RAW ramdisk. > > + */ > > This is undocumented policy, and I dislike such a side-effect based > design (if we have a size parameter, it must be a raw image). It must not, but if it is, it'll be used as raw. > > Best regards, > > Wolfgang Denk Thanks for good ideas! Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH] BOOT: Add RAW ramdisk support to bootz 2012-03-16 8:45 ` Marek Vasut @ 2012-03-16 11:09 ` Wolfgang Denk 0 siblings, 0 replies; 18+ messages in thread From: Wolfgang Denk @ 2012-03-16 11:09 UTC (permalink / raw) To: u-boot Dear Marek Vasut, In message <201203160945.40467.marex@denx.de> you wrote: > > > - You add code size even for systems which don't enable "bootz" > > support. > > This is a good point, do you agree to introduce CONFIG_SUPPORT_RAW_RAMDISK to > enable this feature? Fine with me - please also document the new option. > > - You change the syntax of all boot related commands where a ramdisk > > address may be passed (i. e. "bootm") without documenting it. > > Right, this should be documented in the top-level README file? Or is there some > other place? Hm... I have no strong opinion here. > > - Using this syntax with a mkimage wrapped ramdisk image will cause > > bad things to happen, even if you specific the correct size. The > > API should be more robust. > > It actually won't. If you use mkimage warped ramdisk, it'll recognise it's magic > numbers and simply ignore the stuff behind ":". Though I hope noone in sane mind > would do that. Argh... Passing arguments that silently get ignored under certain conditions is not something I like to see. And are you sure hat it will work like that? [I mean, has this been tested?] > > > + /* > > > + * Check if rd_len was manually overridden, if it was, > > > + * we're loading RAW ramdisk. > > > + */ > > > > This is undocumented policy, and I dislike such a side-effect based > > design (if we have a size parameter, it must be a raw image). > > It must not, but if it is, it'll be used as raw. Sorry, I cannot parse this. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de One possible reason that things aren't going according to plan is that there never was a plan in the first place. ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2012-03-30 21:12 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <Message-Id: <1331857196-29512-1-git-send-email-marex@denx.de> 2012-03-16 14:02 ` [U-Boot] [PATCH V2] BOOT: Add RAW ramdisk support to bootz Marek Vasut 2012-03-16 15:54 ` Rob Herring 2012-03-16 21:30 ` Marek Vasut 2012-03-18 21:47 ` [U-Boot] [PATCH] " Rob Herring 2012-03-22 9:10 ` Marek Vasut 2012-03-22 12:14 ` Rob Herring 2012-03-22 12:45 ` Marek Vasut 2012-03-22 13:33 ` Wolfgang Denk 2012-03-22 16:45 ` Marek Vasut 2012-03-22 23:04 ` Wolfgang Denk 2012-03-23 8:36 ` Marek Vasut 2012-03-28 20:54 ` Marek Vasut 2012-03-30 21:01 ` Wolfgang Denk 2012-03-30 21:12 ` Wolfgang Denk 2012-03-16 0:19 Marek Vasut 2012-03-16 7:30 ` Wolfgang Denk 2012-03-16 8:45 ` Marek Vasut 2012-03-16 11:09 ` Wolfgang Denk
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.