Device Tree Overlay for Verdin Yavia

Hello all,

We are currently working on a custom carrier board for the Verdin IMX8MM 1GB DL module.
I am getting stuck on the device tree.
Our board is based on the Yavia board, so we are using the imx8mm-verdin-nonwifi-yavia.dts device tree as a starting point and we are writing an overlay on top of it.
In the overlay, we use pin SODIMM 19 for PWM_3_DSI instead of PWM1_out.

I have disabled pwm1, but the uboot keeps providing this message:

Starting kernel ...

[    0.871983] imx-drm 32c00000.bus:display-subsystem: no available port
[    2.479132] regulator-dummy: Underflow of regulator enable count
Starting version 250.5+
[    5.436245] imx8mm-pinctrl 30330000.pinctrl: pin MX8MM_IOMUXC_GPIO1_IO01 already requested by 30660000.pwm; cannot claim for hdmi-connector
[    5.502170] imx8mm-pinctrl 30330000.pinctrl: pin-11 (hdmi-connector) status -22
[    5.538075] imx8mm-pinctrl 30330000.pinctrl: could not request pin 11 (MX8MM_IOMUXC_GPIO1_IO01) from group pwm3dsihpdgpiogrp  on device 30330000.pinctrl
[    5.553075] display-connector hdmi-connector: Error applying setting, reverse things back
[    8.375964] mcp251xfd spi2.0 (unnamed net_device) (uninitialized): Failed to detect MCP251xFD (osc=0x00000000).

Does anyone know what I am doing wrong?

Kind regards,
Anouk

Hello @xAnouk,

Would you mind telling us what BSP you are using?

And can you share your overlay with us?

-Thanks

Hello, this is currently the overlay:

/dts-v1/;
/plugin/; //Indicates that this is a Deice tree overlay. 

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

#include <dt-bindings/gpio/gpio.h>
#include "dt-bindings/pwm/pwm.h"
#include "imx8mm.dtsi"
#include "imx8mm-pinfunc.h"

/* iMX8 peripheral */

// / {
// 	// imx8mm-verdin.dtsi:
// 	hdmi_connector: hdmi-connector {
// 		compatible = "hdmi-connector";
// 		ddc-i2c-bus = <&i2c2>;
// 		// Verdin PWM_3_DSI (SODIMM 19)
// 		hpd-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
// 		label = "hdmi";
// 		pinctrl-names = "default";
// 		pinctrl-0 = <&pinctrl_pwm_3_dsi_hpd_gpio>;
// 		type = "a";
// 		status = "okay";
// 	};
// };

&pwm1 {
	status = "disabled";
};

&backlight {
	status = "disabled";
};

/* iMX8 peripheral */
&iomuxc {

	/* CLK */
	/* pin_CLK: pins_clk {*/
    /*	fsl,pins = */
    /* 		<MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K		0x06>;*/
	/* };*/

	pinctrl_timer_1: timer1 {
    	fsl,pins = 
			<MX8MM_IOMUXC_SAI3_RXD_GPT1_COMPARE1		0x6>,	/* SODIMM 135 to CAN_SYNC driver*/
			<MX8MM_IOMUXC_SAI3_TXFS_GPT1_CAPTURE2		0x6>;	/* SODIMM 129 from external timer */ 
	};

	/* Verdin SPI 2 */
	pinctrl_ecspi1: ecspi1grp {
		fsl,pins =
			<MX8MM_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK		0x6>,	/* SODIMM 137 */
			<MX8MM_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI		0x6>,	/* SODIMM 139 */
			<MX8MM_IOMUXC_ECSPI1_MISO_ECSPI1_MISO		0x6>;	/* SODIMM 141 */
			//<MX8MM_IOMUXC_ECSPI1_SS0_ECSPI1_SS0		    0x6>;	/* SODIMM 143 */
	};

	/* Einde toegevoegd */
	pinctrl_can1_ext: can1extgrp {
		fsl,pins =
			//<MX8MM_IOMUXC_GPIO1_IO06_GPIO1_IO6		0x146>;	/* INT CAN_1_SPI_INT#_1.8V */
			/*  .. ext pin .. */
			<MX8MM_IOMUXC_GPIO1_IO00_GPIO1_IO0		0x6>;	/* EXT CAN_1_SPI_INT#_1.8V SODIMM 216 */
	};
};

