public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags
@ 2014-10-08 20:49 Alexey Ignatov
  2014-10-08 22:10 ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Ignatov @ 2014-10-08 20:49 UTC (permalink / raw)
  To: u-boot

mkimage -T mxs now support new flags in config file:
NODISPLAYPROGRESS - makes boot silent
VERBOSEPROGRESS - makes boot progress display more verbose

Signed-off-by: Alexey Ignatov <lexszero@gmail.com>
---
 tools/mxsimage.c | 41 ++++++++++++++++++++++++++++++++++-------
 tools/mxsimage.h |  6 +++++-
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/tools/mxsimage.c b/tools/mxsimage.c
index 045b35a..55c6691 100644
--- a/tools/mxsimage.c
+++ b/tools/mxsimage.c
@@ -124,7 +124,8 @@ struct sb_image_ctx {
 	unsigned int			in_section:1;
 	unsigned int			in_dcd:1;
 	/* Image configuration */
-	unsigned int			verbose_boot:1;
+	unsigned int			display_progress:1;
+	unsigned int			verbose_progress:1;
 	unsigned int			silent_dump:1;
 	char				*input_filename;
 	char				*output_filename;
@@ -1328,8 +1329,9 @@ static int sb_prefill_image_header(struct sb_image_ctx *ictx)
 		sizeof(struct sb_sections_header) / SB_BLOCK_SIZE;
 	hdr->timestamp_us = sb_get_timestamp() * 1000000;
 
-	/* FIXME -- add proper config option */
-	hdr->flags = ictx->verbose_boot ? SB_IMAGE_FLAG_VERBOSE : 0,
+	hdr->flags =
+		ictx->display_progress ? SB_IMAGE_FLAG_DISPLAY_PROGRESS : 0 |
+		ictx->verbose_progress ? SB_IMAGE_FLAG_VERBOSE_PROGRESS : 0,
 
 	/* FIXME -- We support only default key */
 	hdr->key_count = 1;
@@ -1447,6 +1449,30 @@ static int sb_parse_line(struct sb_image_ctx *ictx, struct sb_cmd_list *cmd)
 	}
 
 	cmd->cmd = rptr;
