Dear All,
i'm facing some troubles trying to make LVDS dual channel work on imx53 with linux.
our board is based on QSB Schematics and we want to use a 1280x1024@24bit display for our application.
THe actual problem is that i can see only half of the screen but stretched to fill all the display area.
see the attached pictures for reference...
in these days i made these steps:
- Add the correct fb_videomode in ldb.c
- Add the correct fb_videomode in mx53_loco.c
- Add the correct mxc_fb_platform_data in mx53_loco.c
See here below the new added settings:
In file: \home\lucid\ltib\rpm\BUILD\linux\drivers\video\mxc\ldb.c
struct fb_videomode mxcfb_ldb_modedb[] = {
{
/* 1280x1024 @ 60 Hz , pixel clk @ 54MHz */
"TEST", // name
60, // refresh
1280, // x res
1024, // y res
18520, // pixclock in PICOSECONDS!!!! 10^12 / pixel_clock_frequency
130, // left margin
54, // right margin
10, // upper margin
3, // lower margin
1, // H sync len
2, // W sync len
//FB_SYNC_CLK_LAT_FALL, // sync
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, // Sync sul fronte di salita
FB_VMODE_NONINTERLACED, // vmode
FB_MODE_IS_DETAILED, // flag
},
}
In file \home\lucid\ltib\rpm\BUILD\linux\arch\arm\mach-mx5\mx53_loco.c
static struct fb_videomode video_modes[] = {
{
/* 1280x1024 @ 60 Hz , pixel clk @ 54MHz */
"TEST", // name
60, // refresh
1280, // x res
1024, // y res
18520, // pixclock in PICOSECONDS!!! 10^12 / pixel_clock_frequency
130, // left margin
54, // right margin
10, // upper margin
3, // lower margin
1, // H sync len
2, // W sync len
//FB_SYNC_CLK_LAT_FALL, // sync
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED, // vmode
FB_MODE_IS_DETAILED, // flag
},
}
AND
static struct mxc_fb_platform_data fb_data[] = {
{
.interface_pix_fmt = IPU_PIX_FMT_RGB24,
.mode_str = "TEST",
.mode = video_modes,
.num_modes = ARRAY_SIZE(video_modes),
},
}
i've changed also the bootargs in:
set bootargs_base 'set bootargs console=ttymxc0,115200 video=mxcdi0fb:RGB24,TEST,bpp=32 ldb=di0,split di0_primary dmfc=3'
The parameters should be ok, but for a strange reason and after trying all the possible combinations (i'm working on it from two days) I cannot view the entire screen area on my display, only half of the picture stretched to fill the lcd area...
attached you can see the boot penguin logo 2x wider than normal and half of a qt demo application...
I saw on the forum that other peoples asked for the same problem in the past but i found no valid replies, so I'm here...
Please help me..
thanks
Solved! Go to Solution.
I found the exception problem.
Surely this issue is due to the poor quality code of ldb_setup in ldb.c (the argument parsing function).
To make this work we have to complete the bootargs even with ch0_map=SPWG,ch1_map=SPWG otherwise the function is not able to use a default settings (which would be SPWG as standard).
so my correct parameters are now:
set bootargs_base 'set bootargs console=ttymxc0,115200 video=mxcdi0fb:RGB24,LVDS1280,bpp=32 ldb=split,di=0,ch0_map=SPWG,ch1_map=SPWG di0_primary dmfc=3'
I spat blood to understand how it works and find the problem.
I wanted to post the solution I found, I hope this can help other users who may have the same problem in the future.
Best regards
probably i found the problem in ldb.c
since my display is dualchannel, i was thinking that the 54Mhz PixelClock was the correct parameter to insert in fb_videomode.
Instead of this, the correct parameter is 108Mhz, we have to multiply the PixelClock * NumOfChannel.
BUT this not solve the entire problem.
this function expect a parameter like ldb=split,di=0 instead of ldb=di0,split like all say here.
You can see in this piece of code, copied from function ldb_setup in ldb.c file
} else if (!strncmp(options, "split", 5)) {
strsep(&options, ",");
if (!strncmp(options, "di=", 3)) {
if (simple_strtoul(options + 3, NULL, 0) == 0)
g_chan_mode_opt = LDB_SPL_DI0;
else
g_chan_mode_opt = LDB_SPL_DI1;
}
} else
return 1;
The very problem is that if i configure
set bootargs_base 'set bootargs console=ttymxc0,115200 video=mxcdi0fb:RGB24,LVDS1280,bpp=32 ldb=split,di=0 di0_primary dmfc=3'
the boot hang up at Starting Kernel ... see the attached picture for reference.
I made the LCD working forcing the function with:
static int __init ldb_setup(char *options)
{
printk(KERN_INFO "SIMONE DEBUG, ENTER ldb_setup options: %s \n\r", options);
g_enable_ldb = true;
g_chan_mode_opt = LDB_SPL_DI0;
g_boot_cmd = true;
return 1;
...
But this is only a debug test, obviously i cannot let this function in this mode!! :-)
Now, i really don't know how freescale has tested the 1080P panel, because this piece of code can't work!!
How we can fix this issue?
May you can help me?
Thanks
I found the exception problem.
Surely this issue is due to the poor quality code of ldb_setup in ldb.c (the argument parsing function).
To make this work we have to complete the bootargs even with ch0_map=SPWG,ch1_map=SPWG otherwise the function is not able to use a default settings (which would be SPWG as standard).
so my correct parameters are now:
set bootargs_base 'set bootargs console=ttymxc0,115200 video=mxcdi0fb:RGB24,LVDS1280,bpp=32 ldb=split,di=0,ch0_map=SPWG,ch1_map=SPWG di0_primary dmfc=3'
I spat blood to understand how it works and find the problem.
I wanted to post the solution I found, I hope this can help other users who may have the same problem in the future.
Best regards
From 6.4.1 Timing Characteristics, it is a 1024*640 resolution panel, not a 1280*1024 resolution panel. You can try the followed setting:
struct fb_videomode mxcfb_ldb_modedb[] = {
{
/* 1024640 @ 60 Hz , pixel clk @ 54MHz */
"TEST", // name
60, // refresh
1024, // x res
640, // y res
18520, // pixclock in PICOSECONDS!!!! 10^12 / pixel_clock_frequency
20, // left margin
20, // right margin
100, // upper margin
100, // lower margin
2, // H sync len
4, // W sync len
0,
FB_VMODE_NONINTERLACED, // vmode
FB_MODE_IS_DETAILED, // flag
},
}