Skip to contentSkip to conversation

Improve output of bootm command

PATCH New Andrew Murray 3 participants 7 messages Sep 10, 2011 – Sep 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve output of bootm command

It's common for the bootm command to move a provided image in memory prior to it's execution - this move can contribute to increased boot times. This move is often seen in poorly configured devices which boot from NAND.

This patch improves the output of the bootm command such that when a move occurs it is made clear to the user.

---
 common/cmd_bootm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
common/cmd_bootm.c +2 -2
index 147e8de..b5f28b0 100644
@@ -346,8 +346,8 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress)
 	case IH_COMP_NONE:
 		if (load == blob_start || load == image_start) {
 			printf ("   XIP %s ... ", type_name);
-		} else {
-			printf ("   Loading %s ... ", type_name);
+		} else if (load != image_start) {
+			printf ("   Moving %s ... ", type_name);
 			memmove_wd ((void *)load, (void *)image_start,
 					image_len, CHUNKSZ);
 		}
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 Improve output of bootm command

Dear Andrew Murray,

Quoted 7 lines · In message <[email protected]> you wrote:

It's common for the bootm command to move a provided image in memory prior to it's execution - this move can contribute to increased boot times. This move is often seen in poorly configured devices which boot from NAND.

This patch improves the output of the bootm command such that when a move occurs it is made clear to the user.

Sorry, but I don't want to have this output. It would be always be printed for all systems booting from NOR flash, where the copy operation is absolutely normal.

Also, on all PowerPC systems it is absolutely normal that you must load the image to a different address in RAM, because otherwise you would overwrite the exception vectors and thus crash U-Boot.

What you are trying to "warn" about is an absolutely normal use case, and there is no reason for additional output.

Yes, there may be systems that could work more efficiently, but there are many areas where you can optimize (starting with the Linux image building).

Sorry, but NAK.

Best regards,

Wolfgang Denk

Signature · 4 lines
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
There's no future in time travel.
#2 lore raw

PATCH 1/1 Improve output of bootm command

Hi,

Quoted 8 lines · Wolfgang Denk

Sorry, but I don't want to have this output. It would be always be printed for all systems booting from NOR flash, where the copy operation is absolutely normal.

Also, on all PowerPC systems it is absolutely normal that you must load the image to a different address in RAM, because otherwise you would overwrite the exception vectors and thus crash U-Boot.

Quoted 7 lines

What you are trying to "warn" about is an absolutely normal use case, and there is no reason for additional output.

Yes, there may be systems that could work more efficiently, but there are many areas where you can optimize (starting with the Linux image building).

Yes I understand your point but perhaps my description was not very useful.

The patch doesn't add any additional messages or output or anything which indicates something is not ideal. Instead it renames the exiting 'Loading' text to a arguably more descriptive 'Moving' text - and removes the message all together when the move operation doesn't occur.

Thanks,

Andrew Murray

#3 lore raw

PATCH 1/1 Improve output of bootm command

In reply to Andrew Murray

common/cmd_bootm.c static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) · line 349

Quoted 7 lines · On Saturday, September 10, 2011 10:57:47 Andrew Murray wrote:
common/cmd_bootm.c +1 -1
 
 		if (load == blob_start || load == image_start) {
..........
-		} else {
+		} else if (load != image_start) {

sorry, but why does this new if() make any sense ? the only way this else branch could execute is if load != image_start since load == image_start was explicitly handled in the first if check.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110911/4c32a1a0/attachment.pgp

#4 lore raw

PATCH 1/1 Improve output of bootm command

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday, September 10, 2011 10:57:47 Andrew Murray wrote:
common/cmd_bootm.c +0 -0
Quoted 11 lines

common/cmd_bootm.c static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) · line 349

Quoted 4 lines
              if (load == blob_start || load == image_start) {
                      ..........
common/cmd_bootm.c +1 -1
-             } else {
+             } else if (load != image_start) {

sorry, but why does this new if() make any sense ? the only way this else branch could execute is if load != image_start since load == image_start was
explicitly handled in the first if check.
-mike

Yes that's correct. The move is executed and a print statement displayed - only when the load address differs from the image start address. In other words the patch prevents unnecessary/confusing output and a call to a function that doesn't do anything when load == image_start.

Andrew Murray

#5 lore raw

PATCH 1/1 Improve output of bootm command

Quoted 15 lines · On Sunday, September 11, 2011 16:13:26 Andrew Murray wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday, September 10, 2011 10:57:47 Andrew Murray wrote:
common/cmd_bootm.c +0 -0
Quoted 9 lines

common/cmd_bootm.c static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) · line 349

Quoted 4 lines
              if (load == blob_start || load == image_start) {
                      ..........
common/cmd_bootm.c +1 -1
-             } else {
+             } else if (load != image_start) {

sorry, but why does this new if() make any sense ? the only way this else branch could execute is if load != image_start since load == image_start was
explicitly handled in the first if check.

Quoted 4 lines

Yes that's correct. The move is executed and a print statement displayed - only when the load address differs from the image start address. In other words the patch prevents unnecessary/confusing output and a call to a function that doesn't do anything when load == image_start.

i think you missed my point. your proposed change to the "else" branch makes no difference to the existing code.

current code:

if (load == image_start) {
	...
} else {
	...
}

your new code:

if (load == image_start) {
	...
} else if (load != image_start) {
	...
}

your change to the if statement is pointless ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110911/30f82804/attachment.pgp

#6 lore raw

PATCH 1/1 Improve output of bootm command

Hi Mike,

Quoted 2 lines · Mike Frysinger

your change to the if statement is pointless ?

You are right - I thought I was going crazy then?realized I made this patch on an earlier version of the code which didn't have the load == image_start check in the first line (see
http://git.denx.de/?p=u-boot.git;a=commitdiff;h=02cf345973a7fe9986626448a089ed54f1a26d13
from January). I must have blindly moved this patch forward. I will get my tools in order.

Many thanks for you patience.

Andrew Murray