public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: read/write[bwl] endian conversion for big-endian PCI ?
Date: Mon, 09 Mar 2009 17:28:54 +0000	[thread overview]
Message-ID: <20090309172854.GA3546@linux-sh.org> (raw)
In-Reply-To: <49B4E27C.4050108@renesas.com>

On Mon, Mar 09, 2009 at 06:33:48PM +0900, Takashi Yoshii wrote:
> Reading the source code drivers/nic/r8169.c, 
> what I can guess about the system it has been written for, are
> 
> 1. Data structures transfered by PCI DMA are little endian.
>  It users explicit conversion when accessing descriptors.
> 
> 2. Data read/written by PCI target transfer are big(=cpu) endian.
>  MMIO registers are accessed read/write[bwl] without conversion.
>  Or perhaps read/write[bwl]() do the conversion.
>  I'v found some of powerPC platforms have such code for PCI space.
> 
> Because PCI is defined only for little-endian, endian conversion which
> PCI bridge on big-endian hardware provides can vary.
> I know I can not help conversion tasks depend on each platforms.
> 
This is a pretty common problem, we just haven't run in to it much in the
past since almost no one uses any PCI-capable SH part in big-endian mode.

Take a look at the CONFIG_SWAP_IO_SPACE on mips, we should be able to do
something pretty similar without much hassle.

  reply	other threads:[~2009-03-09 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  9:33 read/write[bwl] endian conversion for big-endian PCI ? Takashi Yoshii
2009-03-09 17:28 ` Paul Mundt [this message]
2009-03-10  8:39 ` Takashi Yoshii

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=20090309172854.GA3546@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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