public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Bug in cmd_bootm.c (byteorder)
@ 2005-06-10 11:43 Steven Scholz
  2005-06-10 14:14 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Scholz @ 2005-06-10 11:43 UTC (permalink / raw)
  To: u-boot

Hi there,

IIUC then numbers in image headers (image_header_t) are stored in network 
byteorder. So when manipulating image headers on the target (i.e. 
overwriting ih_load) this has to be done in network byteorder.

I noticed a problem when passing a second argument to bootm

#> bootm 20500000 20400000

on an ARM platform.

The data from the my "ARM U-Boot Standalone Program (uncompressed)" was 
wrongly copied to 0x00004020!

So I suggest the following buxfix:

Index: common/cmd_bootm.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/common/cmd_bootm.c,v
retrieving revision 1.42
diff -u -r1.42 cmd_bootm.c
--- common/cmd_bootm.c  3 Apr 2005 21:11:18 -0000       1.42
+++ common/cmd_bootm.c  10 Jun 2005 11:43:11 -0000
@@ -261,7 +261,7 @@
                 name = "Standalone Application";
                 /* A second argument overwrites the load address */
                 if (argc > 2) {
-                       hdr->ih_load = simple_strtoul(argv[2], NULL, 16);
+                       hdr->ih_load = htonl(simple_strtoul(argv[2], NULL, 16));
                 }
                 break;
         case IH_TYPE_KERNEL:

--
Steven

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

end of thread, other threads:[~2005-06-10 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-10 11:43 [U-Boot-Users] Bug in cmd_bootm.c (byteorder) Steven Scholz
2005-06-10 14:14 ` Wolfgang Denk

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