All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages
@ 2013-07-17  3:09 Simon Glass
  2013-07-17  3:10 ` [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable Simon Glass
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Simon Glass @ 2013-07-17  3:09 UTC (permalink / raw)
  To: u-boot

Before the bootm refactor, fixup_silent_linux() was done only in the
monolithic bootm case, not in the subcommand case. With the refactor, it
is done always, which is good. Unfortunately it is done too late, since it
is the PREP or CMDLINE stages that set up the command line for Linux.

Move fixup_silent_linux() into the LOADOS stage, which is where we find
out the OS being used, and can thus decide whether to perform this step.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/cmd_bootm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index c18157c..c0eabd2 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -542,10 +542,6 @@ static int boot_selected_os(int argc, char * const argv[], int state,
 		bootm_start_standalone(argc, argv);
 		return 0;
 	}
-#ifdef CONFIG_SILENT_CONSOLE
-	if (images->os.os == IH_OS_LINUX)
-		fixup_silent_linux();
-#endif
 	arch_preboot_os();
 	boot_fn(state, argc, argv, images);
 	if (state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */
@@ -656,6 +652,10 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,
 			goto err;
 		else if (ret == BOOTM_ERR_OVERLAP)
 			ret = 0;
+#ifdef CONFIG_SILENT_CONSOLE
+		if (images->os.os == IH_OS_LINUX)
+			fixup_silent_linux();
+#endif
 	}
 
 	/* Relocate the ramdisk */
-- 
1.8.3

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

* [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable
  2013-07-17  3:09 [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
@ 2013-07-17  3:10 ` Simon Glass
  2013-08-18 21:49   ` [U-Boot] [U-Boot, " Tom Rini
  2013-07-17  3:10 ` [U-Boot] [PATCH 3/3] image: Display FIT timestamp when booting Simon Glass
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2013-07-17  3:10 UTC (permalink / raw)
  To: u-boot

At present the console for linux is silent if the U-Boot console is silent,
unless CONFIG_SILENT_U_BOOT_ONLY is set. I wonder if a better way would be
to have an environment variable to control this? Then we can control the
verbosity from scripts, and set the variable to 'no' for those boards that
want Linux to boot with console output.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 README             |  6 ++++++
 common/cmd_bootm.c | 14 ++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 33b5728..c6d6851 100644
--- a/README
+++ b/README
@@ -4567,6 +4567,12 @@ List of environment variables (most likely not complete):
 
   npe_ucode	- set load address for the NPE microcode
 
+  silent_linux  - If set then linux will be told to boot silently, by
+		  changing the console to be empty. If "yes" it will be
+		  made silent. If "no" it will not be made silent. If
+		  unset, then it will be made silent if the U-Boot console
+		  is silent.
+
   tftpsrcport	- If this is set, the value is used for TFTP's
 		  UDP source port.
 
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index c0eabd2..6d1d644 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -1400,9 +1400,19 @@ static void fixup_silent_linux(void)
 	char *buf;
 	const char *env_val;
 	char *cmdline = getenv("bootargs");
+	int want_silent;
 
-	/* Only fix cmdline when requested */
-	if (!(gd->flags & GD_FLG_SILENT))
+	/*
+	 * Only fix cmdline when requested. The environment variable can be:
+	 *
+	 *	no - we never fixup
+	 *	yes - we always fixup
+	 *	unset - we rely on the console silent flag
+	 */
+	want_silent = getenv_yesno("silent_linux");
+	if (want_silent == 0)
+		return;
+	else if (want_silent == -1 && !(gd->flags & GD_FLG_SILENT))
 		return;
 
 	debug("before silent fix-up: %s\n", cmdline);
-- 
1.8.3

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

