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-Q1: Questions regarding TCAN4550 driver

Part Number: TCAN4550-Q1
Other Parts Discussed in Thread: TCAN4550

Hi

We found out two commits can help us to port TCAN4550.
https://git.ti.com/gitweb?p=ti-analog-linux-kernel/dmurphy-analog.git;a=shortlog;h=refs/heads/tcan_414_backport

We got some questions about the commit can: tcan4x5x: Add DT bindings for TCAN4x5X driver

The commit give an example as below


Below are my questions


  1. About the 4 GPIOS, data-ready, device-state, device-wake and reset.
    What these 4 GPIO for?  Should I make any modification in these 4 GPIOS?

  2. Except these 4 GPIOS, Is there anything we have to modify?

  3. How can I confirm my porting is success or fail?

Best Regards

  • Hi PY,

    The TCAN4550 requires a SPI interface to the processor and has some optional GPIO pins that can also be used.  These include a Reset pin that can reset the TCAN4550 registers to default values, an input signal to indicate whether the device is in an active state, or sleep state, and an output signal to be used to wake up the TCAN4550 if it in a sleep state.

    You will need to make sure your bindings correspond to the hardware configuration used between the processor and TCAN4550 device pins.  Some evaluation will be needed to test whether your SPI communication is working properly and that the Reset and other optional GPIO pins are working properly for your bindings.

    Additional information about the Device Tree Bindings for the TCAN4x5x driver can be found here:

    https://www.kernel.org/doc/Documentation/devicetree/bindings/net/can/tcan4x5x.txt

    Texas Instruments TCAN4x5x CAN Controller
    ================================================
    
    This file provides device node information for the TCAN4x5x interface contains.
    
    Required properties:
    	- compatible: "ti,tcan4x5x"
    	- reg: 0
    	- #address-cells: 1
    	- #size-cells: 0
    	- spi-max-frequency: Maximum frequency of the SPI bus the chip can
    			     operate at should be less than or equal to 18 MHz.
    	- interrupt-parent: the phandle to the interrupt controller which provides
                        the interrupt.
    	- interrupts: interrupt specification for data-ready.
    
    See Documentation/devicetree/bindings/net/can/bosch,m_can.yaml for additional
    required property details.
    
    Optional properties:
    	- reset-gpios: Hardwired output GPIO. If not defined then software
    		       reset.
    	- device-state-gpios: Input GPIO that indicates if the device is in
    			      a sleep state or if the device is active.
    	- device-wake-gpios: Wake up GPIO to wake up the TCAN device.
    
    Example:
    tcan4x5x: tcan4x5x@0 {
    		compatible = "ti,tcan4x5x";
    		reg = <0>;
    		#address-cells = <1>;
    		#size-cells = <1>;
    		spi-max-frequency = <10000000>;
    		bosch,mram-cfg = <0x0 0 0 32 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>;
    };

    Regards,
    Jonathan
  • Hi Jonathan, 

    Thanks, my customer had ported TCAN4550 to their platform. 

    Any suggestion how to verify if your porting correct or not ? thanks!

  • Hi PY,

    My suggestion would be to connect a TCAN4550 EVM to their development board and run some tests such as reading and writing registers through the SPI interface.

    Regards,

    Jonathan