Device Tree Overlay for TFT Display iMX6

Hello,

I have been struggling with getting my TFT LCD (ER-TFT050-3) to work correctly based on the information detailed here : Device Tree Overlays on Torizon. I modified the dimensions of the sample overlays included in the container according to the dimensions and timings of my own display. Here is the overlay I compiled and enabled:

/dts-v1/;

/plugin/;

/ {

    compatible = "toradex";
    fragment@0 {
            target-path = "/panel-dpi";
            __overlay__ {
                    width-mm = <108>;
                    height-mm = <64>;
		panel-timing {
                            clock-frequency = <33300000>;
                            hactive = <800>;
                            vactive = <480>;
                            hsync-len = <40>;
                            hfront-porch = <210>;
                            hback-porch = <46>;
                            vsync-len = <1>;
                            vfront-porch = <22>;
                            vback-porch = <23>;
                            pixelclk-active = <1>;
                    };
            };
    };

};

With this, I get the display to work, but the image seems as if there were some bits disconnected or incorrect format.
Here is a picture of how it looks.
I hope anyone can shed a light on this issue.

Thank you!

alt text

Hi @jaimeibk,

Where did you get the timing values for this display?

Hi, Jeremias

Got them from the vendor. https://www.buydisplay.com/download/ic/ILI6122.pdf (pages 45 and 46)

Where did you get the value for the clock-frequency? In that data sheet it seems to say that the freq is 40MHz to 50MHz max.

Also in device trees you can input a range of timing values as seen here: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/display-timing.txt. Perhaps you can try adding the range as specified in that datasheet to see if it helps.

Also try setting pixelclk-active to 0 and see if that improves the quality.

Page 43 says 40MHz, but page 45 says 33.3MHz. Anyway, I tried in several more ways.

Apparently, ranges only work for front-porch values. Whenever I added ranges to clock frequency, or hsync-len or vsync-len, the display would not work. Still, the image does not seem to improve significantly. It is very noticeable in the pictures I attached.
I am not sure if it has to do with timings anymore or if it has to do with color depth maybe. Could that be another possibility? LCD is wired as RGB24.

Any other ideas?

link text

That was it! Thanks!

Glad to hear it works!

Ahh I see now the display is RGB24 format.

In the device tree:

panel_dpi: panel-dpi {
                compatible = "panel-dpi";
                backlight = <&backlight>;
                width-mm = <115>;
                height-mm = <86>;

                data-mapping = "bgr666";

                panel-timing {
                        clock-frequency = <25175000>;
                        hactive = <640>;
                        vactive = <480>;
                        hsync-len = <30>;
                        hfront-porch = <16>;
                        hback-porch = <114>;
                        vsync-len = <3>;
                        vfront-porch = <10>;
                        vback-porch = <32>;
                };

                port {
                        lcd_panel_in: endpoint {
                                remote-endpoint = <&lcd_display_out>;
                        };
                };
        };

Seems like you’ll need to change the data-mapping to the right format as well.

Hi,

Currently we are using same LCD (ILI6122) and working on imx6ull platform.
Can we use above node directly in DTS file ?

Currently dts file content is like below:

&lcdif {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_lcdif_dat
&pinctrl_lcdif_ctrl>;
display = <&display0>;
status = “okay”;

    display0: display {
            bits-per-pixel = <16>;
            bus-width = <24>;

            display-timings {
                    native-mode = <&timing0>;
                    timing0: timing0 {
                    clock-frequency = <33300000>;
                    hactive = <800>;
                    vactive = <480>;
                    hfront-porch = <210>;
                    hback-porch = <46>;
                    hsync-len = <40>;
                    vback-porch = <23>;
                    vfront-porch = <22>;
                    vsync-len = <1>;

                    hsync-active = <0>;
                    vsync-active = <0>;
                    de-active = <1>;
                    pixelclk-active = <1>;
                    };
            };
    };

};

But with above combination I didn’t get any data on LCD.

Can we use like below :

panel_dpi: panel-dpi {
compatible = “panel-dpi”;
backlight = <&backlight>;
width-mm = <115>;
height-mm = <86>;

             data-mapping = "bgr888";

             panel-timing {
                     clock-frequency = <25175000>;
                     hactive = <640>;
                     vactive = <480>;
                     hsync-len = <30>;
                     hfront-porch = <16>;
                     hback-porch = <114>;
                     vsync-len = <3>;
                     vfront-porch = <10>;
                     vback-porch = <32>;
             };

             port {
                     lcd_panel_in: endpoint {
                             remote-endpoint = <&lcd_display_out>;
                     };
             };
     };

And please can you mention where we need to link this “lcd_display_out” ? If you share any example DTS file, it will be more helpfull.
Thanks and Regards,
Devendra

Hi @Devendra and Welcome to the Toradex Community!

Could you please ask a new question with all the details to keep the community well organized and clean?

Thanks for your understanding.

Best regards,
Jaski