public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Hawkins <dwh@ovro•caltech.edu>
To: Eugene Surovegin <ebs@ebshome•net>
Cc: linuxppc-embedded@ozlabs•org
Subject: Re: Yosemite/440EP why are readl()/ioread32() setup to readlittle-endian?
Date: Wed, 01 Feb 2006 10:20:42 -0800	[thread overview]
Message-ID: <43E0FBFA.10103@ovro.caltech.edu> (raw)
In-Reply-To: <20060201181106.GA24138@gate.ebshome.net>

Eugene Surovegin wrote:
> On Wed, Feb 01, 2006 at 10:04:15AM -0800, David Hawkins wrote:
> 
>>Matt,
>>
>>In the same vein as the readl()/writel() question, what
>>are the assumptions regarding memcpy_toio and memcpy_fromio?
>>
>>If the memcpy_to/fromio operations are intended only
>>for access to PCI devices, then they should also inherently
>>perform little-endianness conversion. For the test driver
>>I was working on, I did *not* find this the case, eg.
>>I implemented the test driver read() and write() using the
>>memcpy_to/fromio calls, and the data transfers occur
>>in big-endian (well, 'native' mode, since I also test the
>>same test driver with the PCI adapter in an x86 system).
>>
>>If memcpy_to/fromio can be used in a more general context,
>>then I can see why they operate in native mode.
>>
>>Just looking for enlightenment.
> 
> 
> This commands IIRC are intended for copying chunk of _bytes_. There 
> are no issues with endianess for bytes, e.g. they work just like 
> ordinary memcpy.
> 

True, good point.

I quite often implement a 'control' device to read/write/mmap PCI
device registers. In that case, the registers are usually 32-bit, so
if I wanted endian neutrality, I could either let the user-space
app determine the endianness and act accordingly, or force the
user-space app to always see little-endian registers by replacing
memcpy_to/fromio calls with a loop over read;/writel, and in mmap
making sure to set the _PAGE_ENDIAN flag. Of course, making mmap
endian-neutral depends on the 440EP page flags, which say an
ARM might not have.

Thanks for the valuable feedback guys.

Dave

  reply	other threads:[~2006-02-01 18:18 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
2006-02-01 18:04     ` David Hawkins
2006-02-01 18:11       ` Eugene Surovegin
2006-02-01 18:20         ` David Hawkins [this message]
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=43E0FBFA.10103@ovro.caltech.edu \
    --to=dwh@ovro$(echo .)caltech.edu \
    --cc=ebs@ebshome$(echo .)net \
    --cc=linuxppc-embedded@ozlabs$(echo .)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