驱动代码:
#define uSDHC_BASE 0x02190000
#define EIM_BASE 0x021b8000
if (!request_mem_region(uSDHC_BASE, 0xc8, "uSDHC"))
{
printk("request_mem_region error for uSDHC device!\n");
}
base = ioremap(uSDHC_BASE, 0xc8);
if (!base)
{
printk("ioremap error for uSDHC device!\n");
}
*(volatile unsigned int *)(base+0xc0) = 0x2000780f;
printk("uSDHC1_VEND_SPEC is %x\r\n", *(volatile unsigned int *)(base+0xc0));
if (!request_mem_region(EIM_BASE, EIM_SIZE, EIM_DEV_NAME))
{
ret = -EBUSY;
goto fail0;
}
base = ioremap(EIM_BASE, EIM_SIZE);
if (!base)
{
ret = -EIO;
printk("ioremap error for EIM device!\n");
goto fail1;
}
*(volatile unsigned int *)(base) = 0x61008f;
printk("EIM_CSnGCR1 is %x\r\n", *(volatile unsigned int *)(base));
运行结果:
uSDHC1_VEND_SPEC is 2000780f
EIM_CSnGCR1 is 610089
EIM_CSnGCR1寄存器仍然是缺省值. |