All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Configuring U-Boot for MPC8349E in little endian mode
Date: Fri, 02 May 2008 14:47:48 -0500	[thread overview]
Message-ID: <481B6FE4.3090904@freescale.com> (raw)
In-Reply-To: <481B46D5.6050605@ovro.caltech.edu>

David Hawkins wrote:

> 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.

That's why we use cpu_to_be32() to write to big-endian registers.  On a
big-endian processor, this macro doesn't modify the parameter.  So,

	*p = be32_to_cpu(12);

will be compiled to

	*p = 12;

On a little-endian process, the macro will do a byte-swap.

This macro, and others like it, eliminates the need to have two different
versions of the code.

> DMA would be used to move a block of data, not to manipulate
> a register.

I can see you've never written an audio driver before.  The data itself has
endianness, and the register may require the data to appear in one endian or
another.  If

-- 
Timur Tabi
Linux kernel developer at Freescale

  reply	other threads:[~2008-05-02 19:47 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
2008-05-02 19:47       ` Timur Tabi [this message]
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=481B6FE4.3090904@freescale.com \
    --to=timur@freescale.com \
    --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.