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.

[FAQ] TDA4VM: How do I enable CAN channels on Gateway/Ethernet Switch/Industrial (GESI) expansion card when using J721E EVM from Linux A72?

Part Number: TDA4VM

How do I enable CAN channels on Gateway/Ethernet Switch/Industrial (GESI) expansion card when using J721E EVM from Linux A72?

  • By default, 4 CAN channels were enabled in Linux (A72), which are in the common-processor board.

     

    We need to update the device tree to enable CAN channels (CAN4, CAN5, CAN6, CAN7, CAN9, CAN11) on the GESI card with CAN transceiver details and CAN channels details.

     

    For this, we need to download the Linux SDK and follow the procedure/steps mentioned below and update the "k3-j721e-common-proc-board.dts" file in "<Linux SDK>/board-support/linux-x.x.x/arch/arm64/boot/dts/ti/".

    1. Add pin hog for selection of CAN pins from MUX.



    2. Enable MCAN Nodes on GESI and add transceiver node as per below in "k3-j721e-common-proc-board.dts" file.

    3157.GESI_CAN_Nodes.txt
    transceiver_gesi: can-phy4 {
    		compatible = "ti,tcan1042";
    		#phy-cells = <0>;
    		max-bitrate = <5000000>;
    		pinctrl-names = "default";
    		pinctrl-0 = <&main_mcan4_gpio_pins_default>;
    		standby-gpios = <&main_gpio0 60 GPIO_ACTIVE_HIGH>;
    	};
    
    /* Add pin mux under main_pmx0 reference */
    main_mcan4_gpio_pins_default: main-mcan4-gpio-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x0F4, PIN_INPUT, 7) /* (AB24) PRG0_PRU0_GPO17.GPIO0_60 */
    		>;
    	};
    
    main_mcan4_pins_default: main-mcan4-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x024, PIN_INPUT, 6) /* (AJ20) MCAN4_RX */
    			J721E_IOPAD(0x020, PIN_OUTPUT, 6) /* (AE20) MCAN4_TX */
    		>;
    	};
    
    main_mcan5_pins_default: main-mcan5-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x050, PIN_INPUT, 6) /* (AE21) MCAN5_RX */
    			J721E_IOPAD(0x04C, PIN_OUTPUT, 6) /* (AJ21) MCAN5_TX */
    		>;
    	};
    
    main_mcan6_pins_default: main-mcan6-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x06C, PIN_INPUT, 6) /* (AG21) MCAN6_RX */
    			J721E_IOPAD(0x054, PIN_OUTPUT, 6) /* (AH21) MCAN6_TX */
    		>;
    	};
    
    main_mcan7_pins_default: main-mcan7-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x078, PIN_INPUT, 6) /* (Y23) MCAN7_RX */
    			J721E_IOPAD(0x074, PIN_OUTPUT, 6) /* (AC21) MCAN7_TX */
    		>;
    	};
    
    main_mcan9_pins_default: main-mcan9-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x0D0, PIN_INPUT, 6) /* (AC27) MCAN9_RX */
    			J721E_IOPAD(0x0CC, PIN_OUTPUT, 6) /* (AC28) MCAN9_TX */
    		>;
    	};
    
    main_mcan11_pins_default: main-mcan11-pins-default {
    		pinctrl-single,pins = <
    			J721E_IOPAD(0x120, PIN_INPUT, 6) /* (AA28) MCAN11_RX */
    			J721E_IOPAD(0x11C, PIN_OUTPUT, 6) /* (AA24) MCAN11_TX */
    		>;
    	};
    
    
    
    &main_mcan4 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan4_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    &main_mcan5 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan5_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    &main_mcan6 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan6_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    &main_mcan7 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan7_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    &main_mcan9 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan9_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    &main_mcan11 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_mcan11_pins_default>;
    	phys = <&transceiver_gesi>;
    };
    
    

    After making/adding the above changes build device tree files using the below command and use the updated "k3-j721e-common-proc-board.dtb" file to boot EVM.

    Building device tree files:

    Build Linux dts using the following command from the "<Linux SDK>" directory.

    # make linux-dtbs

     
    For more details, please refer to Linux SDK documentation.

    Best Regards,

    Sudheer