Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Thomas Koeller <thomas.koeller@baslerweb.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-mips@linux-mips.org
Subject: Re: ioremap() and CONFIG_SWAP_IO_SPACE
Date: Tue, 19 Oct 2004 12:45:59 +0200	[thread overview]
Message-ID: <200410191245.59878.thomas.koeller@baslerweb.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0408251131020.18759@waterleaf.sonytel.be>

On Wednesday 25 August 2004 11:32, Geert Uytterhoeven wrote:
> On Wed, 25 Aug 2004, Thomas Koeller wrote:
> > my platform (PMC-Sierra Yosemite in big endian mode),
> > like many others, uses ioremap() to map device
> > registers, such as the RM9000's OCD registers.
> > To access those registers, the return value of
> > ioremap() is casted to a suitable pointer type and
> > dereferenced. This of course works, but the return
> > value of ioremap() is documented not to be a
> > directly dereferenceable pointer value, and accesses
> > to ioremapped addresses should be performed using
> > the readx/writex APIs.
>
> In theory, ioremap() and readb() and friends are meant for PCI memory space
> only. RM9000's OCD registers are not PCI memory space, so there's no strict
> guarantee readb() and friends will actually work.
>

Well, the ioremap() man page uses the term 'bus memory';
there is no reference to PCI at all. I guess there could
be multiple buses on one machine with different byte swapping
requirements? There is also an article written by alan cox
(http://www.kernelnewbies.org/documents/kdoc/deviceiobook.pdf)
that describes ioremap() as a general mechanism of accessing
memory-mapped io devices, with no reference to PCI at all.

Anyway, if ioremap() and readx()/writex() are for PCI memory
access only, how am I supposed to access memory-mapped io
devices that are not on a PCI bus?

Thomas
-- 
--------------------------------------------------

Thomas Koeller, Software Development

Basler Vision Technologies
An der Strusbek 60-62
22926 Ahrensburg
Germany

Tel +49 (4102) 463-390
Fax +49 (4102) 463-46390

mailto:thomas.koeller@baslerweb.com
http://www.baslerweb.com

==============================

  reply	other threads:[~2004-10-19 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-25  9:30 ioremap() and CONFIG_SWAP_IO_SPACE Thomas Koeller
2004-08-25  9:32 ` Geert Uytterhoeven
2004-10-19 10:45   ` Thomas Koeller [this message]
2004-10-19 18:31     ` Ralf Baechle
2004-10-20  8:47       ` Thomas Koeller

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=200410191245.59878.thomas.koeller@baslerweb.com \
    --to=thomas.koeller@baslerweb.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-mips@linux-mips.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