Subject: Re: RE : Error while accessing physical address

From: Segher Boessenkool <[email-masked]>
Date: Thu, 1 Sep 2005 18:00:51 +0200

> 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