Problems bringing up LVDS on Apalis-imx8

Hi,

I am trying to bring up LVDS on Apalis evaluation board V1.1C, which has an
Apalis-imx8 SoM. To do that, I am modifying the device tree file to enable
LVDS and to include the display timing characteristics. The display is a
7" one from Riverdi (https://riverdi.com/product/high-brightness-ips-
display-rvt70hslfwca0-7-inch-projected-capacitive-touch-panel-air-bonding-
atouch-lvds-frame/).

According to Toradex (https://developer.toradex.com/knowledge-base/display-
output-resolution-and-timings-linux), LVDS interface has Device-Tree Node
Reference “ldb2”, so my current device tree file looks like this:

// SPDX-License-Identifier: GPL-2.0+ OR X11
/*

  • Copyright 2020 Toradex
    */

/dts-v1/;

#include “fsl-imx8qm-apalis-v1.1.dtsi”
#include “fsl-imx8qm-apalis-eval.dtsi”

/ {
model = “Toradex Apalis iMX8QM/QP V1.1 on TracPilot Board”;
compatible = “toradex,apalis-imx8qm-v1.1-eval”, “toradex
,apalis-imx8qm-eval”,
“toradex,apalis-imx8qm”, “fsl,imx8qm”;

riverdi_panel {
compatible = “riverdi_panel”;
backlight = <&backlight;>;
display-timings {
lvds {
clock-frequency = <51200000>;
hactive = <1024>;
vactive = <600>;
hfront-porch = <160>;
hsync-len = <140>;
hback-porch = <160>;
vfront-porch = <12>;
vsync-len = <20>;
vback-porch = <23>;
hsync-active = <0>;
vsync-active = <0>;
pixelclk-active = <0>;
};
};

port {
riverdi_panel_in: endpoint {
remote-endpoint = <&lvds1;_out>;
};
};
};
};

&ldb1; {
status = “disabled”;
};

&ldb2; {
status = “okay”;

lvds-channel@0 {
fsl,data-mapping = “spwg”;
fsl,data-width = <24>;
status = “okay”;

port@1 {
reg = <1>;

lvds1_out: endpoint {
remote-endpoint = <&riverdi;_panel_in>;
};
};
};
};

However, there is not clock signal and there are no LVDS signals on the LVDS
interface (X13). I can only see DC offset values on some of the LVDS signal
pins, so I am assuming its because there is no clock signal. What am I doing
wrong here? I would really appreciate your feedback.

Thank you very much for your help and I look forward to you reply.

Best regards,
Adam Barghati

Hi @ABTrac

Thanks for writing to the Toradex Community!
Could you provide the version of the hardware and software of your SoM?

Additionally please share also the connection diagram and the dmesg.log.

Thanks and best regards,
Jaski

Hi @jaski.tx

Thank you for the quick reply. Here is the hardware and software versions:

Apalis-iMX8QM 4GB WBIT V1.1C
Apalis Evaluation Board V1.1C
Linux: Boot2Qt 5.15 LTS with BSP 4.0

As for the dmesg.log, please find it in the attachments. I will provide you with a connection diagram shortly as I need a colleague to provide it to me, but does the display need to be connected to see any clock output on the lvds port?

I am aware because we are using Boot2Qt I should also ask Qt, which I did, but since this problem could also related to hardware or BSP I though to also ask here. I really appreciate your help.dmesg.log (101.6 KB)

@jaski.tx

Hi,

I am still not successful with LVDS, any hints would be really appreciated. Thank you

Hi @ABTrac

Thanks for the schematic. Actually I see that you use Boot2Qt 5.15 which is based on Bsp 3.0. Bsp 3.0 is not supported on Apalis iMX8QM 1.1C. I would suggest you to update to Bsp 5.0 and use the proposed device-tree overlays presented here.

Best regards,
Jaski

Thank you for replying.

As far as I know, Boot2Qt 5.15 is based on Zeus Linux, and Toradex BSP based on Zeus is 4.0 not 3.0 or am I wrong?

The image is working fine, I can boot Boot2Qt 5.15 on the Apalis iMX8QM 1.1C. I cannot update to BSP 5.0 because that would mean updating to Boot2Qt 6, and that is not an option for us.

Can you see anything wrong with the device tree file?

Hi Jaski

I think I am making progress. I added some extra pieces of code the the device tree (which can be found at the bottom). Now, I am receiving different drm display-subsystem boot messages:

[ 12.409258] /ldb@572410e0/lvds-channel@0: could not find display-timings node
[ 12.417966] /ldb@572410e0/lvds-channel@0: no timings specified
[ 12.429510] imx-drm display-subsystem: failed to bind ldb@572410e0 (ops imx_ldb_ops): -517