/* SPI 2 */
&ecspi1 {
	#address-cells = <1>;
	#size-cells = <0>;
	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1>;
	status = "okay";

	can2: can@0 {
		compatible = "microchip,mcp25625";
		clocks = <&clk40m>;
		gpio-controller;
        interrupt-parent = <&gpio1>;
		interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
		microchip,clock-allways-on;
		microchip,clock-out-div = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can1_ext>;
		reg = <0>;
		spi-max-frequency = <2000000>;
		status = "okay";
	};
};

&can1 {
	status = "disabled";
};

/* Verdin SPI 1 */
&ecspi2 {
	status = "disabled";
};

&ecspi3 {
	status = "disabled";
};


/* iMX8 peripheral */
&gpio3 {
    status = "okay"; 
};

/* Timer 1 nog niet gevonden, verwijst naar zichzelf..? pinctrl_timer_1*/
&pinctrl_timer_1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_timer_1>;
    status = "okay";
};

/* Activate Digital Audio Out SODIMM 42 44 46 (48 =din)*/ 
&pinctrl_sai5 {
    status = "okay";
};

// /* iMX8 peripheral */
// &mipi_dsi {
//     status = "okay";
// };

/* Verdin UART_1 Disable, otherwise overlap can_sync_1v8 SODIMM 135 */
&uart2 {
    status = "disabled";
};

/* Verdin UART_2 Disable, otherwise overlap SPI*/
&uart3 {
    status = "disabled";
};

// /* Verdin PWM_3_DSI SODIMM 19 HDMI */
// &pwm1 {
// 	status = "okay";
// };

/* EEPROM on display adapter boards */
&eeprom_display_adapter {
	status = "disabled";
};

/* EEPROM on Verdin yavia board */
&eeprom_carrier_board {
	status = "disabled";
};

/* Verdin SODIMM 12/14*/
&i2c4 {
	status = "disabled";
};

/* iMX8 peripheral */
&gpu {
	status = "okay";
};

/* Verdin SODIMM 93/95 Lontium*/
// &i2c3 {
// 	status = "okay";
// 	/* next line also is added by verdin on otehr i2c bus.. */
// 	hdmi_lontium_lt8912: hdmi@48 {
// 		compatible = "lontium,lt8912b";
// 		pinctrl-names = "default";
// 		pinctrl-0 = <&pinctrl_gpio_10_dsi>;
// 		reg = <0x48>;
// 		/* Verdin GPIO_9_DSI (LT8912 INT, SODIMM 17, unused) */
// 		/* Verdin GPIO_10_DSI (SODIMM 21) */
// 		reset-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
// 		status = "okay";

// 		ports {
// 			#address-cells = <1>;
// 			#size-cells = <0>;

// 			port@0 {
// 				reg = <0>;

// 				lt8912_1_in: endpoint {
// 					data-lanes = <1 2 3 4>;
// 					remote-endpoint = <&mipi_dsi_bridge1_out>;
// 				};
// 			};

// 			port@1 {
// 				reg = <1>;

// 				lt8912_1_out: endpoint {
// 					remote-endpoint = <&hdmi_connector_in>;
// 				};
// 			};
// 		};
// 	};
// };


// &hdmi_connector {
// 	status = "okay";

// 	port {
// 		hdmi_connector_in: endpoint {
// 			remote-endpoint = <&lt8912_1_out>;
// 		};
// 	};
// };

/* Verdin SODIMM 53/55 HDMI connector*/
&i2c2 {
	status = "okay";
};

/* iMX8 peripheral */
&lcdif {
	status = "okay";
};

