昨天,用网上给的方法对一个设备进行IO内存静态映射,怎么弄都报错,设备不能映射成功?
对代码检查过后还是不行,于是我就换设备映射,结构还是不行,然后思考了以下代码,在/* linux/include/asm-arm/plat-s3c/map.h
#define S3C_ADDR_BASE (0xF4000000)
#ifndef __ASSEMBLY__
#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
#else
#define S3C_ADDR(x) (S3C_ADDR_BASE + (x))
#endif
#define S3C_VA_IRQ S3C_ADDR(0x00000000) /* irq controller(s) */
#define S3C_VA_SYS S3C_ADDR(0x00100000) /* system control */
#define S3C_VA_MEM S3C_ADDR(0x00200000) /* system control */
#define S3C_VA_TIMER S3C_ADDR(0x00300000) /* timer block */
#define S3C_VA_WATCHDOG S3C_ADDR(0x00400000) /* watchdog */
#define S3C_VA_UART S3C_ADDR(0x01000000) /* UART */
我添加的设备#define S3C_VA_MCX S3C_ADDR(0x01200000),于是我怀疑是不是括号的地址不行,改了几个数之后改成
#define S3C_VA_MCX S3C_ADDR(0x00600000)就不报错了,有给了几个数,0x00800000也行,但是在0x01000000以上就不行。。。