各位大虾,LINUX2.6的映射是和LINUX2.4不一样吗? 在LINUX2.4能跑的驱动在2.6下面出错:
Unable to handle kernel paging request at virtual address fefa40c0
访问的是AT91rm9200的TC3的寄存器。
下面是地址转换部分的代码:
#ifdef CONFIG_MMU
/* * Remap the peripherals from address 0xFFF78000 .. 0xFFFFFFFF * to 0xFEF78000 .. 0xFF000000. (544Kb) */ #define AT91_IO_PHYS_BASE 0xFFF78000 #define AT91_IO_VIRT_BASE (0xFF000000 - AT91_IO_SIZE)
#else /* * Identity mapping for the non MMU case. */ #define AT91_IO_PHYS_BASE AT91_BASE_SYS #define AT91_IO_VIRT_BASE AT91_IO_PHYS_BASE #endif
#define AT91_IO_SIZE (0xFFFFFFFF - AT91_IO_PHYS_BASE + 1)
/* Convert a physical IO address to virtual IO address */
#define AT91_IO_P2V(x) ((x) - AT91_IO_PHYS_BASE + AT91_IO_VIRT_BASE)
/* * Virtual to Physical Address mapping for IO devices. */
#define AT91_VA_BASE_SYS AT91_IO_P2V(AT91_BASE_SYS) #define AT91_VA_BASE_TCB1 AT91_IO_P2V(AT91RM9200_BASE_TCB1)
另外: 为什么是 #define AT91_IO_PHYS_BASE 0xFFF78000 而不是 #define AT91_IO_PHYS_BASE 0xFFFFA000 呢?手册上的物理起始地址是FFFFA000啊!
|