public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Hawkins <dwh@ovro•caltech.edu>
To: Matt Porter <mporter@kernel•crashing.org>
Cc: linuxppc-embedded@ozlabs•org, "Jenkins, Clive" <Clive.Jenkins@xerox•com>
Subject: Re: Yosemite/440EP why are readl()/ioread32() setup to readlittle-endian?
Date: Wed, 01 Feb 2006 09:53:44 -0800	[thread overview]
Message-ID: <43E0F5A8.4000604@ovro.caltech.edu> (raw)
In-Reply-To: <20060201104405.C16064@cox.net>


> The book implicitly focuses on x86 driver developers, that's
> why you don't get an explicit statement about this...
> "everything" is PCI in that world.
> 
> read*/write* and ioread*/iowrite* generate outbound little
> endian cycles on ALL arches, period.  They are intended
> only for PCI use and have generic names only because of
> the assumption that "all the world is a PC".
> 
> Now, what it takes to to generate outbound little endian cycles
> varies. On some arches, it's just a store (native LE) on
> other arches, it's a reversed store (PPC), others still configure
> their PCI bridge hardware to do byte swapping in hardware (typically
> if their arch doesn't have a simple byte-swapping store like PPC).
> 
> The example you cite on pg. 453 of Rubini looks broken for BE
> systems. It works on LE systems since cpu_to_le32() does nothing
> and writel is a simply dereference. That's pure luck. On PPC,
> for example, that would write a big endian bus_addr to the fictitious
> PCI device which is not what they want.

Great! An authoritive answer!

Re: endianness, even cooler on the 440EP, in your mmap()
implementation you can set the _PAGE_ENDIAN flag, and
user-space will see the PCI device in little endian
format. Fun stuff!

Thanks Matt.

Dave

  reply	other threads:[~2006-02-01 17:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-01 11:19 Yosemite/440EP why are readl()/ioread32() setup to readlittle-endian? Jenkins, Clive
2006-02-01 17:02 ` David Hawkins
2006-02-01 17:44   ` Matt Porter
2006-02-01 17:53     ` David Hawkins [this message]
2006-02-01 18:04     ` David Hawkins
2006-02-01 18:11       ` Eugene Surovegin
2006-02-01 18:20         ` David Hawkins
2006-02-01 18:23           ` Eugene Surovegin
2006-02-01 21:14     ` Peter Korsgaard
2006-02-02  0:54       ` Kumar Gala
2006-02-02  3:07         ` Matt Porter
2006-02-02  8:09         ` Peter Korsgaard
2006-02-02  9:08           ` Eugene Surovegin
2006-02-02 17:34             ` Dale Farnsworth
2006-02-02 14:21           ` Matt Porter
  -- strict thread matches above, loose matches on Subject: below --
2006-02-01 18:35 Jenkins, Clive
2006-02-01 20:35 ` David Hawkins
2006-02-02  9:35 Jenkins, Clive
2006-02-02  9:46 ` Eugene Surovegin
2006-02-02 14:37   ` Matt Porter
2006-02-02 17:45     ` Eugene Surovegin
2006-02-02 18:16       ` Matt Porter

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=43E0F5A8.4000604@ovro.caltech.edu \
    --to=dwh@ovro$(echo .)caltech.edu \
    --cc=Clive.Jenkins@xerox$(echo .)com \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=mporter@kernel$(echo .)crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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