How do i add LCD to iMX6 and connect it to IPU??

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do i add LCD to iMX6 and connect it to IPU??

903 Views
ahmedal-zanam
Contributor I

Hi guys,

i'm using a VAR-MX6 module from variscite and have some issues with LCD for ipu. The LCD is using SPI for initialization and RGB interface. After initialization is the LCD in RGB mode and should the ipu take the control. The LCD is connected to EIM pins ALT 1 (IPU1.DISP1_XXX) as below

pastedImage_11.png

I have changed the VSYNC/HSYNC and LCD BIAS (Enable) in the ipu_reg.h to have the correct connection to corresponding pins (VSYNC->IPU1.DI1_PIN4, HSYNC->IPU1.DI1_PIN3 and ENABLE->IPU1.DI1_PIN16).

enum di_sync_wave {
    DI_SYNC_NONE = -1,
    DI_SYNC_CLK = 0, /* pin 2 PU1_DI1_DISP_CLK  */
    DI_SYNC_INT_HSYNC = 1, /* IDN?? */
    DI_SYNC_HSYNC = 3, /* pin 27 PU1_DI1_PIN03 */
    DI_SYNC_VSYNC = 4, /* pin 31 PU1_DI1_PIN04 */
    DI_SYNC_DE = 16, /* pin 29 PU1_DI1_PIN16 */
};

Then i have add the timing parameters of the lcd in mxc_lcdif.c.

    {
    "KD020QVFMA009",
    70,
    320,
    240,
    120000,
    10, /* HBP */
    38, /* HFP */
    4, /* VBP */
    8, /* VFP */
    10, /* HSYNC pulse width  */
    4,  /* VSYNC pulse width */
    0, /* sync */
    FB_VMODE_NONINTERLACED, /* vmode */
    0, /* flag */
    },

Also i have declared this pins in the device tree and connected to the framebuffer

    lcd: lcd@0 {
            compatible = "fsl,lcd";
            ipu_id = <0>;
            disp_id = <0>;
            default_ifmt = "RGB666";
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_ipu1>;
            status = "okay";
        };

    mxcfb1: fb@0 {
        compatible = "fsl,mxc_sdc_fb";
        disp_dev = "lcd";
        interface_pix_fmt = "RGB666";
        mode_str ="KD020QVFMA009";
        default_bpp = <18>;
        int_clk = <0>;
        late_init = <0>;
        status = "okay";
    };
        
    
        pinctrl_ipu1: ipu1grp {
                    fsl,pins = <
                        MX6QDL_PAD_EIM_A16__IPU1_DI1_DISP_CLK    0x10 /* PCLK */
                        MX6QDL_PAD_EIM_DA15__IPU1_DI1_PIN04        0x10 /* VSYNC */
                        MX6QDL_PAD_EIM_DA12__IPU1_DI1_PIN03        0x10 /* HSYNC */
                        MX6QDL_PAD_EIM_BCLK__IPU1_DI1_PIN16        0x10 /* LCD BIAS (ENABLE) */
                        //MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04        0x80000000 /* ??? */
                        MX6QDL_PAD_EIM_LBA__IPU1_DI1_PIN17        PAD_CTRL_NO
                        //MX6QDL_PAD_EIM_WAIT__GPIO5_IO00            PAD_CTRL_NO
                        MX6QDL_PAD_EIM_DA9__IPU1_DISP1_DATA00    0x10 /* DB0 */
                        MX6QDL_PAD_EIM_DA8__IPU1_DISP1_DATA01    0x10 /* DB1 */
                        MX6QDL_PAD_EIM_DA7__IPU1_DISP1_DATA02    0x10 /* DB2 */
                        MX6QDL_PAD_EIM_DA6__IPU1_DISP1_DATA03    0x10 /* DB3 */
                        MX6QDL_PAD_EIM_DA5__IPU1_DISP1_DATA04    0x10 /* DB4 */
                        MX6QDL_PAD_EIM_DA4__IPU1_DISP1_DATA05    0x10 /* DB5 */
                        MX6QDL_PAD_EIM_DA3__IPU1_DISP1_DATA06    0x10 /* DB6 */
                        MX6QDL_PAD_EIM_DA2__IPU1_DISP1_DATA07    0x10 /* DB7 */
                        MX6QDL_PAD_EIM_DA1__IPU1_DISP1_DATA08    0x10 /* DB8 */
                        MX6QDL_PAD_EIM_DA0__IPU1_DISP1_DATA09    0x10 /* DB9 */
                        MX6QDL_PAD_EIM_EB1__IPU1_DISP1_DATA10    0x10 /* DB10 */
                        MX6QDL_PAD_EIM_EB0__IPU1_DISP1_DATA11    0x10 /* DB11 */
                        MX6QDL_PAD_EIM_A17__IPU1_DISP1_DATA12    0x10 /* DB12 */
                        MX6QDL_PAD_EIM_A18__IPU1_DISP1_DATA13    0x10 /* DB13 */
                        MX6QDL_PAD_EIM_A19__IPU1_DISP1_DATA14    0x10 /* DB14 */
                        MX6QDL_PAD_EIM_A20__IPU1_DISP1_DATA15    0x10 /* DB15 */
                        MX6QDL_PAD_EIM_A22__IPU1_DISP1_DATA17    0x10 /* DB16 */
                        MX6QDL_PAD_EIM_A23__IPU1_DISP1_DATA18    0x10 /* DB17 */
                    >;
                };

the problem is the lcd still black and if i try to start a Qt QML application using eglfs but it doesn't work. At that the kernel throws me some information as below

[   18.125621] mxc_sdc_fb fb@0: timeout when waiting for flip irq

[  612.271350] mxc_sdc_fb fb@0: MXCFB_WAIT_FOR_VSYNC: timeout 0

I don't know if i did miss something else. I'm afraid the mapping of VSYNC/HSYNC doesn't happen because i hooked up an oscilloscope and i don't see signals.

How can i use this interface for my LCD?

Thank you for reply

Ahmed

0 Kudos
1 Reply

740 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ahmed

for remapping of VSYNC/HSYNC one can look on

i.MX53: How to move VGA external HSYNC and VSYNC signals to different pins? 

for simplicity one can try to initialize lcd in uboot.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos