linux-mips
[Top] [All Lists]

Re: ioremap() and CONFIG_SWAP_IO_SPACE

To: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: ioremap() and CONFIG_SWAP_IO_SPACE
From: Thomas Koeller <thomas.koeller@baslerweb.com>
Date: Tue, 19 Oct 2004 12:45:59 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <Pine.GSO.4.58.0408251131020.18759@waterleaf.sonytel.be>
Organization: Basler AG
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200408251130.53865.thomas.koeller@baslerweb.com> <Pine.GSO.4.58.0408251131020.18759@waterleaf.sonytel.be>
Sender: linux-mips-bounce@linux-mips.org
User-agent: KMail/1.6.2
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

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

<Prev in Thread] Current Thread [Next in Thread>