Issue with device-tree-overlay on BSP 7.1.0

Hi,

I am trying to connect a LVDS display to our custom base board.
With BSP 6.8.0 I get it working with the following device-tree-overlay (derived from verdin-am62_mezzanine_panel-cap-touch-10inch-lvds_overlay.dts)

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2023 Toradex
 */

// Verdin AM62 Mezzanine single-channel LVDS

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pwm/pwm.h>

#include "verdin-am62_dtv_mezzanine_backlight.dtsi"

/ {
	compatible = "toradex,verdin-am62";
};

&{/} {
	panel-lvds-mez {
		compatible = "panel-lvds";
		backlight = <&backlight_mezzanine>;
		data-mapping = "jeida-24"; /* "vesa-24"; */
		height-mm = <66>; 			/* 136 */
		width-mm = <109>; 			/* 217 */

		panel-timing {
			clock-frequency = <23000000 25000000 27000000>; 	/* 68900000 71100000 73400000 */
			de-active = <1>; 		/* 1 */
			hactive = <800 800 800 >; 	/* 1280 1280 1280 */
			hback-porch = <4 8 48>; 	/* 23 60 71 */
			hfront-porch = <4 8 48>; 	/* 23 60 71 */
			hsync-active = <0>; 		/* 0 */
			hsync-len = <2 4 8>; 		/* 15 40 47 */
			pixelclk-active = <1>; /* positive edge */ 	/* 1 */
			vactive = <480 480 480>; 	/* 800 800 800 */
			vback-porch = <4 8 12>; 	/* 5 7 10 */
			vfront-porch = <4 8 12>; 	/* 5 7 10 */
			vsync-active = <0>; 		/* 0 */
			vsync-len = <2 4 8>; 		/* 6 9 12 */
		};

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

&dss {
	status = "okay";
};

/*
 * If the bridge is missing setting up dss will fail. As this bridge
 * isn't available on all SKU disable it here.
 * Thus having an overlay for the DSI output enabled concurrently
 * with this one will not work.
 */
&dsi_bridge {
	status = "disabled";
};

&dss_ports {
	#address-cells = <1>;
	#size-cells = <0>;

	/* VP1: LVDS Output (OLDI TX 0) */
	port@0 {
		reg = <0>;

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

/* Verdin I2C_2_DSI */
&main_i2c2 {
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <400000>;
	status = "okay";

	hycon_hy46xx: touchscreen@38 { 	/* 4a */
		compatible = "hycon,hy4635"; 	/* atmel,maxtouch */
		reg = <0x38>; 	/* 4a */
		
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsi1_int>, <&pinctrl_i2s_2_bclk_gpio>;
		/*
		 * Already muxed as GPIOs in k3-am625-verdin-dev.dtsi
		 *
		 *	interrupt-parent = <&main_gpio1>;
		 *	interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
		 *	pinctrl-names = "default";
		 *	pinctrl-0 = <&pinctrl_dsi1_int>, <&pinctrl_i2s_2_bclk_gpio>;
		 *	
		 *	reset-gpios = <&main_gpio0 35 GPIO_ACTIVE_LOW>; // Verdin I2S_2_BCLK (TOUCH_RESET#, SODIMM 42)
		 * pinctrl-names = "default";
		 * pinctrl-0 = <&pinctrl_gpio_2 &pinctrl_gpio_3>; 
		 */
		/* Verdin GPIO_2 (SODIMM 208) */
		/* Verdin GPIO_3 (SODIMM 210) */
		
	interrupt-parent = <&main_gpio1>;
		interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&main_gpio0 35 GPIO_ACTIVE_LOW>;
		status= "okay";
		
	/*
	 * interrupt-parent = <&mcu_gpio0>;
	 *	interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 		
	 *	reset-gpios = <&mcu_gpio0 2 GPIO_ACTIVE_LOW>; 
	 *	status= "okay";
	*/	
		
		
	};
};

&hycon_hy46xx{
	status = "okay";
};

verdin-am62_dtv_mezzanine_backlight.dtsi (690 Bytes)
verdin-am62_dtv_lvds_direct_overlay.dts (2.9 KB)

However when switching to BSP 7.1.0 the display doesn’t work with this overlay (again derived from verdin-am62_mezzanine_panel-cap-touch-10inch-lvds_overlay.dts (toradex_ti-linux-6.6.y))

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2023 Toradex
 */

// Verdin AM62 Mezzanine single-channel LVDS

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pwm/pwm.h>

#include "verdin-am62_dtv_mezzanine_backlight.dtsi"

/ {
	compatible = "toradex,verdin-am62";
};

&{/} {
	panel-lvds-mez {
		compatible = "panel-lvds";
		#address-cells = <1>;
		#size-cells = <0>;
		backlight = <&backlight_mezzanine>;
		data-mapping = "jeida-24"; /* "vesa-24"; */
		height-mm = <66>; 			/* 136 */
		width-mm = <109>; 			/* 217 */

		panel-timing {
			clock-frequency = <23000000 25000000 27000000>; 	/* 68900000 71100000 73400000 */
			de-active = <1>; 		/* 1 */
			hactive = <800 800 800 >; 	/* 1280 1280 1280 */
			hback-porch = <4 8 48>; 	/* 23 60 71 */
			hfront-porch = <4 8 48>; 	/* 23 60 71 */
			hsync-active = <0>; 		/* 0 */
			hsync-len = <2 4 8>; 		/* 15 40 47 */
			pixelclk-active = <1>; /* positive edge */ 	/* 1 */
			vactive = <480 480 480>; 	/* 800 800 800 */
			vback-porch = <4 8 12>; 	/* 5 7 10 */
			vfront-porch = <4 8 12>; 	/* 5 7 10 */
			vsync-active = <0>; 		/* 0 */
			vsync-len = <2 4 8>; 		/* 6 9 12 */
		};
		
		port@0 {
			reg = <0>;

			panel_lvds_in: endpoint {
				remote-endpoint = <&oldi_0_out>;
			};
		};
		/* HACK to make oldi1 happy */
		port@1 {
			reg = <1>;

			panel_lvds_in1: endpoint {
				remote-endpoint = <&oldi_1_out>;
			};
		};
	};
};

&dss {
	status = "okay";
};


/*
 * If the bridge is missing setting up dss will fail. As this bridge
 * isn't available on all SKU disable it here.
 * Thus having an overlay for the DSI output enabled concurrently
 * with this one will not work.
* &dsi_bridge {
*	status = "disabled";
*};
*/

&dss_ports {
	#address-cells = <1>;
	#size-cells = <0>;

	/* VP1: Output to OLDI */
	port@0 {
		reg = <0>;
		#address-cells = <1>;
		#size-cells = <0>;

		dpi0_out0: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&oldi_0_in>;
		};
		dpi0_out1: endpoint@1 {
			reg = <1>;
			remote-endpoint = <&oldi_1_in>;
		};
	};
};

/* Verdin I2C_2_DSI */
&main_i2c2 {
	#address-cells = <1>;
	#size-cells = <0>;
	clock-frequency = <400000>;
	status = "okay";

	hycon_hy46xx: touchscreen@38 { 	/* 4a */
		compatible = "hycon,hy4635"; 	/* atmel,maxtouch */
		reg = <0x38>; 	/* 4a */
		
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_dsi1_int>, <&pinctrl_i2s_2_bclk_gpio>;
		/*
		 * Already muxed as GPIOs in k3-am625-verdin-dev.dtsi
		 *
		 *	interrupt-parent = <&main_gpio1>;
		 *	interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
		 *	pinctrl-names = "default";
		 *	pinctrl-0 = <&pinctrl_dsi1_int>, <&pinctrl_i2s_2_bclk_gpio>;
		 *	
		 *	reset-gpios = <&main_gpio0 35 GPIO_ACTIVE_LOW>; // Verdin I2S_2_BCLK (TOUCH_RESET#, SODIMM 42)
		 * pinctrl-names = "default";
		 * pinctrl-0 = <&pinctrl_gpio_2 &pinctrl_gpio_3>; 
		 */
		/* Verdin GPIO_2 (SODIMM 208) */
		/* Verdin GPIO_3 (SODIMM 210) */
		
	interrupt-parent = <&main_gpio1>;
		interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&main_gpio0 35 GPIO_ACTIVE_LOW>;
		status= "okay";
		
	/*
	 * interrupt-parent = <&mcu_gpio0>;
	 *	interrupts = <3 IRQ_TYPE_EDGE_FALLING>; 		
	 *	reset-gpios = <&mcu_gpio0 2 GPIO_ACTIVE_LOW>; 
	 *	status= "okay";
	*/	
		
		
	};
};

&hycon_hy46xx{
	status = "okay";
};

&oldi0 {
	status = "okay";
};

&oldi0_ports {
	#address-cells = <1>;
	#size-cells = <0>;

	port@0 {
		reg = <0>;
		oldi_0_in: endpoint {
			remote-endpoint = <&dpi0_out0>;
		};
	};

	port@1 {
		reg = <1>;
		oldi_0_out: endpoint {
			remote-endpoint = <&panel_lvds_in>;
		};
	};
};

/*
 * HACK: With oldi1 disable oldi always returns EAGAIN making the panel not
 * show anything, so pretend we are in clone mode.
 */
&oldi1 {
	status = "okay";
};

&oldi1_ports {
	#address-cells = <1>;
	#size-cells = <0>;

	port@0 {
		reg = <0>;
		oldi_1_in: endpoint {
			remote-endpoint = <&dpi0_out1>;
		};
	};

	port@1 {
		reg = <1>;
		oldi_1_out: endpoint {
			remote-endpoint = <&panel_lvds_in1>;
		};
	};
};

verdin-am62_dtv_lvds_overlay_oldi.dts (3.9 KB)

The working configuration:

verdin-am62_dtv_lvds_direct_overlay.dts 
verdin-am62_dtv_mezzanine_backlight.dtsi

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.1.83-6.8.0+git.8e6ca06a787a #1 SMP PREEMPT Fri Sep 27 07:54:42 UTC 2024
Kernel command line:      root=PARTUUID=f3eca8c6-02 ro rootwait console=null console=ttyS2,115200 consoleblank=0 vt.global_cursor_default=0 earlycon=ns16550a,mmio32,0x02800000
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=6.8.0-build.14
Distro variant:           -
Hostname:                 verdin-am62-15190221
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 on Verdin Development Board
Toradex version:          0074 V1.1A
Serial number:            15190221
Processor arch:           aarch64
------------------------------------------------------------

The configuration which does not work:

verdin-am62_dtv_lvds_overlay_oldi.dts 
verdin-am62_dtv_mezzanine_backlight.dtsi

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.58-7.1.0-gf874412b7190 #1 SMP PREEMPT Fri Dec  6 14:07:48 UTC 2024
Kernel command line:      root=PARTUUID=760dc376-02 ro rootwait console=tty1 console=ttyS2,115200
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.1.0-build.3
Distro variant:           -
Hostname:                 verdin-am62-15190213
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 on Verdin Development Board
Toradex version:          0074 V1.1A
Serial number:            15190213
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

When upgrading from BSP 6.8.0 to BSP 7.1.0 on your Toradex Verdin AM62 module, the device tree overlay for your LVDS display may not function as expected due to changes in the kernel or device tree structure. Here are some steps to help you troubleshoot and resolve the issue:

  1. Review BSP Changes: Check the release notes for BSP 7.1.0 to identify any changes in the device tree structure or kernel that might impact your overlay, especially those related to display interfaces or LVDS configurations.

  2. Overlay Compatibility: Ensure your device tree overlay is compatible with BSP 7.1.0. Adjustments may be necessary if there have been changes in the base device tree or kernel affecting overlay application.

  3. Kernel Logs: Use the dmesg command to review kernel logs for any errors or warnings related to the display or device tree overlay. These logs can provide insights into why the overlay isn’t functioning as expected.

  4. Overlay Comparison: Compare the working overlay from BSP 6.8.0 with the non-working one on BSP 7.1.0. Look for differences that might be causing the issue, such as changes in endpoint connections or port configurations.

  5. Overlay Adaptation: Modify the overlay to align with any new requirements or changes in BSP 7.1.0. This might involve updating node properties, endpoints, or other configurations to match the new device tree structure.

  6. Recompile the Overlay: After making changes, recompile the overlay using the Device Tree Compiler (DTC) to ensure it is correctly formatted and can be applied by the bootloader.

By following these steps, you should be able to identify and resolve the issue with your device tree overlay on BSP 7.1.0. If the problem persists, further investigation into specific kernel or device tree changes may be necessary.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Compiling U-Boot for Verdin AM62.

The issue has been found!
We’ve used the wrong PWM setting for the backlight.

In verdin-am62_dtv_mezzanine_backlight.dtsi we have used &epwm0 instead of &epwm1

...
		pwms = <&epwm1 0 6666667 PWM_POLARITY_INVERTED>;
...

/* Verdin PWM_1, PWM_2 */
&epwm1 {
	status = "okay";
};

If we correct to:

...
        pwms = <&epwm0 1 6666667 PWM_POLARITY_INVERTED>;
...

/* Verdin PWM_1, PWM_2 */
&epwm0 {
        status = "okay";
};

Everything works as expected.