From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Scholz Date: Fri, 10 Jun 2005 13:43:53 +0200 Subject: [U-Boot-Users] Bug in cmd_bootm.c (byteorder) Message-ID: <42A97CF9.4000800@imc-berlin.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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