hello everyone,
recently, I get chance to touch two kinds ofARM9 cpu, one is davinci ,6446 ,
the other is samsung 2410,
in io.h of arch-davinci directory I found the following code.
#define IO_PHYS 0x01c00000
#define IO_VIRT 0xe1000000
#define IO_SIZE 0x00400000
#define io_p2v(pa) (((pa) & (IO_SIZE-1)) + IO_VIRT)
#define io_v2p(va) (((va) & (IO_SIZE-1)) + IO_PHYS)
#define IO_ADDRESS(x) io_p2v(x)
#define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
I have no idea why io_p2v(pa) is defined to (((pa) & (IO_SIZE-1)) +
IO_VIRT) ,based on hardware ? it seems to be hard coding in my mind ,
but if I substitute (((pa) & (IO_SIZE-1)) + IO_VIRT) to another definition
such as (((pa) & (IO_SIZE-1)) + IO_VIRT)(here, I change IO_SIZE from
0x00400000 to 0x00800000 ) or ((pa) + 0xC0000000))
it will not work .
so I cannot get the rule of IOmap based on what ? -----the first question.
while , I also found the code about iomap in samsung 2410 platform
static struct map_desc sbc2440_iodesc[] __initdata = {
{vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE},
{0xe0000000, 0x08000000, 0x00100000, MT_DEVICE},
{0xe0100000, 0x10000000, 0x00100000, MT_DEVICE},
this map can be understood easily for create_mapping() create the map from
pSMDK2410_ETH_IO to vSMDK2410_ETH_IO,
while davinci platform not . anyone can explain it for me ?--------the
second question
thanks a lot
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source