/* iMX8 peripheral */
// &mipi_dsi {
// 	#address-cells = <1>;
// 	#size-cells = <0>;
// 	status = "okay";

// 	port@1 {
// 		mipi_dsi_bridge1_out: endpoint {
// 			attach-bridge;
// 			remote-endpoint = <&lt8912_1_in>;
// 		};
// 	};
// };



In the device tree, I am trying to add the HDMI controller, which is connected to i2c3. Moreover, I am trying to get a CAN connector working, which is connected to Toradex SPI2, so escpi1 in the device tree. We have a CAN chip on our external board.

Both the HDMI controller and CAN chip do not seem to work.

I do not know exactly what a BSP is, but I am using the torizoncore 6.2 without evaluation containers as base image.

Hey @xAnouk,


*small correction, BSP is being use behind the scene, I was more interested if you are using yocto or TorizonCore.

I’m a little confused on this. PWM_3_DSI is the Verdin function on pin 19 for PWM1_OUT. We can see this via the datasheet on 5**.13 PWM**. And on 5.6 Displays, where it is used for backlight brightness control. So it doesn’t make sense to disable/enable this pin for the same function. Can you elaborate on what you are trying to do here?

Verdin imx8mm datasheet

Here is the hdmi-connector.yaml file that describes the requirements of the hdmi-connector device tree.

It also looks like you have i2c2 and i2c3 intermixed. Can you verify what what you are using?

-Eric

Hello Eric,

Thank you for your reply.

The SCL and SDA of I2C_4 of the verdin module are directly connected to the Lontium chip.
I understood that the I2C_4 corresponds with the i2c3 in the device tree, so I added the information to the i2c3 part.

The i2c2 signal is also used , but this is used for a HDMI i2c level shifter.

Blockquote And on 5.6 Displays, where it is used for backlight brightness control. So it doesn’t make sense to disable/enable this pin for the same function. Can you elaborate on what you are trying to do here?

I think, what I was trying to achieve is to use the SODIMM 19 pin as hdp-gpio.

In the posted device tree, i have commented the whole HDMI part out and this resolves this error:

imx8mm-pinctrl 30330000.pinctrl: pin MX8MM_IOMUXC_GPIO1_IO01 already requested by 30660000.pwm; cannot claim for hdmi-connector

However, I do not understand what I should adapt to avoid to get this error.

I hope this is a bit clearer.

Hey @xAnouk,

That error is based on two drivers attempting to use the same pin. MX8MM_IOMUXC_GPIO1_IO01 is in a two pin control groups: pwm1grp, pwm3dsihpdgpiogrp. So you’re correct to disable pwm1.

It’s a bit hard to understand what was enabled when testing. And your hdmi_connector group looks a bit more complicated than it needs to be. I’m not sure you need pinctrl-0 property, or if this is where its seeing the conflict.

Here is our imx8mm-verdin hdmi connector node hdmi_connector

And we also have our sample overlay that modifies the node: overlay @ hdmi node

Are you able to mimic these nodes for for system to see if will fix the error?

-Eric

Hello,

Thank you for your help.

I have solved some errors, but some new ones occured.

I have stripped my device tree and I am now focusing only on getting the HDMI port to work. This is currently my code:

