All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hawkins <dwh@ovro.caltech.edu>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Configuring U-Boot for MPC8349E in little endian mode
Date: Fri, 02 May 2008 09:52:37 -0700	[thread overview]
Message-ID: <481B46D5.6050605@ovro.caltech.edu> (raw)
In-Reply-To: <481B265B.8060601@freescale.com>


Hi Vivek,

Just to clarify these comments:

> It would be a lot easier if you modified the application to work on big-endian
> and little-endian.  Just look through the code in places where the endian
> matters, and add cpu_to_be32() and be32_to_cpu() (or similar functions).

When you are dealing with a driver, register accesses need to be
in a specific format. The MPC8349EA has some of its registers
in big-endian format, and others in little-endian format.
Regardless of the mode you operate your processor, you will
*have* to use the correct byte-swap functions.

> The only time this will be real problem is with DMA, since on 83xx you cannot
> modify the data during a DMA transfer.
> 

DMA would be used to move a block of data, not to manipulate
a register. If encode/decode functions are used to move blocks
of data, then the data is in byte-stream format, which does
not change when the endian-order of the processor changes.
Each byte occurs in the same order.

You mention you are trying to re-use an existing code base.
Keep in mind that just because the old code works, doesn't mean it
is good code. If the code was not written to be endian-neutral,
then it wasn't portable in the first place, so should be
corrected.

Cheers,
Dave

  reply	other threads:[~2008-05-02 16:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 15:34 [U-Boot-Users] Configuring U-Boot for MPC8349E in little endian mode vivek.trivedi at wipro.com
2008-04-30 15:45 ` Wolfgang Denk
2008-04-30 22:13 ` David Hawkins
2008-05-02  6:14 ` vivek.trivedi at wipro.com
2008-05-02  7:22   ` Kumar Gala
2008-05-02 12:38   ` Jerry Van Baren
2008-05-02 16:35   ` David Hawkins
2008-05-02  9:19 ` vivek.trivedi at wipro.com
2008-05-02 14:34   ` Timur Tabi
2008-05-02 16:52     ` David Hawkins [this message]
2008-05-02 19:47       ` Timur Tabi
2008-05-02 20:23         ` David Hawkins
2008-05-02 20:30           ` Timur Tabi
2008-05-02 21:48             ` David Hawkins

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=481B46D5.6050605@ovro.caltech.edu \
    --to=dwh@ovro.caltech.edu \
    --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.