Imx6ull device tree error

Hello

I wanted to enable flexcan on a IMX6ULL board changing the device tree so i did the following


&ecspi1 {
	status = "okay";

	mcp2515: can@0 {
		compatible = "microchip,mcp2515";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can_int>;
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio2>;
		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <10000000>;
		vdd-supply = <&reg_3v3>;
		xceiver-supply = <&reg_5v0>;
		status = "disabled";
	};

	/* To keep the CAN controller enabled by default,
	 * disable conflicting spidev.
	 */
	spidev0: spidev@0 {
		status = "disabled";
	};
};

&can1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan1>;
	status = "okay";
};

&can2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan2>;
	status = "disabled";
};

&iomuxc {

	imx6ull-colibri {

	pinctrl_flexcan1: flexcan1grp{
                    fsl,pins = <
                            MX6UL_PAD_ENET1_RX_DATA0__FLEXCAN1_TX       0x1b020
                            MX6UL_PAD_ENET1_RX_DATA1__FLEXCAN1_RX       0x1b020
               >;
        };
	


	pinctrl_gpiotouch: touchgpios {
		fsl,pins = <
			MX6UL_PAD_NAND_DQS__GPIO4_IO16		0x74
			MX6UL_PAD_ENET1_TX_EN__GPIO2_IO05	0x14
		>;
	};
	};
};

But doing make im getting an error saying duplicated label… but i dont see any duplicate use of flexcan1grp

  DTC     arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtb
arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi:188.31-193.11: ERROR (duplicate_label): /soc/aips-bus@2000000/iomuxc@20e0000/imx6ull-colibri/flexcan1grp: Duplicate label 'pinctrl_flexcan1' on /soc/aips-bus@2000000/iomuxc@20e0000/imx6ull-colibri/flexcan1grp and /soc/aips-bus@2000000/iomuxc@20e0000/imx6ull-colibri/flexcan1-grp
ERROR: Input tree has errors, aborting (use -f to force output)
make[1]: *** [scripts/Makefile.lib:285: arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtb] Error 2
make: *** [Makefile:1270: imx6ull-colibri-eval-v3.dtb] Error 2

What im doing wrong?

Thanks

Hi @natxo !

From the error message you shared, we have:

This means that your changes are “recreating” the already existing pinctrl_flexcan1 label, which shouldn’t be done.

You can see that this label already exists here: imx6ull-colibri.dtsi « dts « boot « arm « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

I would like to also share with you our documentation about this topic: CAN (Linux) | Toradex Developer Center. Please check the iMX6ULL section here :wink:

Best regards,

Thanks!!!, i readed that link and did the following:

In imx6ull-colibri-eval-v3.dtsi

Disabled mcp2515 even im not in a collibri dev board (i have a viola, and yep i know no can tranceiver)

	mcp2515: can@0 {
		compatible = "microchip,mcp2515";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can_int>;
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio2>;
		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <10000000>;
		vdd-supply = <&reg_3v3>;
		xceiver-supply = <&reg_5v0>;
		status = "disabled";
	};

Enabled can1 and can2 in the same dtsi file

&can1 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan1>;
	status = "okay";
};

&can2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flexcan2>;
	status = "okay";
};

in imx6ull-colibri-nonwifi.dtsi

&iomuxc {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 
		&pinctrl_gpio4 &pinctrl_gpio6>;
};

Then compile Kernell

make colibri-imx6ull_defconfig
make nconfig
make -j$(nproc) zImage 2>&1 | tee build.log
make DTC_FLAGS="-@" imx6ull-colibri-eval-v3.dtb

when compiled the dtsi i get those warnings

  DTC     arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtb
arch/arm/boot/dts/imx6ull-colibri.dtsi:16.9-18.4: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name
arch/arm/boot/dts/imx6ul.dtsi:162.11-178.5: Warning (simple_bus_reg): /soc/busfreq: missing or empty reg/ranges property
  also defined at arch/arm/boot/dts/imx6ull.dtsi:65.11-83.5
  also defined at arch/arm/boot/dts/imx6ul.dtsi:162.11-178.5
  also defined at arch/arm/boot/dts/imx6ull.dtsi:65.11-83.5
arch/arm/boot/dts/imx6ul.dtsi:639.28-651.7: Warning (simple_bus_reg): /soc/aips-bus@2000000/anatop@20c8000/regulator-3p0: missing or empty reg/ranges property
  also defined at arch/arm/boot/dts/imx6ul.dtsi:639.28-651.7
arch/arm/boot/dts/imx6ul.dtsi:653.32-668.7: Warning (simple_bus_reg): /soc/aips-bus@2000000/anatop@20c8000/regulator-vddcore: missing or empty reg/ranges property
  also defined at arch/arm/boot/dts/imx6ul.dtsi:653.32-668.7
arch/arm/boot/dts/imx6ul.dtsi:670.31-685.7: Warning (simple_bus_reg): /soc/aips-bus@2000000/anatop@20c8000/regulator-vddsoc: missing or empty reg/ranges property
  also defined at arch/arm/boot/dts/imx6ul.dtsi:670.31-685.7
arch/arm/boot/dts/imx6ul.dtsi:706.29-713.6: Warning (simple_bus_reg): /soc/aips-bus@2000000/caam_secvio: missing or empty reg/ranges property
  also defined at arch/arm/boot/dts/imx6ul.dtsi:706.29-713.6
arch/arm/boot/dts/imx6ul.dtsi:951.23-956.6: Warning (simple_bus_reg): /soc/aips-bus@2100000/sim@0218c000: simple-bus unit address format error, expected "218c000"
  also defined at arch/arm/boot/dts/imx6ul.dtsi:951.23-956.6
