Subject: ioremap() and CONFIG_SWAP_IO_SPACE

From: Thomas Koeller <[email-masked]>
Date: Wed, 25 Aug 2004 11:30:53 +0200

Hi,

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.

I therefore decided to straighten this out and use those
APIs throughout, but that did not work. The platform
defines 'CONFIG_SWAP_IO_SPACE=y', which causes all
accesses through readx/writex to be byte-swapped. That
is not really appropriate, as the registers are in big
endian order. I therefore tried to change that setting
in yosemite_defconfig, only to find that every time
I do 'make oldconfig' it returns to its original
value of 'y'.

So here are my questions:

1. Am I right to conclude that the platform configuration
   should not set CONFIG_SWAP_IO_SPACE, or am I missing
   something?

2. What is the mechanism that causes that setting to
   always revert to enabled when doing 'make oldconfig'?
   How do I avoid that?

thanks,
Thomas
-- 
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

thomas dot koeller at baslerweb dot com
http://www.baslerweb.com

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

---

From: Geert Uytterhoeven <[email-masked]>
Date: Wed, 25 Aug 2004 11:32:06 +0200 (MEST)

> to ioremapped addresses should be performed using

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.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds