linux2.6下的 ioremap 问题:
实验平台:linux2.6.9
交叉编译器:arm-linux-gcc-3.4.6-glibc-2.3.6
试验程序:
ADDR_SJA1000_ADDR = ioremap(0x04000000,0xff);
ADDR_SJA1000_DATA = ADDR_SJA1000_ADDR + (0x1<<2);
printk("ADDR_SJA1000_ADDR = %x\n",ADDR_SJA1000_ADDR);
printk("ADDR_SJA1000_DATA = %x\n",ADDR_SJA1000_DATA);
打印结果:
ADDR_SJA1000_ADDR = c4874000
DDR_SJA1000_DATA = c4874010
难道DDR_SJA1000_DATA 的值 不应该是c4874004 吗
在linux2.4.14 下打印DDR_SJA1000_DATA = c4874004
我又在2.6下试了一下发现:
ADDR_SJA1000_DATA = ADDR_SJA1000_ADDR + ? ---- DDR_SJA1000_DATA =?
(0x1<<2)-----c4874010
(0x1<<1)-----c4874008
(0x1<<0)-----c4874004
而在2.4下 相关数据为
(0x1<<2)-----c4874004
(0x1<<1)-----c4874002
(0x1<<0)-----c4874001
阅读(1028) | 评论(1) | 转发(0) |