Skip to contentSkip to conversation

bootm: Move fixup_silent_linux() earlier in the bootm stages

PATCH New Simon Glass 2 participants 7 messages Jul 17, 2013 – Aug 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bootm: Move fixup_silent_linux() earlier in the bootm stages

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.

---
 common/cmd_bootm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
common/cmd_bootm.c +4 -4
index c18157c..c0eabd2 100644
@@ -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 */
Signature · 1 line
1.8.3
#1 lore raw

PATCH 1/3 bootm: Move fixup_silent_linux() earlier in the bootm stages

Hi Tom,

Quoted 10 lines · Simon Glass

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.

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

#2 lore raw

PATCH 2/3 RFC: bootm: Add silent_linux environment variable

In reply to Simon Glass

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.

---
 README             |  6 ++++++
 common/cmd_bootm.c | 14 ++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
README +6 -0
index 33b5728..c6d6851 100644
@@ -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.
 
common/cmd_bootm.c +12 -2
index c0eabd2..6d1d644 100644
@@ -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);
Signature · 1 line
1.8.3
#3 lore raw

PATCH 2/3 RFC: bootm: Add silent_linux environment variable

Quoted 7 lines · Simon Glass

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
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>
#4 lore raw

PATCH 3/3 image: Display FIT timestamp when booting

In reply to Simon Glass

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).

---
 common/image-fit.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
common/image-fit.c +11 -0
index e28dd05..bbb4cad 100644
@@ -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));
 
Signature · 1 line
1.8.3
#5 lore raw

PATCH 3/3 image: Display FIT timestamp when booting

Quoted 10 lines · Simon Glass

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).

Applied to u-boot/master, thanks!

Signature · 8 lines
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>
#6 lore raw

PATCH 1/3 bootm: Move fixup_silent_linux() earlier in the bootm stages

In reply to Simon Glass
Quoted 9 lines · Simon Glass

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
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>