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.

Processors forum

Part Number: TDA4VL-Q1


Processor: J721S2

Software: SDK 9.2

Description:

After enable main_i2c1 in device tree, "i2cdetect -l" looks OK

root@j721s2-evm:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
i2c-3 i2c OMAP I2C adapter I2C adapter

But "i2cdetect -r -y 3" returns arbitration lost


root@j721s2-evm:~# i2cdetect -r -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: [ 782.036227] omap_i2c 2010000.i2c: Arbitration lost
-- [ 783.052188] omap_i2c 2010000.i2c: controller timed out

Could any possible reason cause the problem?

  • Hi Wilson,

    Do you have any issues with the other I2C buses?

    Thanks,

    Neehar

  • In my case, i2cdetect -r -y 0, i2cdetect -r -y 1 and i2cdetect -r -y 2 work normally. I get dump from them with no arbitration lost problem.

    root@j721s2-evm:~# i2cdetect -r -y 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- 13 14 -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 49 4a 4b 4c 4d 4e 4f
    50: -- -- -- -- -- -- -- -- 58 59 5a 5b -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    
    root@j721s2-evm:~# i2cdetect -r -y 1
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- 12 -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    
    root@j721s2-evm:~# i2cdetect -r -y 2
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    - Wilson

  • Hi Wilson,

    Thanks for this information.

    Can you provide the dts file where the pinmux is done? 

    Thanks,

    Neehar

  • Hi, Neehar,

    Post main_i2c1 related DT below for reference.

    1. kernel/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts

    &main_i2c0 {
        ...
    };
    
    &main_i2c1 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c1_pins_default>;
    	clock-frequency = <400000>;
    };

    2. kernel/arch/arm64/boot/dts/ti/k3-j721s2-som-p0.dtsi

    &main_pmx0 {
        ...
    	
    	main_i2c1_pins_default: main-i2c1-pins-default {
    		pinctrl-single,pins = <
    			J721S2_IOPAD(0x020, PIN_INPUT_PULLUP, 12) /* (AA23) I2C1_SCL */
    			J721S2_IOPAD(0x024, PIN_INPUT_PULLUP, 12) /* (Y28) I2C1_SDA */
    		>;
    	};	
    };
    
    &main_i2c0 {
        ...
    };
    
    &main_i2c1 {
    	status = "okay";
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c1_pins_default>;
    	clock-frequency = <400000>;
    };
    
    &main_mcan16 {
    	status = "disabled";
    };

    3. kernel/arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi

    	main_i2c1: i2c@2010000 {
    		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
    		reg = <0x00 0x02010000 0x00 0x100>;
    		interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
    		#address-cells = <1>;
    		#size-cells = <0>;
    		clocks = <&k3_clks 215 1>;
    		clock-names = "fck";
    		power-domains = <&k3_pds 215 TI_SCI_PD_EXCLUSIVE>;
    		status = "disabled";
    	};

    4. kernel/arch/arm64/boot/dts/ti/k3-j721s2-vision-apps.dtso

    &main_i2c1 {
        status = "okay";
    };
    

    5. u-boot/arch/arm/dts/k3-j721s2-common-proc-board.dts

    &main_i2c0 {
    	...
    };
    
    &main_i2c1 {
    	status = "okay";
    };

    6. u-boot/arch/arm/dts/k3-j721s2-main.dtsi

    	main_i2c1: i2c@2010000 {
    		compatible = "ti,j721e-i2c", "ti,omap4-i2c";
    		reg = <0x00 0x02010000 0x00 0x100>;
    		interrupts = <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>;
    		#address-cells = <1>;
    		#size-cells = <0>;
    		clocks = <&k3_clks 215 1>;
    		clock-names = "fck";
    		power-domains = <&k3_pds 215 TI_SCI_PD_EXCLUSIVE>;
    	};

    7. u-boot/arch/arm/dts/k3-j721s2-som-p0.dtsi

    &main_i2c1 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&main_i2c1_pins_default>;
    	clock-frequency = <400000>;
    };
    
    &main_mcan16 {
    	status = "disabled"; 
    };

    8. u-boot/arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi

    	aliases {
            ...
    		i2c0 = &wkup_i2c0;
    		i2c1 = &mcu_i2c0;
    		i2c2 = &main_i2c0;
    		i2c3 = &main_i2c1;
            ...
    	};

    After power on, I also get these msgs:

    [ 18.541707] platform mux-controller1: deferred probe pending
    [ 18.547380] platform mux-controller0: deferred probe pending
    [ 18.553037] platform 2910000.pcie: deferred probe pending
    [ 18.558433] platform 4a00000.dss: deferred probe pending

    - Wilson

  • Hi Wilson,

    What devices do you have connected on the main_i2c1 bus? There may be an issue with timeout when communicating with the slave device.

    Thanks,
    Neehar

  • Hi, Neehar,

    It's MAX96717. However, at this moment, as posted above, we have not declared any client device under main_i2c1 in the device tree yet. We suppose to get result from i2c1 similar to one from i2c0, don't we? For example,

    root@j721s2-evm:~# i2cdetect -r -y 3
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    - Wilson

  • Hi Wilson,

    Yes, this behavior should be expected. Are you using a custom board or J721S2 EVM?

    Thanks,

    Neehar

  • Hi, Neehar,

    Yes. I am.

    - Wilson

  • Hi Wilson,

    Can you ensure balls AA23 and Y28 are not used elsewhere that may be causing conflicts? Or test by programming to a different ball such as AB26 and AD26. 
    Thanks,

    Neehar

  • Hi, Neehar,

    Search for AA23 pinmux settings in the board-support/ sub-directory:

    wilson@virtual-pc:~/tda4vl_9.2/tda4vl_linux_9.2$ grep -r "J721S2_IOPAD(0x020, " --include=k3-j721s2*.dts*
    board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/arch/arm/dts/k3-j721s2-som-p0.dtsi:                    J721S2_IOPAD(0x020, PIN_INPUT_PULLUP, 12) /* (AA23) I2C1_SCL */
    board-support/ti-linux-kernel-6.1.80+gitAUTOINC+2e423244f8-ti/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts:                        J721S2_IOPAD(0x020, PIN_INPUT_PULLUP, 12) /* (AA23) I2C1_SCL */
    wilson@virtual-pc:~/tda4vl_9.2/tda4vl_linux_9.2$ grep -r "J721S2_IOPAD(0x20, " --include=k3-j721s2*.dts*
    wilson@virtual-pc:~/tda4vl_9.2/tda4vl_linux_9.2$

    Search for Y28 pinmux settings in the board-support/ sub-directory:

    wilson@virtual-pc:~tda4vl_9.2/tda4vl_linux_9.2$ grep -r "J721S2_IOPAD(0x024," --include=k3-j721s2*.dts*
    board-support/ti-u-boot-2023.04+gitAUTOINC+f9b966c674/arch/arm/dts/k3-j721s2-som-p0.dtsi:                    J721S2_IOPAD(0x024, PIN_INPUT_PULLUP, 12) /* (Y28) I2C1_SDA */
    board-support/ti-linux-kernel-6.1.80+gitAUTOINC+2e423244f8-ti/arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts:                        J721S2_IOPAD(0x024, PIN_INPUT_PULLUP, 12) /* (Y28) I2C1_SDA */
    wilson@virtual-pc:~/tda4vl_9.2/tda4vl_linux_9.2$ grep -r "J721S2_IOPAD(0x24," --include=k3-j721s2*.dts*
    wilson@virtual-pc:~/tda4vl_9.2/tda4vl_linux_9.2$

    There is no conflict with any other pinmux defined.

    root@j721s2-evm:~# i2cdetect -l
    i2c-0   i2c             OMAP I2C adapter                        I2C adapter
    i2c-1   i2c             OMAP I2C adapter                        I2C adapter
    i2c-2   i2c             OMAP I2C adapter                        I2C adapter
    i2c-3   i2c             OMAP I2C adapter                        I2C adapter
    root@j721s2-evm:~# i2cdetect -r -y 3
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         [ 1835.028702] omap_i2c 2010000.i2c: Arbitration lost
    -- [ 1836.044699] omap_i2c 2010000.i2c: controller timed out

    - Wilson

  • Hi Wilson,

    Thanks for this information. Let me look into this and get back to you tomorrow.
    Thanks,

    Neehar

  • Hi, Neehar,

    We found the root cause in pinmux_data.c.

    root@j721s2-evm:~# i2cdetect -r -y 3
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    - Wilson

  • Hi Wilson,

    Can you elaborate what the issue was?
    Thanks,

    Neehar

  • Other than *.dts*, pinmux definitions exist in the pinmux_data.c and need to be modified as well.