This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCAN4550: whether the my dts entry is right to enable CANFD in imx6ull processor?

Part Number: TCAN4550

hi i am facing problem with installation of this driver

my driver look like below;

tcan4x5x: tcan4x5x@0 {
                compatible = "ti,tcan4x5x";
                reg = <0x0000 0xFFFF>;
                #address-cells = <1>;
                #size-cells = <1>;
                spi-max-frequency = <18000000>;
                bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
                data-ready-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
                device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
                device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
                reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
};
m_can1: can@20e8000 {
        compatible = "Bosch,m_can";
                reg = <0x020e8000 0x4000>, <0x02298000 0x4000>;
                reg-names = "m_can", "message_ram";
                interrupts = <0 114 0x04>,
                             <0 114 0x04>;
                interrupt-names = "int0", "int1";
                clocks = <&clks IMX6SX_CLK_CANFD>,
                         <&clks IMX6SX_CLK_CANFD>;
                clock-names = "hclk", "cclk";
                bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
        };

what is the problem in the driver ?how i correct it?

  • Hi Pooja,

    Which driver are you using, and from where did you download it?

    Max

  • This driver i written using tcan4x5x.txt file

    using the requirements.

  • Pooja,

    Is this a Linux application?  The latest driver is found here and is part of the 5.4 kernel:

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/can/m_can

    Is this what you are using?

    Note that generally this forum is for device-specific questions rather than questions on software implementation.  I will try my best to help you, but our expertise is much more on the device side rather than the processor configuration.

    Max

  • yes,this driver only i loopbacked from linux kernal 5.4 to linux 4.19.21 kernal.

    for this i m getting vesion not supported.

  • That may be the problem.  Some driver modifications may be needed to properly back-port to this previous kernel version.  As an example, I believe you can find a version that was back-ported to 4.14 here:

    Regards,
    Max

  • thank you for this file.i got to where i am going wrong.

    but now i am getting error as given below

    [    3.998244] ERROR: could not get clock /soc/aips-bus@2000000/spba-bus@2000000/ecspi@2008000/tcan4x5x@0:hclk(0)
    [    4.009033] ERROR: could not get clock /soc/aips-bus@2000000/spba-bus@2000000/ecspi@2008000/tcan4x5x@0:cclk(1)
    [    4.019671] tcan4x5x spi0.0: no clock found
    [    4.024170] tcan4x5x spi0.0: no CAN clock source defined
    [    4.031298] REL_VALUE:0
    [    4.035969] crel_reg = 0
    [    4.038644] rel : 0
    [    4.041080] step : 0
    [    4.043409] tcan4x5x spi0.0: Unsupported version number:  0
    [    4.049091] status:-22
    [    4.049200] tcan4x5x spi0.0: Probe failed, err=-22
    [    4.058439] tcan4x5x: probe of spi0.0 failed with error -22

    where do i define this clock?and hclk and cclk both clocks  are mandatory for this driver?let me know this.

    and it is giving unsupported version again, how do i solve it?

    below is my dts entry

    &ecspi1 {
            fsl,spi-num-chipselects = <1>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_ecspi1>;
            status = "okay";

     tcan4x5x: tcan4x5x@0 {
                   compatible = "ti,tcan4x5x";
                   reg = <0>;
                   #address-cells = <1>;
                   #size-cells = <1>;
                   spi-max-frequency = <18000000>;
                   clock-names = "hclk", "cclk";
                   bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
                   data-ready-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
                   device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
                   device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;

          };
    };

  • hello, i solved with the clock error,but i am not getting about the version number

    still it is giving with the "Unsupported version"

    please help me out,

  • Hi Pooja,

    Glad you solved the clock issue!

    The unsupported version error looks like it shows up in line 1295 of m_can.c:

    It is referencing the MCAN version - this seems to be returning 0 in your case.  Somewhere you must be missing a definition on which version of the MCAN IP is used in TCAN4550 (i.e., 3.2.1.1).  I'm not familiar enough with Linux drivers to suggest exactly where that should be.

    Max