&i2c3 {
	clock-frequency = <100000>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c3>;
	pinctrl-1 = <&pinctrl_i2c3_gpio>;
	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
	sda-gpios = <&gpio5 19(GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
	status = "okay";

	lt_bridge: lt8912@48 {
		compatible = "lontium,lt8912";
		reg = <0x48>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_10_dsi>;
		reset-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
		// hpd-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
		// digi,dsi-lanes = <4>;
		status = "okay";

		port {
			lt8912_1_in: endpoint {
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&mipi_dsi_hdmi_out>;
			};
		};

	};
};

&hdmi_connector {
	status = "okay";
};


&mipi_dsi {
	status = "okay";

	port@1 {
		mipi_dsi_hdmi_out: endpoint {
			remote-endpoint = <&lt8912_1_in>;
		};
	};
};

I keep getting the following errors:

[    2.695816] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e10000 to encoder DSI-34: -19
[    2.707539] imx_sec_dsim_drv 32e10000.mipi_dsi: Failed to attach bridge: 32e10000.mipi_dsi
[    2.715809] imx_sec_dsim_drv 32e10000.mipi_dsi: failed to bind sec dsim bridge: -19

From what I understand, this means that the MIPI-DSI bridge cannot be connected to the encoder, but I do not know how to solve this issue.

Kind regards,
Anouk

Hey @xAnouk,

I believe the lt8912 bridge need’s both the input and outgoing port. It looks like you have included only one of the ports. As the documents here suggest for the device tree.

-Eric

Hello Eric,

Thank you for your answer. I have added the input and outgoing port, but it still does not seem to work…


&i2c3 {
	clock-frequency = <400000>;
	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&pinctrl_i2c3>;
	pinctrl-1 = <&pinctrl_i2c3_gpio>;
	scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
	sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

		hdmi_lontium_lt8912b: hdmi@48 {
		compatible = "lontium,lt8912b";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_10_dsi>;
		reg = <0x48>;
		/* Verdin GPIO_9_DSI (LT8912 INT, SODIMM 17, unused) */
		/* Verdin GPIO_10_DSI (SODIMM 21) */
		reset-gpios = <&gpio3 3 GPIO_ACTIVE_LOW>;
		status = "okay";

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

		port@0 {
			reg = <0>;

			lt8912_1_in: endpoint {
				data-lanes = <1 2 3 4>;
				remote-endpoint = <&mipi_dsi_bridge1_out>;
			};
		};

		port@1 {
			reg = <1>;

			lt8912_1_out: endpoint {
				remote-endpoint = <&hdmi_connector_in>;
			};
		};
	};
};
};

&hdmi_connector {
	status = "okay";

	port {
		hdmi_connector_in: endpoint {
			remote-endpoint = <&lt8912_1_out>;
		};
	};
};

&mipi_dsi {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";

	port@1 {
		mipi_dsi_bridge1_out: endpoint {
			remote-endpoint = <&lt8912_1_in>;
			attach-bridge;
		};
	};
};

Hey @xAnouk,

Taking a look at the dts for imx8mm, I believe you want to use the &i2c4 node and not &i2c3.

Looking at the schematics for the Yavia board. the I2C connection for the lt8912 traces back to SODIMM pin 14 and 12.This is associated with pinctrl_i2c4:i2c4grp which has a reference note of Verdin I2C_1. Which is used by the &I2c4 node.

Here is the device tree imx8mm dts. I believe this to be correct. Would you mind trying to use this node instead?

-Eric

Hey @xAnouk,

How are you doing for this topic? Did @i2c4 node work?

-Eric

Dear Eric,

Took a while but I’m back working on the HDMI port. We have changed the wiring of our custom board, so that it is wired the same as the Yavia board, which means that now the HDMI port is indeed on I2C_4.

However, I do see the Easy Installer on the board, but it does not work afterwards.
I’m just using the dsi_to_hdmi overlay which is also used for the Verdin board.

Do you have any idea how this could occur?

Kind regards,
Anouk

@xAnouk,

Welcome back!

Can you elaborate on what you mean by you see it but it does not work? As in what are you trying to do, and what is or is not happening.

Thanks

  • Eric

Dear Eric,

Sorry for my confusing description.

I mean that the HDMI adapter is working when I’m in the Easy Installer. However, if I download an image from the Easy Installer, the HDMI adapter is not working anymore.

Kind regards,
Anouk

Hello @xAnouk,

You’ll need to make sure the overlay is included for the HDMI port you are using.

For the IMX8MM DSI to HDMI, this would be the one.

IMX8MM DSI to HDMI overlay

Here is also some informatino on Device tree Overlays.

Device-Tree-Overlay Quick Link

-Eric

Hello @xAnouk ,
Were you able to solve your issue with the info provided by @eric.tx ?

Best regards,
Josep