* [U-Boot] [PATCH 3/3] image: Display FIT timestamp when booting
  2013-07-17  3:09 [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
  2013-07-17  3:10 ` [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable Simon Glass
@ 2013-07-17  3:10 ` Simon Glass
  2013-08-18 21:49   ` [U-Boot] [U-Boot, " Tom Rini
  2013-07-17  3:11 ` [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
  2013-07-17 14:38 ` Tom Rini
  3 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2013-07-17  3:10 UTC (permalink / raw)
  To: u-boot

The timestamp is shown in fit_print_contents() but for some reason not
in fit_image_print(). This seems to be an oversight, since it is the latter
which is used by bootm.

Add timestamp printing in this case.

(There is code duplication in these two function, for looking at in a future
patch).

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/image-fit.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/common/image-fit.c b/common/image-fit.c
index e28dd05..bbb4cad 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -359,6 +359,17 @@ void fit_image_print(const void *fit, int image_noffset, const char *p)
 	else
 		printf("%s\n", desc);
 
+	if (IMAGE_ENABLE_TIMESTAMP) {
+		time_t timestamp;
+
+		ret = fit_get_timestamp(fit, 0, &timestamp);
+		printf("%s  Created:      ", p);
+		if (ret)
+			printf("unavailable\n");
+		else
+			genimg_print_time(timestamp);
+	}
+
 	fit_image_get_type(fit, image_noffset, &type);
 	printf("%s  Type:         %s\n", p, genimg_get_type_name(type));
 
-- 
1.8.3

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

* [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages
  2013-07-17  3:09 [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
  2013-07-17  3:10 ` [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable Simon Glass
  2013-07-17  3:10 ` [U-Boot] [PATCH 3/3] image: Display FIT timestamp when booting Simon Glass
@ 2013-07-17  3:11 ` Simon Glass
  2013-07-17 14:38 ` Tom Rini
  3 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2013-07-17  3:11 UTC (permalink / raw)
  To: u-boot

Hi Tom,

On Tue, Jul 16, 2013 at 9:09 PM, Simon Glass <sjg@chromium.org> wrote:

> Before the bootm refactor, fixup_silent_linux() was done only in the
> monolithic bootm case, not in the subcommand case. With the refactor, it
> is done always, which is good. Unfortunately it is done too late, since it
> is the PREP or CMDLINE stages that set up the command line for Linux.
>
> Move fixup_silent_linux() into the LOADOS stage, which is where we find
> out the OS being used, and can thus decide whether to perform this step.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
>

I think this one should be considered for the release (the others in the
series are for later). I found the problem while testing this feature.

Regards,
Simon

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

* [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages
  2013-07-17  3:09 [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
                   ` (2 preceding siblings ...)
  2013-07-17  3:11 ` [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
@ 2013-07-17 14:38 ` Tom Rini
  3 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2013-07-17 14:38 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 16, 2013 at 08:09:59PM -0700, Simon Glass wrote:

> Before the bootm refactor, fixup_silent_linux() was done only in the
> monolithic bootm case, not in the subcommand case. With the refactor, it
> is done always, which is good. Unfortunately it is done too late, since it
> is the PREP or CMDLINE stages that set up the command line for Linux.
> 
> Move fixup_silent_linux() into the LOADOS stage, which is where we find
> out the OS being used, and can thus decide whether to perform this step.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130717/3a75ab4e/attachment.pgp>

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

* [U-Boot] [U-Boot, 2/3] RFC: bootm: Add silent_linux environment variable
  2013-07-17  3:10 ` [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable Simon Glass
@ 2013-08-18 21:49   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2013-08-18 21:49 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 16, 2013 at 08:10:00PM -0700, Simon Glass wrote:

> At present the console for linux is silent if the U-Boot console is silent,
> unless CONFIG_SILENT_U_BOOT_ONLY is set. I wonder if a better way would be
> to have an environment variable to control this? Then we can control the
> verbosity from scripts, and set the variable to 'no' for those boards that
> want Linux to boot with console output.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130818/a20c280e/attachment.pgp>

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

* [U-Boot] [U-Boot, 3/3] image: Display FIT timestamp when booting
  2013-07-17  3:10 ` [U-Boot] [PATCH 3/3] image: Display FIT timestamp when booting Simon Glass
@ 2013-08-18 21:49   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2013-08-18 21:49 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 16, 2013 at 08:10:01PM -0700, Simon Glass wrote:

> The timestamp is shown in fit_print_contents() but for some reason not
> in fit_image_print(). This seems to be an oversight, since it is the latter
> which is used by bootm.
> 
> Add timestamp printing in this case.
> 
> (There is code duplication in these two function, for looking at in a future
> patch).
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130818/29b671f1/attachment.pgp>

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

end of thread, other threads:[~2013-08-18 21:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17  3:09 [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
2013-07-17  3:10 ` [U-Boot] [PATCH 2/3] RFC: bootm: Add silent_linux environment variable Simon Glass
2013-08-18 21:49   ` [U-Boot] [U-Boot, " Tom Rini
2013-07-17  3:10 ` [U-Boot] [PATCH 3/3] image: Display FIT timestamp when booting Simon Glass
2013-08-18 21:49   ` [U-Boot] [U-Boot, " Tom Rini
2013-07-17  3:11 ` [U-Boot] [PATCH 1/3] bootm: Move fixup_silent_linux() earlier in the bootm stages Simon Glass
2013-07-17 14:38 ` Tom Rini

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.