我用am335x带奇美7寸1024*600的LCD只能在驱动中跑800*480.才能点亮。用正常1024*600时提示kmalloc for frame buffer failed,还打印出很多 ————[ cut here ]———— [ 1.338195] WARNING: at mm/page_alloc.c:2095 __alloc_pages_nodemask+0x45c/0x618() [ 1.346069] Modules linked in: [ 1.349273] Backtrace: [ 1.351898] [<c0017978>] (dump_backtrace+0x0/0x110) from [<c04349ac>] (dump_stack+0x18/0x1c) [ 1.360778] r6:c0525c2c r5:0000082f r4:00000000 r3:c06130c8 [ 1.366790] [<c0434994>] (dump_stack+0x0/0x1c) from [<c003d6a8>] (warn_slowpath_common+0x5c/0x6c) [ 1.376159] [<c003d64c>] (warn_slowpath_common+0x0/0x6c) from [<c003d6dc>] (warn_slowpath_null+0x24/0x2c) [ 1.386230] r8:00000000 r7:00000000 r6:c06505b4 r5:c05f40b8 r4:c066c2a8 [ 1.393096] r3:00000009 [ 1.395904] [<c003d6b8>] (warn_slowpath_null+0x0/0x2c) from [<c00815e0>] (__alloc_pages_nodemask+0x45c/0x618) [ 1.406341] [<c0081184>] (__alloc_pages_nodemask+0x0/0x618) from [<c0019d18>] (__dma_alloc+0xa4/0x300) [ 1.416168] [<c0019c74>] (__dma_alloc+0x0/0x300) from [<c001a008>] (dma_alloc_coherent+0x60/0x68) [ 1.425537] [<c0019fa8>] (dma_alloc_coherent+0x0/0x68) from [<c042ad90>] (fb_probe+0xbc4/0xbdc) [ 1.434692] r7:00002000 r6:cf9c7e08 r5:c062e5c0 r4:c0611bf4 [ 1.440673] [<c042a1cc>] (fb_probe+0x0/0xbdc) from [<c022ce04>] (platform_drv_probe+0x20/0x24) [ 1.449768] [<c022cde4>] (platform_drv_probe+0x0/0x24) from [<c022b81c>] (driver_probe_device+0xc0/0x2dc) [ 1.459838] [<c022b75c>] (driver_probe_device+0x0/0x2dc) from [<c022bb14>] (__device_attach+0x44/0x48) [ 1.469635] r8:00000000 r7:c06128b0 r6:00000000 r5:cf9c7e08 r4:c062e504 [ 1.476745] [<c022bad0>] (__device_attach+0x0/0x48) from [<c022a480>] (bus_for_each_drv+0x64/0x90) [ 1.486175] r5:c022bad0 r4:cf9c7e08 [ 1.489959] [<c022a41c>] (bus_for_each_drv+0x0/0x90) from [<c022b640>] (device_attach+0xa0/0xc0) [ 1.499206] r6:cf9c7e10 r5:cf9c7e3c r4:cf9c7e08 [ 1.504089] [<c022b5a0>] (device_attach+0x0/0xc0) from [<c022adf0>] (bus_probe_device+0x2c/0x48) [ 1.513336] r6:cf9c7e10 r5:cf9c7f28 r4:cf9c7e08 r3:00000001 [ 1.519317] [<c022adc4>] (bus_probe_device+0x0/0x48) from [<c02290dc>] (device_add+0x4b8/0x588) [ 1.528503] [<c0228c24>] (device_add+0x0/0x588) from [<c022d4e8>] (platform_device_add+0x124/0x204) [ 1.538055] [<c022d3c4>] (platform_device_add+0x0/0x204) from [<c0034b38>] (omap_device_register+0x3c/0x5c) [ 1.548309] r7:c051620c r6:00000000 r5:cf9c8d40 r4:cf9c7e00 [ 1.554321] [<c0034afc>] (omap_device_register+0x0/0x5c) from [<c0034c60>] (omap_device_build_ss+0x108/0x14c) [ 1.564758] r4:cf9c7e00 r3:00000000 [ 1.568511] [<c0034b58>] (omap_device_build_ss+0x0/0x14c) from [<c0034cf8>] (omap_device_build+0x54/0x5c) [ 1.578613] [<c0034ca4>] (omap_device_build+0x0/0x5c) from [<c05bb62c>] (am33xx_register_lcdc+0x70/0xb4) [ 1.588623] [<c05bb5bc>] (am33xx_register_lcdc+0x0/0xb4) from [<c0031b18>] (lcdc_init+0x98/0xb8) [ 1.597869] r6:00000000 r5:00000002 r4:c0605a2c [ 1.602752] [<c0031a80>] (lcdc_init+0x0/0xb8) from [<c00319c4>] (am335x_evm_setup+0x120/0x1a0) [ 1.611816] r6:cf8a9220 r5:c065948c r4:c061168c r3:c0031a80 [ 1.617828] [<c00318a4>] (am335x_evm_setup+0x0/0x1a0) from [<c023d080>] (at24_probe+0x50c/0x57c) [ 1.627075] r5:cf9c5f40 r4:cf8a9200 [ 1.630859] [<c023cb74>] (at24_probe+0x0/0x57c) from [<c02df310>] (i2c_device_probe+0xa8/0xec) [ 1.639923] [<c02df268>] (i2c_device_probe+0x0/0xec) from [<c022b81c>] (driver_probe_device+0xc0/0x2dc) [ 1.649810] r6:c0653330 r5:c067aab0 r4:cf8a9220 r3:c02df268 [ 1.655822] [<c022b75c>] (driver_probe_device+0x0/0x2dc) from [<c022bacc>] (__driver_attach+0x94/0x98) [ 1.665618] r8:00000000 r7:00000000 r6:cf8a9254 r5:c06331bc r4:cf8a9220 [ 1.672698] [<c022ba38>] (__driver_attach+0x0/0x98) from [<c022a780>] (bus_for_each_dev+0x58/0x84) [ 1.682128] r6:00000000 r5:c022ba38 r4:c06331bc r3:c022ba38 [ 1.688110] [<c022a728>] (bus_for_each_dev+0x0/0x84) from [<c022b414>] (driver_attach+0x24/0x28) [ 1.697387] r6:cf9931c0 r5:c063ed1c r4:c06331bc [ 1.702239] [<c022b3f0>] (driver_attach+0x0/0x28) from [<c022b080>] (bus_add_driver+0x19c/0x26c) [ 1.711517] [<c022aee4>] (bus_add_driver+0x0/0x26c) from [<c022c070>] (driver_register+0x80/0x138) [ 1.720947] [<c022bff0>] (driver_register+0x0/0x138) from [<c02df764>] (i2c_register_driver+0x38/0xe8) [ 1.730773] r8:00000000 r7:00000000 r6:cf81c000 r5:c05f12fc r4:c0633194 [ 1.737670] r3:c063ed1c [ 1.740417] [<c02df72c>] (i2c_register_driver+0x0/0xe8) from [<c05d3da8>] (at24_init+0x50/0x54) [ 1.749603] r5:c05f12fc r4:c0658700 [ 1.753356] [<c05d3d58>] (at24_init+0x0/0x54) from [<c000876c>] (do_one_initcall+0x3c/0x180) [ 1.762268] [<c0008730>] (do_one_initcall+0x0/0x180) from [<c05b3884>] (kernel_init+0x9c/0x130) [ 1.771453] [<c05b37e8>] (kernel_init+0x0/0x130) from [<c0040728>] (do_exit+0x0/0x67c) [ 1.779785] r5:c05b37e8 r4:00000000 [ 1.783599] —[ end trace c696f12f152aa029 ]— [ 1.788482]
da8xx_lcdc da8xx_lcdc.0: GLCD: kmalloc for frame buffer failed 。请问我要怎么修改LCD驱动?错误在fb_probe()函数。但不知道怎么改。
Yaoming Qin:
似乎需要配置成16bit的才可以,你是不是配成24bit了
jery0711 jery:
Yaoming Qin 你好。我现在要用1024*600的屏。用的是32的BPP。请问要怎修改。谢谢用的是最新的05.05的EVM开发环境。用16位的显示只能显示屏的上半部分,还是两个桌面一起显示的。就是ti的ui起来后是两个一模一样的桌面。出现错误的地方在DMA_ALLOC….()函数里。但是跟了好久的代码硬是没看明白怎么改。是不是335x里面规定了framebuffer的大小?如是,在哪改?
Yaoming Qin:
你看看 board-am335xevm.c 里面的 结构体
static struct lcd_ctrl_config lcd_cfg = {
&disp_panel,
.ac_bias= 255,
.ac_bias_intrpt= 0,
.dma_burst_sz= 16,
.bpp= 32,
.fdd= 0x80,
.tft_alt_mode= 0,
.stn_565_mode= 0,
.mono_8bit_mode= 0,
.invert_line_clock = 1,
.invert_frm_clock = 1,
.sync_edge= 0,
.sync_ctrl= 1,
.raster_order= 0,
};
kaiyu liu:
回复 jery0711 jery:
你好,你的问题解决了吗,我遇到同样的问题,AM3359 24bit 1024*768 LCD 出错“LCD: kmalloc for frame buffer failed”? [ 1.308959] da8xx_lcdc.0: alias fck already exists [ 1.314666] da8xx_lcdc da8xx_lcdc.0: GLCD: Found TFC_S9700RTWV35TR_01B panel [ 1.323120] ————[ cut here ]———— [ 1.328033] WARNING: at mm/page_alloc.c:2110 __alloc_pages_nodemask+0x458/0x62c() [ 1.335906] Modules linked in: [ 1.339141] Backtrace: [ 1.341735] [<c001803c>] (dump_backtrace+0x0/0x10c) from [<c04d5438>] (dump_stack+0x18/0x1c) [ 1.350646] r7:00000009 r6:0000083e r5:c00840a0 r4:00000000 [ 1.356628] [<c04d5420>] (dump_stack+0x0/0x1c) from [<c003d284>] (warn_slowpath_common+0x54/0x6c) [ 1.365997] [<c003d230>] (warn_slowpath_common+0x0/0x6c) from [<c003d2c0>] (warn_slowpath_null+0x24/0x2c) [ 1.376068] r9:c06f3ce0 r8:00000000 r7:00000000 r6:c069e110 r5:c0708028 [ 1.382965] r4:00000000 [ 1.385742] [<c003d29c>] (warn_slowpath_null+0x0/0x2c) from [<c00840a0>] (__alloc_pages_nodemask+0x458/0x62c) [ 1.396209] [<c0083c48>] (__alloc_pages_nodemask+0x0/0x62c) from [<c001a2c8>] (__dma_alloc+0x90/0x308) [ 1.406036] [<c001a238>] (__dma_alloc+0x0/0x308) from [<c001a5d0>] (dma_alloc_coherent+0x5c/0x68) [ 1.415374] [<c001a574>] (dma_alloc_coherent+0x0/0x68) from [<c04cd0cc>] (fb_probe+0x7a8/0xbc4) [ 1.424530] r7:cf9bc608 r6:007d0000 r5:cf9c1a54 r4:c06d2844 [ 1.430541] [<c04cc924>] (fb_probe+0x0/0xbc4) from [<c02648e4>] (platform_drv_probe+0x20/0x24) [ 1.439605] [<c02648c4>] (platform_drv_probe+0x0/0x24) from [<c026342c>] (driver_probe_device+0xa0/0x1b0) [ 1.449707] [<c026338c>] (driver_probe_device+0x0/0x1b0) from [<c0263618>] (__device_attach+0x44/0x48) [ 1.459503] r9:c002ff2c r8:c0714d8c r7:00000000 r6:c02635d4 r5:cf9bc608 [ 1.466400] r4:c06d2788 [ 1.469177] [<c02635d4>] (__device_attach+0x0/0x48) from [<c02628d8>] (bus_for_each_drv+0x68/0x94) [ 1.478607] r5:cf81dc48 r4:cf9bc608 [ 1.482391] [<c0262870>] (bus_for_each_drv+0x0/0x94) from [<c02636e4>] (device_attach+0x9c/0xc0) [ 1.491638] r7:c06be7f0 r6:00000000 r5:cf9bc63c r4:cf9bc608 [ 1.497650] [<c0263648>] (device_attach+0x0/0xc0) from [<c02626dc>] (bus_probe_device+0x2c/0x48) [ 1.506896] r7:c06be7f0 r6:00000000 r5:cf9bc610 r4:cf9bc608 [ 1.512878] [<c02626b0>] (bus_probe_device+0x0/0x48) from [<c0261554>] (device_add+0x4c4/0x590) [ 1.522064] [<c0261090>] (device_add+0x0/0x590) from [<c0264f80>] (platform_device_add+0x100/0x19c) [ 1.531616] [<c0264e80>] (platform_device_add+0x0/0x19c) from [<c00332dc>] (omap_device_register+0x28/0x2c) [ 1.541870] r7:c05c6868 r6:00000000 r5:cf9c4e00 r4:cf9bc600 [ 1.547851] [<c00332b4>] (omap_device_register+0x0/0x2c) from [<c00338b4>] (omap_device_build_ss+0x108/0x144) [ 1.558319] [<c00337ac>] (omap_device_build_ss+0x0/0x144) from [<c0033944>] (omap_device_build+0x54/0x5c) [ 1.568420] [<c00338f0>] (omap_device_build+0x0/0x5c) from [<c06685a0>] (am33xx_register_lcdc+0x64/0xb0) [ 1.578399] r4:00000000 [ 1.581085] [<c066853c>] (am33xx_register_lcdc+0x0/0xb0) from [<c002f778>] (lcdc_init+0x30/0x60) [ 1.590332] r6:00000001 r5:00000001 r4:c06bd128 [ 1.595245] [<c002f748>] (lcdc_init+0x0/0x60) from [<c002f1f8>] (_configure_device+0x70/0xdc) [ 1.604217] [<c002f188>] (_configure_device+0x0/0xdc) from [<c0030130>] (am335x_evm_setup+0x204/0x4ac) [ 1.614044] r7:00000000 r6:cf8a0820 r5:00000000 r4:c06bdac0 [ 1.620025] [<c002ff2c>] (am335x_evm_setup+0x0/0x4ac) from [<c0276794>] (at24_probe+0x45c/0x4e4) [ 1.629272] r6:cf8a0820 r5:cf8a0800 r4:cf9c3d40 [ 1.634185] [<c0276338>] (at24_probe+0x0/0x4e4) from [<c032c66c>] (i2c_device_probe+0xb4/0xec) [ 1.643249] [<c032c5b8>] (i2c_device_probe+0x0/0xec) from [<c026342c>] (driver_probe_device+0xa0/0x1b0) [ 1.653137] r7:c06d7558 r6:cf8a0854 r5:c0714db0 r4:cf8a0820 [ 1.659118] [<c026338c>] (driver_probe_device+0x0/0x1b0) from [<c02635d0>] (__driver_attach+0x94/0x98) [ 1.668945] r9:00000000 r8:00000000 r7:00000000 r6:cf8a0854 r5:c06d7558 [ 1.675842] r4:cf8a0820 [ 1.678588] [<c026353c>] (__driver_attach+0x0/0x98) from [<c0262be0>] (bus_for_each_dev+0x68/0x94) [ 1.688049] r7:00000000 r6:c026353c r5:cf81dec8 r4:c06d7558 [ 1.694030] [<c0262b78>] (bus_for_each_dev+0x0/0x94) from [<c026327c>] (driver_attach+0x24/0x28) [ 1.703277] r7:00000000 r6:cf9c3ec0 r5:c06e3db0 r4:c06d7558 [ 1.709259] [<c0263258>] (driver_attach+0x0/0x28) from [<c0262448>] (bus_add_driver+0xa8/0x23c) [ 1.718444] [<c02623a0>] (bus_add_driver+0x0/0x23c) from [<c0263c34>] (driver_register+0x80/0x144) [ 1.727905] [<c0263bb4>] (driver_register+0x0/0x144) from [<c032cab0>] (i2c_register_driver+0x34/0xbc) [ 1.737701] r9:00000000 r8:00000000 r7:00000013 r6:00000000 r5:c06f4180 [ 1.744598] r4:c06d7530 [ 1.747375] [<c032ca7c>] (i2c_register_driver+0x0/0xbc) from [<c067b8f8>] (at24_init+0x48/0x54) [ 1.756530] r5:c06f4180 r4:c069ab4c [ 1.760314] [<c067b8b0>] (at24_init+0x0/0x54) from [<c0008610>] (do_one_initcall+0x44/0x1a4) [ 1.769195] [<c00085cc>] (do_one_initcall+0x0/0x1a4) from [<c0660288>] (kernel_init+0x80/0x124) [ 1.778381] [<c0660208>] (kernel_init+0x0/0x124) from [<c0040884>] (do_exit+0x0/0x6ac) [ 1.786712] r5:c0660208 r4:00000000 [ 1.790557] —[ end trace b4622b5c66012fd7 ]— [ 1.795440] da8xx_lcdc da8xx_lcdc.0: GLCD: kmalloc for frame buffer failed [ 1.802703] da8xx_lcdc: probe of da8xx_lcdc.0 failed with error -22 AM3359 LCD 16bit RGB 24Bit 现已经换成BGR。我的修改如下:board-am335xevm.cstatic const struct display_panel disp_panel = { WVGA, 16, 24, COLOR_ACTIVE,};static struct lcd_ctrl_config lcd_cfg = { &disp_panel, .ac_bias = 255, .ac_bias_intrpt = 0, .dma_burst_sz = 16, .bpp = 24, .fdd = 0x80, .tft_alt_mode = 0, .stn_565_mode = 0, .mono_8bit_mode = 0, .invert_line_clock = 1, .invert_frm_clock = 1, .sync_edge = 0, .sync_ctrl = 1, .raster_order = 0,};在am335x_evm_defconfig文件:FB_DA8XX_CONSISTENT_DMA_SIZE 已改为14,还是出现如上错误。
知道是什么原因吗?求指导。。
jery0711 jery:
回复 kaiyu liu:
你好,你按下面 改下,下面是原因和步骤。 推荐你以后还是去ti的e2e网站问问题吧,这里没什么人回答。
It is Linux kernel limit. AM335x Linux kernel has 1024 number pages, than the page size is 4096 bytes.
So "dma_alloc_coherent()" can't allocating more than 4MB.
Fellow these step, resolve this problem:
1. Please, modify the "#define MAX_ORDER 12" in the include/linux/mmzone.h
2. Please tune menuconfig option, FB_DA8XX_CONSISTENT_DMA_SIZE [=5] or more
3. Rebuild your Linux kernel
BR
kaiyu liu:
回复 jery0711 jery:
你好,我用am3359带奇美10‘4的屏,1024*768*24,按照你提供的步骤,还是出现”GLCD: kmalloc for frame buffer failed“错误,
MAX_ORDER 12
FB_DA8XX_CONSISTENT_DMA_SIZE [=6]
感觉FB_DA8XX_CONSISTENT_DMA_SIZE的值没有被修改。。。。
请问还有其它需要注意的地方吗?
我给TI已经发了邮件现在还没有回。。。
jery0711 jery:
回复 kaiyu liu:
我用的是1024*600*32位的。改了那些之后就malloc成功了。你把定义MAX_ORDER 12的那个判断注释掉,自己定义下#define MAX_ORDER 12。其他的好像没有什么了 ,可以把DMA_SIZE扩大在试试。
kaiyu liu:
回复 jery0711 jery:
非常感谢,,,,,将原定义MAX_ORDER 12的那个判断注释掉,自己定义#define MAX_ORDER 12 ,后成功了,,,谢谢你的指点。
jery0711 jery:
回复 kaiyu liu:
别客气,能帮上忙我也很高兴。互相学习。