arch/arm/boot/dts/imx6ul.dtsi:1034.23-1041.6: Warning (simple_bus_reg): /soc/aips-bus@2100000/sim@021b4000: simple-bus unit address format error, expected "21b4000"
  also defined at arch/arm/boot/dts/imx6ul.dtsi:1034.23-1041.6
arch/arm/boot/dts/imx6ul.dtsi:715.33-718.6: Warning (unique_unit_address): /soc/aips-bus@2000000/caam-snvs@20cc000: duplicate unit-address (also used in node /soc/aips-bus@2000000/snvs@20cc000)
  also defined at arch/arm/boot/dts/imx6ul.dtsi:715.33-718.6
arch/arm/boot/dts/imx6ull-colibri.dtsi:104.20-109.4: Warning (unique_unit_address): /soc/aips-bus@2000000/spba-bus@2000000/spi@2008000/spidev@0: duplicate unit-address (also used in node /soc/aips-bus@2000000/spba-bus@2000000/spi@2008000/can@0)
  also defined at arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi:95.20-97.4

Later i create the yocto image per docs, when done unzip the image file to a sdcard, replace zImage and imx6ull-colibri-eval-v3.dtb with the one i compiled later

Burn with easyinstaller and no can device shows and dmesg | grep -i can shows nothing…

I feel im close :slight_smile: What im missing?

Note i replaced the zImage i compiled with the one that is created when the yocto image and now i get can devices to show.

What i did wrong when compile the firmware? I would like to compile it myself

root@colibri-imx6ull-07323741:~# dmesg | grep -i can
[    9.105717] CAN device driver interface
[    9.220523] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not found, using dummy regulator
[    9.404898] flexcan 2094000.flexcan: 2094000.flexcan supply xceiver not found, using dummy regulator
root@colibri-imx6ull-07323741:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 00:14:2d:6f:c0:5d brd ff:ff:ff:ff:ff:ff
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can 
4: can1: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can

Sorry, lots of questions :slight_smile:

Hi @natxo !

I performed the same modifications that you proposed this message from you:

You can check my diff:

diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
index 821523a12423..b6be4a9ca487 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -86,7 +86,7 @@
 		spi-max-frequency = <10000000>;
 		vdd-supply = <&reg_3v3>;
 		xceiver-supply = <&reg_5v0>;
-		status = "okay";
+		status = "disabled";
 	};
 
 	/* To keep the CAN controller enabled by default,
@@ -100,13 +100,13 @@
 &can1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_flexcan1>;
-	status = "disabled";
+	status = "okay";
 };
 
 &can2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_flexcan2>;
-	status = "disabled";
+	status = "okay";
 };
 
 &i2c1 {
diff --git a/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi b/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi
index a324b4fba8ca..42bd5e5f8915 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-nonwifi.dtsi
@@ -167,8 +167,8 @@
 
 &iomuxc {
 	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3
-		&pinctrl_gpio4 &pinctrl_gpio6 &pinctrl_gpio7>;
+	pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 
+		&pinctrl_gpio4 &pinctrl_gpio6>;
 };
 
 &iomuxc_snvs {

Above we have, respectively:

  • Node mcp2515 disabled
  • Node can1 enabled
  • Node can2 enabled
  • Removal of pinctrl_gpio3 and pinctrl_gpio7 from iomuxc
    • With this, we guarantee that the pins for RX and TX of both can1 and can2 are not muxed as GPIOs.

After following Build From Source Code Documentation Overview | Toradex Developer Center for Colibri iMX6ULL:

$ pwd
/path/to/linux-toradex/on/branch/toradex_5.4-2.3.x-imx
$ echo "export ARCH=arm" >> ~/export_compiler
$ echo "export DTC_FLAGS='-@'" >> ~/export_compiler
$ echo "export PATH=~/gcc-linaro/bin/:$PATH" >> ~/export_compiler
$ echo "export CROSS_COMPILE=arm-none-linux-gnueabihf-" >> ~/export_compiler
$ source ~/export_compiler
$ make colibri-imx6ull_defconfig
$ make -j$(nproc) zImage 2>&1 | tee build.log
$ make imx6ull-colibri-eval-v3.dtb

After the last command above (the make for the device tree), I get no warnings/output, which means that everything went smoothly.

After sending the customized imx6ull-colibri-eval-v3.dtb to the module and using Updating NAND-based modules from userspace | Toradex Developer Center to replace the device tree, you can see that my dmesg shows the expected output:

root@colibri-imx6ull-03007769:~# dmesg | grep -i can
[   10.495027] CAN device driver interface
[   10.602642] flexcan 2090000.flexcan: 2090000.flexcan supply xceiver not found, using dummy regulator
[   10.801760] flexcan 2094000.flexcan: 2094000.flexcan supply xceiver not found, using dummy regulator
root@colibri-imx6ull-03007769:~#

My hardware and software information:

  • Colibri iMX6ULL 256MB V1.0A
  • Colibri Evaluation board V3.2B
  • Reference Minimal Image (downstream-based) from BSP 5.7.0:
root@colibri-imx6ull-03007769:~# cat /etc/os-release
ID=tdx-xwayland
NAME="TDX Wayland with XWayland"
VERSION="5.7.0+build.20 (dunfell)"
VERSION_ID=5.7.0-build.20
PRETTY_NAME="TDX Wayland with XWayland 5.7.0+build.20 (dunfell)"
DISTRO_CODENAME="dunfell"

You might want to run some of make clean / make mrproper / make distclean to clean up the build outputs from your Linux Kernel local repository (please check make help to learn more about them and other make targets as well :slight_smile: ) and then try again the build steps.

Let me know if I missed something when trying to reproduce your steps (either software-wise or hardware-wise).

Best regards,

Hi @natxo !

Do you have any updates about your issue?

Best regards,