linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Surovegin <ebs@ebshome.net>
To: David Hawkins <dwh@ovro.caltech.edu>
Cc: Stefan Roese <sr@denx.de>, linuxppc-embedded@ozlabs.org
Subject: Re: Yosemite/440EP why are readl()/ioread32() setup to read little-endian?
Date: Wed, 25 Jan 2006 10:51:31 -0800	[thread overview]
Message-ID: <20060125185131.GA7425@gate.ebshome.net> (raw)
In-Reply-To: <43D7C2EF.5060508@ovro.caltech.edu>

On Wed, Jan 25, 2006 at 10:26:55AM -0800, David Hawkins wrote:
> Hi Stefan,
> 
> >>readl() and ioread32() read the registers in little-endian format!
> > 
> > Correct. That's how it is implemented on all platforms. Think for example of 
> > an pci device driver. Using these IO functions, the driver will become 
> > platform independent, running without modifications on little- and big-endian 
> > machines.
> 
> Ok, I figured that was probably the case. Thanks for the confirmation.
> 
> >>Should I just be using pointers for remapped processor
> >>registers, and only use readl(), ioread32(), etc, on external
> >>memory?
> > 
> > That's how I do it. Only use readl() and friends for pci spaces (or other 
> > little endian memory mapped areas).
> 
> I took a look at the Yosemite network and USB drivers, it looks like
> the authors of those drivers chose to use in_be32() and out_be32().
> 
> Personally I like the concept of using pointers, or more usefully
> pointers to structure overlays for device control. However, the
> impression I have is that this is inherently more non-portable
> than using the readl()/writel(), ioread32()/iowrite32(), and
> now I guess I can add in_be32()/out_be32() to that list.
> 
> But if you use pointers, thats good enough for me!

use in_/out_ accessors, not pointers. Look at other 4xx drivers (i2c, 
emac)

Also, you don't have worry about this code being non-portable, because 
every chip has it's own GPIO impl anyway.

-- 
Eugene

  reply	other threads:[~2006-01-25 18:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17  0:45 [Patch 3/3] Add Yellowstone Platform defconfig John Otken
2006-01-24 18:08 ` Yosemite/440EP why are readl()/ioread32() setup to read little-endian? David Hawkins
2006-01-24 19:07   ` Yosemite/440EP is there a global interrupt enable mask? David Hawkins
2006-01-25 10:28     ` Stefan Roese
2006-01-25 18:30       ` David Hawkins
2006-01-25 18:55         ` Eugene Surovegin
2006-01-25 19:46           ` David Hawkins
2006-01-25 20:13             ` Eugene Surovegin
2006-01-25 20:34               ` David Hawkins
2006-01-25  9:57   ` Yosemite/440EP why are readl()/ioread32() setup to read little-endian? Stefan Roese
2006-01-25 18:26     ` David Hawkins
2006-01-25 18:51       ` Eugene Surovegin [this message]
2006-01-25 19:36         ` David Hawkins
2006-01-25 19:48           ` Eugene Surovegin
2006-01-26 10:20           ` Stefan Roese
2006-01-27  0:10             ` David Hawkins
2006-01-27 23:29             ` 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=20060125185131.GA7425@gate.ebshome.net \
    --to=ebs@ebshome.net \
    --cc=dwh@ovro.caltech.edu \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=sr@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).