But, if you look at the device tree you will see I am using Panel Simple approach where I added lvds1_panel and the lp156wf1 timings are included in panel-simple.c by default. What could be the reason it is not picked up by drm? I have also tried the Panel LVDS approach where the display timings are in the device tree itself, but i still get the same problem.

Your help is very much appreciated. Thank you

Device tree:


// SPDX-License-Identifier: GPL-2.0+ OR X11
/*
 * Copyright 2020 Toradex
 */

/dts-v1/;

#include "fsl-imx8qm-apalis-trac-pilot.dtsi"
#include "fsl-imx8qm-apalis-eval.dtsi"


/ {
	model = "Toradex Apalis iMX8QM/QP V1.1 on TracPilot Board";
	compatible = "toradex,apalis-imx8qm-v1.1-eval", "toradex,apalis-imx8qm-eval",
		     "toradex,apalis-imx8qm", "fsl,imx8qm";

        lvds1_panel {
                compatible = "lg,lp156wf1";
                backlight = <&backlight>;
		status = "okay";

                port {
                        panel_lvds_in: endpoint {
                                remote-endpoint = <&ldb2_lvds0>;
                        };
                };
        };
};

&ldb2_phy {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	compatible = "mixel,lvds-phy";
	reg = <0x0 0x57241000 0x0 0x100>;
	clocks = <&clk IMX8QM_LVDS1_PHY_CLK>;
	clock-names = "phy";
	power-domains = <&pd_lvds1>;
	ldb2_phy1: port@0 {
		reg = <0>;
		#phy-cells = <0>;
	};
	ldb2_phy2: port@1 {
		reg = <1>;
		#phy-cells = <0>;
	};
};
&ldb2 {

	status = "okay";
	compatible = "fsl,imx8qm-ldb";
	clocks = <&clk IMX8QM_LVDS1_PIXEL_CLK>,
		 <&clk IMX8QM_LVDS1_BYPASS_CLK>;
	clock-names = "pixel", "bypass";
	power-domains = <&pd_lvds1>;
	gpr = <&lvds_region2>;

	lvds-channel@0 {
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0>;
		phys = <&ldb2_phy1>;
		phy-names = "ldb_phy";
		status = "okay";
		fsl,data-mapping = "jeida";
		fsl,data-width = <24>;

		port@0 {
			reg = <0>;
			ldb2_lvds0: endpoint {
				remote-endpoint = <&panel_lvds_in>;
			};
		};
	};
};

Hi @ABTrac

Good that you are making some progress. I have installed the Bsp 5.15.2 Partner Demo Image - Qt for Device Creation, where the 10inch LVDS Display is working well. Could you update to this image if not already done?

Further I would suggest to make your changes in this kernel branch and send me the git diff?

Best regards,
Jaski

@jaski.tx

Hi Jaski,

Thank you for the reply. I actually managed to get it to work and I now have dual display output, but in any case thank you very much for your support.

I just have one more related question though.

right now, when the board boots the HDMI interface is the primary one so I see the “Qt for Device Creation” demo screen on the HDMI screen. I want the LVDS display to be the primary display after booting and also be able to change this during run time. How can I achieve this?

For choosing which is primary at boot time, I added primary to the lvds-channel@0 child node inside ldb2 like this:

&ldb2 {

status = “okay”;
compatible = “fsl,imx8qm-ldb”;
clocks = <&clk IMX8QM_LVDS1_PIXEL_CLK>,
<&clk IMX8QM_LVDS1_BYPASS_CLK>;
clock-names = “pixel”, “bypass”;
power-domains = <&pd_lvds1>;
gpr = <&lvds_region2>;

lvds-channel@0 {
primary;
reg = <0>;
phys = <&ldb2_phy1>;
phy-names = “ldb_phy”;
status = “okay”;
fsl,data-mapping = “spwg”;
fsl,data-width = <24>;

            port@1 {
                    reg = <1>;

                    lvds1_out: endpoint {
                            remote-endpoint = <&panel_lvds_in>;
                    };
            };
    };

};

However this method doesn’t work. Is this the right way of achieving boot time LVDS as primary display?

Hi @ABTrac

I am not a QT expert, but I think this must be set in Qt application. So I think you need to forward the Qt Output to the correct framebuffer, but I don’t how this is done.

Maybe @stefan_e.tx can answer this?

Best regards,
Jaski

Hi @ABTrac

I assume you are using EGLFS. In this case you can modify the display settings by changing the /etc/kms.conf file. See this documentation:
https://doc.qt.io/qt-5/embedded-linux.html

Regards,
Stefan