This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352的GPMC外接一个8位并口设备,linux下驱动操作映射内存的时候出现“Segmentation fault”

Other Parts Discussed in Thread: AM3352

现基于am3352的linux3.2SDK,GPMC外接了一个8位并口设备,GPMC配置如下:

gpmc_cs_write_reg(cs,GPMC_CS_CONFIG1, 0x0);

gpmc_cs_configure(cs, GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NOR);
val = gpmc_cs_read_reg(cs,GPMC_CS_CONFIG1);

val |= GPMC_CONFIG1_READTYPE_SYNC;
val |= GPMC_CONFIG1_WRITETYPE_SYNC;
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, val);
gpmc_cs_set_timings(cs, &uc_timing);
gpmc_cs_request(cs, SZ_16M, &mem_base_phys);

if (!request_mem_region(mem_base_phys,SZ_16M, "UC")) {
ret = -EBUSY;
goto ERR;
}

mmio = ioremap((mem_base_phys,SZ_16M);

offset = 0x800;
__raw_writeb(0XE2,mmio+offset); --> 此处出现Segmentation fault

那位大侠帮忙看看,GPMC操作漏了那些步骤??按道理ioremap后的内存是可以读写的,不知道为什么出现了Segmentation fault