+	
+	/* clear DISPLAY_PROGRESS flag */
+	if (!strcmp(tok, "NODISPLAYPROGRESS")) {
+		if (ictx->verbose_progress) {
+			fprintf(stderr, 
+					"#%i ERR: VERBOSEPROGRESS incompatible with NODISPLAYPROGRESS\n",
+					cmd->lineno);
+			return -EINVAL;
+		}
+		ictx->display_progress = 0;
+		return 0;
+	}
+
+	/* set VERBOSE_PROGRESS flag */
+	if (!strcmp(tok, "VERBOSEPROGRESS")) {
+		if (!ictx->display_progress) {
+			fprintf(stderr, 
+					"#%i ERR: VERBOSEPROGRESS incompatible with NODISPLAYPROGRESS\n",
+					cmd->lineno);
+			return -EINVAL;
+		}
+		ictx->verbose_progress = 1;
+		return 0;
+	}
 
 	/* DCD */
 	if (!strcmp(tok, "DCD")) {
@@ -1701,10 +1727,11 @@ static int sb_verify_image_header(struct sb_image_ctx *ictx,
 		 ntohs(hdr->component_version.minor),
 		 ntohs(hdr->component_version.revision));
 
-	if (hdr->flags & ~SB_IMAGE_FLAG_VERBOSE)
+	if (hdr->flags & ~SB_IMAGE_FLAGS_MASK)
 		ret = -EINVAL;
-	soprintf(ictx, "%s Image flags:                  %s\n", stat[!!ret],
-		 hdr->flags & SB_IMAGE_FLAG_VERBOSE ? "Verbose_boot" : "");
+	soprintf(ictx, "%s Image flags:                  %s %s\n", stat[!!ret],
+		 hdr->flags & SB_IMAGE_FLAG_DISPLAY_PROGRESS ? "Display_progress" : "",
+		 hdr->flags & SB_IMAGE_FLAG_VERBOSE_PROGRESS ? "Verbose_progress" : "");
 	if (ret)
 		return ret;
 
@@ -2305,7 +2332,7 @@ static int mxsimage_generate(struct image_tool_params *params,
 
 	ctx.cfg_filename = params->imagename;
 	ctx.output_filename = params->imagefile;
-	ctx.verbose_boot = 1;
+	ctx.display_progress = 1;
 
 	ret = sb_build_tree_from_cfg(&ctx);
 	if (ret)
diff --git a/tools/mxsimage.h b/tools/mxsimage.h
index 6cd59d2..01624f7 100644
--- a/tools/mxsimage.h
+++ b/tools/mxsimage.h
@@ -82,7 +82,11 @@ struct sb_boot_image_header {
 #define	SB_VERSION_MINOR	1
 
 /* Enable to HTLLC verbose boot report. */
-#define SB_IMAGE_FLAG_VERBOSE	(1 << 0)
+#define SB_IMAGE_FLAG_DISPLAY_PROGRESS	(1 << 0)
+#define SB_IMAGE_FLAG_VERBOSE_PROGRESS	(1 << 1)
+#define SB_IMAGE_FLAGS_MASK \
+	(SB_IMAGE_FLAG_DISPLAY_PROGRESS | \
+	 SB_IMAGE_FLAG_VERBOSE_PROGRESS)
 
 struct sb_key_dictionary_key {
 	/* The CBC-MAC of image and sections header. */
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags
  2014-10-08 20:49 [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags Alexey Ignatov
@ 2014-10-08 22:10 ` Marek Vasut
  2014-10-08 22:29   ` Alexey Ignatov
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2014-10-08 22:10 UTC (permalink / raw)
  To: u-boot

On Wednesday, October 08, 2014 at 10:49:38 PM, Alexey Ignatov wrote:
> mkimage -T mxs now support new flags in config file:
> NODISPLAYPROGRESS - makes boot silent

Please make this the other way -- that is, add flag to make the display not-
silent. What does this mean anyway?

> VERBOSEPROGRESS - makes boot progress display more verbose

And how is the above different from this new flag?

Please document those flags in doc/README.mxsimage too.

The code looks mostly OK, thanks !

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags
  2014-10-08 22:10 ` Marek Vasut
@ 2014-10-08 22:29   ` Alexey Ignatov
  2014-10-08 22:48     ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Ignatov @ 2014-10-08 22:29 UTC (permalink / raw)
  To: u-boot

2014-10-09 2:10 GMT+04:00 Marek Vasut <marex@denx.de>:
> On Wednesday, October 08, 2014 at 10:49:38 PM, Alexey Ignatov wrote:
>> mkimage -T mxs now support new flags in config file:
>> NODISPLAYPROGRESS - makes boot silent
> Please make this the other way -- that is, add flag to make the display not-
> silent. What does this mean anyway?

Default behaviour of current MXS booting is to print HTLLCHTLLC
characters when before usual uboot output - it is a feature to debug
early boot stages, signatures checking, etc. Negation here to not
break default behaviour

>> VERBOSEPROGRESS - makes boot progress display more verbose
> And how is the above different from this new flag?

I'm not really sure what this does (I haven't seen any differences
with this flag on and off), but
http://www.rockbox.org/wiki/SbFileFormat mentions existence of this
bit. Unfortunately, Freescale documentation is not full and a bit hard
to search and use :(

> Please document those flags in doc/README.mxsimage too.
> The code looks mostly OK, thanks !

Thank you for comments, I'll add documentation, fix DISPLAYPROGRESS
and post a v2 of the patch.

Regards,
Alexey Ignatov

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags
  2014-10-08 22:29   ` Alexey Ignatov
@ 2014-10-08 22:48     ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2014-10-08 22:48 UTC (permalink / raw)
  To: u-boot

On Thursday, October 09, 2014 at 12:29:10 AM, Alexey Ignatov wrote:
> 2014-10-09 2:10 GMT+04:00 Marek Vasut <marex@denx.de>:
> > On Wednesday, October 08, 2014 at 10:49:38 PM, Alexey Ignatov wrote:
> >> mkimage -T mxs now support new flags in config file:
> >> NODISPLAYPROGRESS - makes boot silent
> > 
> > Please make this the other way -- that is, add flag to make the display
> > not- silent. What does this mean anyway?
> 
> Default behaviour of current MXS booting is to print HTLLCHTLLC
> characters when before usual uboot output - it is a feature to debug
> early boot stages, signatures checking, etc. Negation here to not
> break default behaviour

That's OK, you can just patch the arch/arm/cpu/arm926ejs/mxs/mxsimage*cfg to 
keep the behavior intact.

> >> VERBOSEPROGRESS - makes boot progress display more verbose
> > 
> > And how is the above different from this new flag?
> 
> I'm not really sure what this does (I haven't seen any differences
> with this flag on and off), but
> http://www.rockbox.org/wiki/SbFileFormat mentions existence of this
> bit. Unfortunately, Freescale documentation is not full and a bit hard
> to search and use :(

Do we need this at all then ?

> > Please document those flags in doc/README.mxsimage too.
> > The code looks mostly OK, thanks !
> 
> Thank you for comments, I'll add documentation, fix DISPLAYPROGRESS
> and post a v2 of the patch.

Thanks!

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-08 22:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 20:49 [U-Boot] [PATCH] ARM: mxs: tools: Add support for verbose and silent boot progress flags Alexey Ignatov
2014-10-08 22:10 ` Marek Vasut
2014-10-08 22:29   ` Alexey Ignatov
2014-10-08 22:48     ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox