Yocto Device Tree parse error IMX6

upgrade Yocto from BSP 2.8 to BSP 7 results in following custom device tree error. Potentially any breaking changes between BSP’s?

...
Error: /workdir/build/tmp/work-shared/colibri-imx6/kernel-source/arch/arm/boot/dts/nxp/imx/imx6dl-colibri-custom-carrier.dts:63.31-32 syntax error
FATAL ERROR: Unable to parse input tree
...

Seems to be in line MX6QDL_PAD_EIM_D17__GPIO3_IO17 PAD_CTRL_HYS_PU /* SODIMM 96 */

/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "imx6dl.dtsi"
#include "imx6qdl-colibri.dtsi"

/ {
	model = "Toradex Colibri iMX6DL/S on Colibri Evaluation Board V3";
	compatible = "toradex,colibri_imx6dl-eval", "toradex,colibri_imx6dl", "fsl,imx6dl";

	aliases {
		/* the following, together with kernel patches, forces a fixed assignment
		   between device id and usdhc controller */
		/* i.e. the eMMC on usdhc3 will be /dev/mmcblk0 */
		mmc0 = &usdhc3; /* eMMC */
		mmc1 = &usdhc1; /* MMC 4bit slot */
	};

	extcon_usbc_det: usbc_det {
		compatible = "linux,extcon-usb-gpio";
		debounce = <25>;
		id-gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_usbc_det_1>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_keys>;

		wakeup {
			label = "Wake-Up";
			gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_WAKEUP>;
			debounce-interval = <10>;
			gpio-key,wakeup;
		};
	};

	regulators {
		reg_usb_host_vbus: usb_host_vbus {
			status = "okay";
		};
	};
};

&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <
		&pinctrl_gpio_tub
	>;

	gpio {
		pinctrl_gpio_tub: gpio-tub {
			fsl,pins = <
				/* Pins for the PUMP GPIO IN */
				MX6QDL_PAD_EIM_D17__GPIO3_IO17   PAD_CTRL_HYS_PU /* SODIMM 96 */

				/* EN_LAMP */
				MX6QDL_PAD_SD2_DAT0__GPIO1_IO15	 PAD_CTRL_HYS_PU /* SODIMM 98 */

				/* Pins for the STATUS LEDS */
				MX6QDL_PAD_NANDF_D4__GPIO2_IO04  PAD_CTRL_HYS_PU /* SODIMM 102 */
				MX6QDL_PAD_SD4_DAT0__GPIO2_IO08  PAD_CTRL_HYS_PU /* SODIMM 104 */

				/* RS485 RE_ and ON */
				MX6QDL_PAD_SD4_DAT5__GPIO2_IO13  PAD_CTRL_HYS_PU /* SODIMM 34 */
				MX6QDL_PAD_SD4_DAT6__GPIO2_IO14  PAD_CTRL_HYS_PU /* SODIMM 32 */
			>;
		};
	};

	pwm {
		pinctrl_pwm_tub: pwm-tub {
			fsl,pins = <
				/* PWM for PWM_LAMP signal */
				MX6QDL_PAD_SD4_DAT1__PWM3_OUT 	 0x1b0b1		 /* SODIMM 59 */
			>;
		};
	};

	uart2 {
		pinctrl_uart2_tub: uart2-tub {
			fsl,pins = <
				/* UART for the RS485 communication, only use RX and TX */
				MX6QDL_PAD_SD4_DAT4__UART2_TX_DATA   0x1b0b1
				MX6QDL_PAD_SD4_DAT7__UART2_RX_DATA   0x1b0b1
			>;
		};
	};
};

/* PWM for PWM_LAMP signal */
&pwm3 {
	status = "okay";
	pinctrl-0 = <&pinctrl_pwm_tub &pinctrl_pwm_a_cif_d7>;
};

/* UART for serial interface with module */
&uart1 {
	status = "okay";
};

/* UART for RS485 communication */
&uart2 {
	status = "okay";
	pinctrl-0 = <&pinctrl_uart2_tub>;
	/* Delete the uart-has-rtscts property so these pins can be used as IO */
	/delete-property/fsl,uart-has-rtscts;
};

/* USB */
&usbh1 {
	status = "okay";
};

/* USB-OTG for debugging purposes */
&usbotg {
	status = "okay";
	extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
};

/* MMC */
&usdhc1 {
	status = "okay";
};

&weim {
	status = "okay";
	fsl,weim-cs-gpr = <&gpr>;
	/* weim memory map: 32MB on CS0, 32MB on CS1, 32MB on CS2, 32MB on CS3 */
	ranges = <0 0 0x08000000 0x02000000
	          1 0 0x0a000000 0x02000000
	          2 0 0x0c000000 0x02000000
	          3 0 0x0e000000 0x02000000>;
	/* SRAM on CS0 */
	sram@0,0 {
		compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
		reg = <0 0 0x00010000>;
		#address-cells = <1>;
		#size-cells = <1>;
		bank-width = <2>;
		fsl,weim-cs-timing = <0x00010081 0x00000000 0x04000000
				0x00000000 0x04000040 0x00000000>;
	};
	/* SRAM on CS1 */
	sram@1,0 {
		compatible = "cypress,cy7c1019dv33-10zsxi, mtd-ram";
		reg = <1 0 0x00010000>;
		#address-cells = <1>;
		#size-cells = <1>;
		bank-width = <2>;
		fsl,weim-cs-timing = <0x00010081 0x00000000 0x04000000
				0x00000000 0x04000040 0x00000000>;
	};
};

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,

The syntax error you’re encountering in your custom device tree file after upgrading from Yocto BSP 2.8 to BSP 7 could be due to changes in the device tree syntax or pin definitions between these BSP versions. Here are some steps to help you troubleshoot and resolve the issue:

  1. Check for Syntax Changes: Review the release notes or documentation for BSP 7 to identify any changes in device tree syntax or structure that might affect your custom file. Syntax rules can evolve between BSP versions, leading to errors if older syntax is used.

  2. Verify Pin Definitions: The error seems to be related to the pin definition MX6QDL_PAD_EIM_D17__GPIO3_IO17. Ensure that this pin and its associated control settings (PAD_CTRL_HYS_PU) are still valid in BSP 7. Pin definitions and their configurations can change between BSP versions.

  3. Compare Device Tree Files: Compare your custom device tree file with the default device tree files provided in BSP 7. Look for differences in how pins and peripherals are defined and configured.

  4. Use Device Tree Compiler (DTC): Use the Device Tree Compiler to validate your device tree file. The DTC can provide more detailed error messages that might help pinpoint the exact issue.

  5. Consult BSP 7 Documentation: Review the BSP 7 documentation for any specific notes on device tree changes or migration guides that might highlight necessary adjustments for custom device trees.

By following these steps, you should be able to identify and correct the syntax error in your device tree file. If the issue persists, consider simplifying the device tree to isolate the problematic section or consult the BSP’s changelog for more detailed information on changes affecting device trees.

Best regards,
Toradex AI Assistant.

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

Verdin iMX8M Mini, GStreamer error when opening vpuenc_h264.

Unfortunately I was not able to find the solution based on the information provided.

Hi @dremsol!

Since you are upgrading an old BSP version to the latest, you might face some breaking changes.

About your error, it is probably caused by PAD_CTRL_HYS_PU, since we don’t use it anymore. Instead, we use hexadecimal values for the pin setting. I would recommend you check a newer device tree for any potential errors like that one. For example, imx6dl-colibri-aster.dts or imx6qdl-colibri.dtsi.

Feel free to ask if you face any issues or doubts.

Best regards.
Lucas Azeituno.

Hi @lucas_az.tx

Thanks! By replacing PAD_CTRL_HYS_PU by a hexadecimal number I managed to get a successful build besides some other changes in the DT. In the process, I would like to perform some comparisions with BSP 2.8 but stumbled upon the following issue

Hi @dremsol!

As my colleague said in the topic you sent, BSP 2.8 is in EOL and we don’t support it anymore. I recommend you try to build the BSP 7 and ask us if you face any issues or doubts.

Since the main issue of this topic (the parse error) is solved, can I mark my answer as a solution? We always ask to open different topics for different issues.

Remember, you’re always welcome to open another topic in the future.

Best regards.
Lucas Azeituno

hi @lucas_az.tx

Besides the pin settings. I had to make following changes to make the build succeed. The extcon_usbc_det node seems to be defined in imx6qdl-colibri.dtsi, and regulators does not exist anymore and is flattened in reg_usb_host_vbus: regulator-usb-host-vbus. finally pinctrl_pwm_a_cif_d7 is not defined anymore

Still need to test with hardware.

diff --git a/layers/meta-custom/recipes-kernel/linux/linux-toradex/imx6dl-colibri-custom-carrier.dts b/layers/meta-custom/recipes-kernel/linux/linux-toradex/imx6dl-colibri-custom-carrier.dts
index 870dbb8..83bd88d 100644
--- a/layers/meta-custom/recipes-kernel/linux/linux-toradex/imx6dl-colibri-custom-carrier.dts
+++ b/layers/meta-custom/recipes-kernel/linux/linux-toradex/imx6dl-colibri-custom-carrier.dts
@@ -21,14 +21,6 @@
                mmc1 = &usdhc1; /* MMC 4bit slot */
        };

-       extcon_usbc_det: usbc_det {
-               compatible = "linux,extcon-usb-gpio";
-               debounce = <25>;
-               id-gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_usbc_det_1>;
-       };
-
        gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
@@ -43,11 +35,6 @@
                };
        };

-       regulators {
-               reg_usb_host_vbus: usb_host_vbus {
-                       status = "okay";
-               };
-       };
 };

 &iomuxc {
@@ -60,18 +47,18 @@
                pinctrl_gpio_tub: gpio-tub {
                        fsl,pins = <
                                /* Pins for the PUMP GPIO IN */
-                               MX6QDL_PAD_EIM_D17__GPIO3_IO17   PAD_CTRL_HYS_PU /* SODIMM 96 */
+                               MX6QDL_PAD_EIM_D17__GPIO3_IO17   0x1b0b0 /* SODIMM 96 */

                                /* EN_LAMP */
-                               MX6QDL_PAD_SD2_DAT0__GPIO1_IO15  PAD_CTRL_HYS_PU /* SODIMM 98 */
+                               MX6QDL_PAD_SD2_DAT0__GPIO1_IO15  0x1b0b0 /* SODIMM 98 */

                                /* Pins for the STATUS LEDS */
-                               MX6QDL_PAD_NANDF_D4__GPIO2_IO04  PAD_CTRL_HYS_PU /* SODIMM 102 */
-                               MX6QDL_PAD_SD4_DAT0__GPIO2_IO08  PAD_CTRL_HYS_PU /* SODIMM 104 */
+                               MX6QDL_PAD_NANDF_D4__GPIO2_IO04  0x1b0b0 /* SODIMM 102 */
+                               MX6QDL_PAD_SD4_DAT0__GPIO2_IO08  0x1b0b0 /* SODIMM 104 */

                                /* RS485 RE_ and ON */
-                               MX6QDL_PAD_SD4_DAT5__GPIO2_IO13  PAD_CTRL_HYS_PU /* SODIMM 34 */
-                               MX6QDL_PAD_SD4_DAT6__GPIO2_IO14  PAD_CTRL_HYS_PU /* SODIMM 32 */
+                               MX6QDL_PAD_SD4_DAT5__GPIO2_IO13  0x1b0b0 /* SODIMM 34 */
+                               MX6QDL_PAD_SD4_DAT6__GPIO2_IO14  0x1b0b0 /* SODIMM 32 */
                        >;
                };
        };
@@ -99,7 +86,7 @@
 /* PWM for PWM_LAMP signal */
 &pwm3 {
        status = "okay";
-       pinctrl-0 = <&pinctrl_pwm_tub &pinctrl_pwm_a_cif_d7>;
+       pinctrl-0 = <&pinctrl_pwm_tub &pinctrl_pwm3>;
 };

 /* UART for serial interface with module */

Hi @dremsol!

Were you able to test it?

Best regards.
Lucas Azeituno.