Enabling TCAN4x5x

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enabling TCAN4x5x

1,436 Views
Ratataplam
Contributor II

Hi folks,
I'm trying to enable can device on my embedded platform based on iMX8 and YOCTO.To do that I would use the kernel driver already present i the distro (TCAN4x5x).
I've modified the *.dts file adding

+&ecspi2 { /* CAN */
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ecspi2>;
+ status = "okay";
+
+ tcan4x5x: tcan4x5x@0 {
+ compatible = "ti,tcan4x5x";
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ spi-max-frequency = <10000000>;
+ bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
+ device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
+ device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+ reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+ };
+};

+ pinctrl_ecspi2: ecspi2grp {
+ fsl,pins = <
+ MX8MM_IOMUXC_ECSPI2_SS0_ECSPI2_SS0 0x116
+ MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x116
+ MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x116
+ MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x1916
+ >;
+ };
In according to the documentations present in 

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindi... 


and
+CONFIG_CAN_M_CAN=m
+CONFIG_CAN_M_CAN_TCAN4X5X=m
to enable the driver into the kernel, patching "defconfig" file
Now the dmesg command shows :

dmsg.png

 so in not clear what I've forgotten in *.dts

0 Kudos
Reply
1 Reply

1,141 Views
SGDev
Contributor I

I am also getting same error, but i am doing dts change for imx6ul.

 

root@imx6ul:~# dmesg | grep "tcan"
[    9.162594] tcan4x5x spi0.0: no clock found
[    9.167263] tcan4x5x spi0.0: no CAN clock source defined
[    9.410935] tcan4x5x spi0.0: Unsupported version number:  0
[    9.417023] tcan4x5x spi0.0: Probe failed, err=-22
[    9.425333] tcan4x5x: probe of spi0.0 failed with error -22

 

I solved the error caused due to absence of clock configuration in dts.

 

clocks {

hclk: clock@4 {
compatible = "fixed-clock";
reg = <3>;
#clock-cells = <0>;
clock-frequency = <40000000>;
clock-output-names = "hclk";
};

cclk: clock@5 {
compatible = "fixed-clock";
reg = <3>;
#clock-cells = <0>;
clock-frequency = <40000000>;
clock-output-names = "cclk";
};
};

But not able to solve below errors:

root@imx6ul:~# dmesg | grep -i "tcan"
[ 9.625906] tcan4x5x spi0.0: Unsupported version number: 0
[ 9.631985] tcan4x5x spi0.0: Probe failed, err=-22
[ 9.639763] tcan4x5x: probe of spi0.0 failed with error -22

Whether you found the solution?

 

If you or anyone got the solution, please share with us. Thanks

0 Kudos
Reply