TI中文支持网
TI专业的中文技术问题搜集分享网站

gpmc与ra8806单色屏驱动问题 以及片选问题

上面电路图部分。GPMC_D1 ——GPMC_D7 以及GPMC_WEn和REn都被NAND复用了,所以在board_am335xevm.c板级文件里面,这些引脚我没有动它,并且在static struct pinmux_config nand_pin_mux[] 里面添加了

{"gpmc_csn1.gpmc_csn1", OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
{"gpmc_csn2.gpmc_csn2", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL},

板级文件里面添加以下内容:

static struct gpmc_timings am335x_led_timings = {
.sync_clk = 0,
.cs_on = 0, /* Assertion time */
.cs_rd_off = 82,/* Read deassertion time */
.cs_wr_off = 82,/* Write deassertion time */
// .we_on = 40, /* WE assertion time */
.we_on = 10, .we_off = 40, /* WE deassertion time */
// .oe_on = 40, /* OE assertion time */
.oe_on = 10, .oe_off = 40, /* OE deassertion time */
.access = 64, /* Start-cycle to first data valid delay */
.rd_cycle = 82, /* Total read cycle time */
.wr_cycle = 82, /* Total write cycle time */
};

static struct am335x_led_platform_data am335x_led_data = {
.cs = 1,
.gpmc_t = &am335x_led_timings,
.devsize = 8,
.elm_used = true,
.memsize =SZ_16M,
};

static struct resource gpmc_lcd_8080_resource = {
.flags = IORESOURCE_MEM,
};

static struct platform_device am335x_lcd_8080_device = {
.name = "lcd_8080", .id = -1,
.num_resources = 1,
.resource = &gpmc_lcd_8080_resource,
.dev = {
.platform_data = &am335x_led_data,
},
};

//初始化:

static void __init am335x_lcd_8080_init(void)
{
int ret;
printk("___am335x_lcd_8080_init\n");
//struct am335x_led_platform_data *pdata;

setup_pin_mux(led_pin_mux); platform_device_register(&am335x_lcd_8080_device);
#if 1 ret = gpio_request(LED_RST, "LED_RST");
if(ret < 0)
printk("Failed to request GPIO: %d!\n", LED_RST);
else
{
gpio_direction_output(LED_RST,0);
msleep(10);
gpio_direction_output(LED_RST,1);
}
#endif

参考网上资料,附件包含着驱动程序。

}

运行驱动之后,能正常的写,但是片选就是偏选不上。

下面是执行驱动之后的对应的打印信息。

[ 42.313034] Disabling lock debugging due to kernel taint
[ 42.319626] lcd_8080_probe>>>>>>>>
[ 42.323225] gmpc_base>>>>>>>>==e0876000
[ 42.327422] ppdata->cs===1
[ 42.330284] ppdata->devsize==8
[ 42.333468] ppdata->memsize===1000000
[ 42.337287] Getting Chip Select
[ 42.340575] GPMC revision 6.0
[ 42.343679] GPMC CS1: cs_on : 0 ticks, 0 ns (was 1 ticks) 0 ns
[ 42.351010] GPMC CS1: cs_rd_off : 9 ticks, 90 ns (was 16 ticks) 82 ns
[ 42.358279] GPMC CS1: cs_wr_off : 9 ticks, 90 ns (was 16 ticks) 82 ns
[ 42.365461] GPMC CS1: adv_on : 0 ticks, 0 ns (was 4 ticks) 0 ns
[ 42.372654] GPMC CS1: adv_rd_off: 0 ticks, 0 ns (was 5 ticks) 0 ns
[ 42.379841] GPMC CS1: adv_wr_off: 0 ticks, 0 ns (was 6 ticks) 0 ns
[ 42.387023] GPMC CS1: oe_on : 1 ticks, 10 ns (was 6 ticks) 10 ns
[ 42.394221] GPMC CS1: oe_off : 4 ticks, 40 ns (was 16 ticks) 40 ns
[ 42.401411] GPMC CS1: we_on : 1 ticks, 10 ns (was 5 ticks) 10 ns
[ 42.408623] GPMC CS1: we_off : 4 ticks, 40 ns (was 16 ticks) 40 ns
[ 42.415801] GPMC CS1: rd_cycle : 9 ticks, 90 ns (was 17 ticks) 82 ns
[ 42.423004] GPMC CS1: wr_cycle : 9 ticks, 90 ns (was 17 ticks) 82 ns
[ 42.430189] GPMC CS1: access : 7 ticks, 70 ns (was 15 ticks) 64 ns
[ 42.437367] GPMC CS1: page_burst_access: 0 ticks, 0 ns (was 1 ticks) 0 ns
[ 42.445185] GPMC CS1: wr_data_mux_bus: 0 ticks, 0 ns (was 7 ticks) 0 ns
[ 42.452825] GPMC CS1: wr_access : 0 ticks, 0 ns (was 15 ticks) 0 ns
[ 42.460009] GPMC CS1 CLK period is 10 ns (div 1)
[ 42.464823] gpmc_cs_request………………….
[ 42.469739] size>>>>1000000
[ 42.472649] res->start>>>>>>0
[ 42.475737] gpmc->mem_root>>>>100000
[ 42.479486] Got CS1, address = 1000000
[ 42.483398] data_req start: 0x1000000 size: 0x1000000
[ 42.489139] >>>>>pdata->io_base==0xe1000000
[ 42.493503] gpmc cs0 reg: 0x800
[ 42.496776] gpmc cs0 reg: 0x50500
[ 42.500238] gpmc cs0 reg: 0x50401
[ 42.503690] gpmc cs0 reg: 0x4010601
[ 42.507325] gpmc cs0 reg: 0x70909
[ 42.510791] gpmc cs0 reg: 0x4000f80
[ 42.514426] gpmc cs0 reg: 0xf48
[ 42.517706][ 42.519255] gpmc cs1 reg: 0x28600200
[ 42.522989] gpmc cs1 reg: 0x90900
[ 42.526440] gpmc cs1 reg: 0x22000010
[ 42.530173] gpmc cs1 reg: 0x4016411
[ 42.533806] gpmc cs1 reg: 0x70909
[ 42.537262] gpmc cs1 reg: 0x80000000
[ 42.540996] gpmc cs1 reg: 0xf41
[ 42.544267][ 42.545820] gpmc cs1, base: 0x1000000, size: 0x1000000
[ 42.551188] base>>>>>>1000000
[ 42.554279] size======1000000
[ 42.557366] ASASASASASASASA

片选0是nand flash,片选1是ra8806单色屏我想直接往写数据进去,但是测试的结果就是片选1没有信号。一直处于高电平状态。为什么是什么反应都没有,百思不得其解,求各位大神多多帮忙。

Jian Zhou:

这个屏为什么要用GPMC接口控制,不能用LCD控制么?

shengquan ye:

回复 Jian Zhou:

感谢jianzhou

现在我们做的开发板,接了三种屏,电阻屏,电容屏以及这个单色屏,电阻屏用了lcd引脚,单色屏使用的引脚是gpmc d0 到d7,这八个引脚没有lcd模式,而且gpmcd0 到d7 nand也在使用,想通过片选来使用这几个引脚工作到单色屏上,我感觉这些个引脚已经被复用到了,还能使用到单色屏上吗?

Jian Zhou:

回复 shengquan ye:

程序运行的时候片选信号始终没有拉低么?

理论上GPMC可以同时接不同的外设,主要靠不同地址空间的片选进行区分。

shengquan ye:

回复 Jian Zhou:

通过驱动里面的内容,我在应用层wirte buff ,buff里面内容是0x55,调用了驱动里面的write,往驱动里面写,没有delay的不断地写,可以看到片选有信号了,有波形出现,但是我还是不清楚一点,这个片选地址代表什么?只是fifo的首地址,还是外设的地址,可以利用这个地址,对外围设备寄存器进行操作吗?比如这个ra8806单色屏

Jian Zhou:

回复 shengquan ye:

GPMC就是local bus,会占用一部分系统地址空间,这部分地址空间会给不同的CS分配,你可以先看下下面的说明:

http://www.deyisupport.com/files/m/sitara_arm/11905.aspx

leo chen:

片选1 有没有在其它地方被配置了?

shengquan ye:

回复 leo chen:

没有复用,我看网上很多申请出来的地址是0x1000000,我就是不知道这样config7 是f41我就是不知道这样申请出阿狸的是对不对的?

赞(0)
未经允许不得转载:TI中文支持网 » gpmc与ra8806单色屏驱动问题 以及片选问题
分享到: 更多 (0)