All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Scholz <steven.scholz@imc-berlin.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Bug in cmd_bootm.c (byteorder)
Date: Fri, 10 Jun 2005 13:43:53 +0200	[thread overview]
Message-ID: <42A97CF9.4000800@imc-berlin.de> (raw)

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

             reply	other threads:[~2005-06-10 11:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10 11:43 Steven Scholz [this message]
2005-06-10 14:14 ` [U-Boot-Users] Bug in cmd_bootm.c (byteorder) Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42A97CF9.4000800@imc-berlin.de \
    --to=steven.scholz@imc-berlin.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.