Dereferencing phys addr IMMAP works even if it is not a virtual address. Strange?

Sylvain Munaut tnt at 246tNt.com
Wed Mar 7 01:54:35 EST 2007


DI BACCO ANTONIO - technolabs wrote:
> Now I'm doing a ioremap_nocache of IMMAP and using the virtual pointer
> returned to access my 880 registers but also using the physical
> address it works, I can access the registers.
If the IMMAP base is high (like 0xf0000000 ) and therefore doesn't
collide with anything, it's quite common practice to map it statically
using a BAT somewhere in the setup code and often it's mapped such that
phys = virt ...

So a physical address in this zone is equal to a virtual addres ...

When that's the case, ioremap detects the BAT mapping and just does
nothing. But you should always use ioremap nonetheless ... because if at
some point some one decide to move the BAT mapping, if you didn't do
things properly your code will break.

Sylvain




More information about the Linuxppc-embedded mailing list