Enable CAN on Colibri IMX8

Hi,

I want to enable 3xCAN on IMX8. I have disabled UART_A, UART_B, UART_C and SPI. This is how my fsl-imx8qxp-colibri-eval-v3.dtsi looks like:

   /* CAN */
  &flexcan1 {
      status = "okay";
  };
  &flexcan2 {
      status = "okay";
  };

  &flexcan3 {
      status = "okay";
  };

  /* Colibri SPI */
  &lpspi2 {
      status = "disabled";

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

      spidev0: spidev@0 {
	      compatible = "toradex,evalspi";
	      reg = <0>;
	      spi-max-frequency = <10000000>;
	      status = "disabled";
      };
  };

   /* Colibri UART_B */
  &lpuart0 {
      status = "disabled";
  };

  /* Colibri UART_C */
  &lpuart2 {
      status = "disabled";
  };

  /* Colibri UART_A */
  &lpuart3 {
      status= "disabled";
  };

No flexcan device appears in the /dev folder. This is the output from dmesg | grep can:
alt text

Is it something else that needs to be done to enable CAN?

Hi @Jacmo,

Which version of Linux are you using?
You can check that by getting the output of “/etc/issue

See, the CAN interfaces are not handled within “/dev”, as they are managed as network interfaces.

Please, have a look at our guide for CAN usage on Linux.

As you already have the CAN interfaces set in device-tree, you can go directly to the CAN configuration.

Please let me know if that worked.

Best regards,
André Curvello

Thanks for your reply.

This is the Linux version: 4.14.170-4.0.0-devel+git.8c0a76c92013.

Unfortunately, the CAN configuration does not work. ip link set can0 type can help returns ip: either "dev" is duplicate, or "type" is garbage.

Could you please show me in detail how fsl-imx8qxp-colibri.dtsi needs to be modified to enable 3xCAN?

Hi @Jacmo ,

Please, confirm which Operating System are you using?
If you are using our Linux BSP or Torizon, and then, which version?
You just told me the “uname -r” response.
Please check it by reading the “/etc/issue

And, also, please confirm which Carrier Board are you using, if are you using a Toradex Carrier board for Colibri or a custom own.

And, finally, how did you “activated” your modified Device Tree?

Best regards,
André Curvello