原因是:
/* 寄存器物理地址 */
#define CCM_CCGR1_BASE (0X020C406C)
#define SW_MUX_GPIO1_IO03_BASE (0X020E0068)
#define SW_PAD_GPIO1_IO03_BASE (0X020E02F4)
#define GPIO1_DR_BASE (0X0209C000)
#define GPIO1_GDIR_BASE (0X0209C004)
struct resource namematch_device_res [] =
{
[0] = {.start = CCM_CCGR1_BASE,.end = CCM_CCGR1_BASE + 4,.name = "reg1", .flags = IORESOURCE_MEM},
[1] = {.start = SW_MUX_GPIO1_IO03_BASE,.end = SW_MUX_GPIO1_IO03_BASE + 4,.name = "reg2", .flags = IORESOURCE_MEM},
[2] = {.start = SW_PAD_GPIO1_IO03_BASE,.end = SW_PAD_GPIO1_IO03_BASE + 4,.name = "reg3", .flags = IORESOURCE_MEM},
[3] = {.start = GPIO1_DR_BASE,.end = GPIO1_DR_BASE + 4,.name = "reg4", .flags = IORESOURCE_MEM},
[4] = {.start = GPIO1_GDIR_BASE,.end = GPIO1_GDIR_BASE + 4,.name = "reg5", .flags = IORESOURCE_MEM}
};
这里 第4号resource 的起始地址 start 与 第3号的 .end 重合了, 所以在这里是不能有交叠重合的;
解决方法:
修改第3个resource的end地址值为
end = GPIO1_DR_BASE + 0x4 -1
也就是
/* 寄存器物理地址 */
#define CCM_CCGR1_BASE (0X020C406C)
#define SW_MUX_GPIO1_IO03_BASE (0X020E0068)
#define SW_PAD_GPIO1_IO03_BASE (0X020E02F4)
#define GPIO1_DR_BASE (0X0209C000)
#define GPIO1_GDIR_BASE (0X0209C004)
struct resource namematch_device_res [] =
{
[0] = {.start = CCM_CCGR1_BASE,.end = CCM_CCGR1_BASE + 4,.name = "reg1", .flags = IORESOURCE_MEM},
[1] = {.start = SW_MUX_GPIO1_IO03_BASE,.end = SW_MUX_GPIO1_IO03_BASE + 4,.name = "reg2", .flags = IORESOURCE_MEM},
[2] = {.start = SW_PAD_GPIO1_IO03_BASE,.end = SW_PAD_GPIO1_IO03_BASE + 4,.name = "reg3", .flags = IORESOURCE_MEM},
[3] = {.start = GPIO1_DR_BASE,.end = GPIO1_DR_BASE + 0x4 -1,.name = "reg4", .flags = IORESOURCE_MEM},
[4] = {.start = GPIO1_GDIR_BASE,.end = GPIO1_GDIR_BASE + 4,.name = "reg5", .flags = IORESOURCE_MEM}
};
问题解决!