Error while accessing physical address

Segher Boessenkool segher at kernel.crashing.org
Fri Sep 2 02:00:51 EST 2005


> unsigned short is 2 bytes, so you should use:
>
> regHdwAddress = (unsigned short *) ioremap((unsigned 
> short)address,0x2);

Nah.  The size doesn't matter that much (it will be mapped
with a page granularity anyway).  You just want to use

regHdwAddress = (unsigned short *)ioremap(address, 2);

Casting the address to unsigned short made the address 0x0400
instead of the address you wanted, so you destroy the ISI
vector when writing to it (and you might cause a cache paradox
as well, as the ioremap maps it uncacheable, and it might
already be in the cache at that time).


Segher




More information about the Linuxppc-dev mailing list