[U-Boot-Users] [PATCH] Fix the condition to detect if an image is already in its place

Uwe Kleine-König ukleinek at informatik.uni-freiburg.de
Thu Mar 15 22:42:29 CET 2007


Before moving the image was skipped if the header started at the load address,
but it's the data that should be at this address.

Signed-off-by: Uwe Kleine-König <ukleinek at informatik.uni-freiburg.de>
---
I didn't test that change yet but I saw it fail without that change.

Best regards
Uwe

 common/cmd_bootm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 7aae8a6..56cdac8 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -318,7 +318,7 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 	switch (hdr->ih_comp) {
 	case IH_COMP_NONE:
-		if(ntohl(hdr->ih_load) == addr) {
+		if(ntohl(hdr->ih_load) == data) {
 			printf ("   XIP %s ... ", name);
 		} else {
 #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-- 
1.5.0.3

Uwe Kleine-König wrote:
> Hello Wolfgang,
> 
> > You download the image  to  an  arbitrary  address  which  should  be
> > sufficiently  out  of  the  way  of  the [load_addr,load_addr+size of
> > uncompressed kernel] area. The bootm will  (uncompress  &)  copy  the
> > image to the load_addr, and jumpt to the entry point.
> With the above command line (i.e. -C none) it will only copy it, not
> uncompress.  But probably you meant that, as you put uncompress in
> parenthesis.
> 
> > > For an image created with the above rule from the vanilla kernel, that
> > > means, jump to the header (instead of the actual image at entry point +
> > > 0x40).
> > 
> > No. The header will not be copied by U-Boot's "bootm" command.
> Ah, OK, I see.  Then you may want to take the patch I'll send as a
> follow up.
>  
> > > So I think the linux rule is wrong, or did I miss anything?
> > 
> > Yes. You talk about two addresses, but there are three.
> > 
> > > PS: Linux uses entry point == load address == 0 for PowerPC.  Didn't
> > > look in the PowerPC version of bootm_linux, but maybe it has the same
> > > problem?
> > 
> > It works the same in this respect. Note that I write *it works*.
> > 
> > > [1] For Linux this is not needed, because the decompressor (at least for
> > > 2.6) is position independant.  But that's another topic.
> > 
> > Right - the decompressor  itself  is  not  needed,  as  it's  already
> > included  in U-Boot. Adding it to the Kernel image just wastes memroy
> > and time as it makes booting slower.
> So you suggest to gzip the vmlinux image and use -C gzip?
>  
> Best regards,
> Uwe
> 
> -- 
> Uwe Kleine-König
> 
> http://www.google.com/search?q=12+mol+in+dozen

-- 
Uwe Kleine-König

http://www.google.com/search?q=parsec%5E2*Joule%2FNewton+in+tablespoon




More information about the U-Boot mailing list