How to enable I2C8?

Hi NV,

As my topic, I would like to enable I2C-8(i2c@810c690000 ) at my custom board with JP7.2.

Below are the modifications I made:

I ref [ Jetson/L4T/peripheral/ - eLinux.org]

pinmuxtegra264-mb1-bct-pinmux-p3834-xxxx-p4071-0000.dtsi:

dp_aux_ch3_p {
				nvidia,pins = "dp_aux_ch3_p";
				nvidia,function = "i2c8_clk";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,drv-type = <TEGRA_PIN_1X_DRIVER>;
				nvidia,e-io-od = <TEGRA_PIN_DISABLE>;
				nvidia,e-lpbk = <TEGRA_PIN_DISABLE>;
			};

			dp_aux_ch3_n {
				nvidia,pins = "dp_aux_ch3_n";
				nvidia,function = "i2c8_dat";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,drv-type = <TEGRA_PIN_1X_DRIVER>;
				nvidia,e-io-od = <TEGRA_PIN_DISABLE>;
				nvidia,e-lpbk = <TEGRA_PIN_DISABLE>;
			};

After flash the image, I use sudo i2cdetect -y -r 8 to test, but nothing detect.

Is there any other configuration that I may have missed modifying?

At source/hardware/nvidia/t264/nv-public/tegra264.dtsi

I was wondering if this might be related to the DMA configuration.

i2c8: i2c@810c690000 {
			compatible = "nvidia,tegra264-i2c";
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x81 0x0c690000 0x0 0x10000>;
			interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
			clock-frequency = <400000>;
			clocks = <&bpmp TEGRA264_CLK_TOP_I2C>,
				 <&bpmp TEGRA264_CLK_PLLP_OUT0>;
			clock-names = "div-clk", "parent";
			assigned-clocks = <&bpmp TEGRA264_CLK_TOP_I2C>;
			assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
			resets = <&bpmp TEGRA264_RESET_I2C8>;
			reset-names = "i2c";
			nvidia,epl-reporter-id = <0x8057>;
		};

The other pins that I configured as I2C are working normally.

i2c9: i2c@810c6a0000 {
			compatible = "nvidia,tegra264-i2c";
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x81 0x0c6a0000 0x0 0x10000>;
			interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
			clock-frequency = <400000>;
			dmas = <&gpcdma 2 2 TEGRA264_GPCDMA_SID_I2C9>;
			dma-names = "tx";
			iommus = <&smmu1_mmu TEGRA264_GPCDMA_SID_I2C9>;
			dma-coherent;
			clocks = <&bpmp TEGRA264_CLK_TOP_I2C>,
				 <&bpmp TEGRA264_CLK_PLLP_OUT0>;
			clock-names = "div-clk", "parent";
			assigned-clocks = <&bpmp TEGRA264_CLK_TOP_I2C>;
			assigned-clock-parents = <&bpmp TEGRA264_CLK_PLLP_OUT0>;
			resets = <&bpmp TEGRA264_RESET_I2C9>;
			reset-names = "i2c";
			nvidia,epl-reporter-id = <0x8058>;
		};

Thanks!!

Confirm if software is up vs pads dead

Check Healthy I2C8
ls /sys/firmware/devicetree/base/bus@0/i2c@810c690000/status okay
readlink -f /sys/class/i2c-adapter/i2c-8/device .../i2c@810c690000
dmesg | grep -i i2c probe OK; timeouts mean pad/pull-up/slave
i2cdetect -y -r 8 all -- controller up, no ACK (OD, pull-up, padctl, no slave)
i2cdetect cannot open /dev/i2c-8 kernel DT not enabled
  1. Kernel DT: i2c@810c690000 { status = "okay"; }; (already true on P4071).
  2. Pinmux: i2c8_clk / i2c8_dat and e-io-od = ENABLE. Flash the MB1 pinmux BCT, not only kernel DTB.
  3. External pull-ups on SCL/SDA at the I/O voltage.
  4. Confirm DPAUX3 is not left in Display AUX mode (padctl and/or disable DP3).
  5. Do not add DMA to I2C8.

Ask them for i2cdetect verbatim output, dmesg around tegra-i2c, whether /dev/i2c-8 is 810c690000, and a scope shot of SCL during the scan. That splits “adapter never enabled” from “pads still analog / not open-drain / no pull-up.”

Hi @ShaneCCC ,

Thanks for reply,

$ cat /sys/firmware/devicetree/base/bus@0/i2c@810c690000/status
okay

$ sudo readlink -f /sys/class/i2c-adapter/i2c-8/device
/sys/devices/platform/bus@0/810c690000.i2c

$ sudo dmesg | grep -i i2c

[    0.053003] /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000: Fixed dependency cycle(s) with /bus@0/i2c@810c680000/audio-codec@1c
[    0.053257] /bus@0/i2c@810c680000/audio-codec@1c: Fixed dependency cycle(s) with /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000
[    0.053677] /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000: Fixed dependency cycle(s) with /bus@0/i2c@810c680000/audio-codec@1c
[    0.055604] /bus@0/i2c@810c680000/audio-codec@1c: Fixed dependency cycle(s) with /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000
[    3.733192] i2c_dev: i2c /dev entries driver
[    5.791671] tegra-i2c c600000.i2c: Adding to iommu group 5
[    5.798943] tegra-i2c c610000.i2c: Adding to iommu group 6
[    5.803798] tegra-i2c 810c630000.i2c: Adding to iommu group 7
[    5.809327] tegra-i2c 810c640000.i2c: Adding to iommu group 8
[    5.817646] tegra-i2c 810c680000.i2c: Adding to iommu group 9
[    5.820343] /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000: Fixed dependency cycle(s) with /bus@0/i2c@810c680000/audio-codec@1c
[    5.831224] /bus@0/i2c@810c680000/audio-codec@1c: Fixed dependency cycle(s) with /bus@0/aconnect@9000000/ahub@9630000/i2s@92b0000
[    5.844345] tegra-i2c 810c6a0000.i2c: Adding to iommu group 10
[    5.851239] tegra-i2c 810c6c0000.i2c: Adding to iommu group 11
[    5.855919] tegra-i2c 810c6d0000.i2c: Adding to iommu group 12

##It keeps showing the following error message:  tegra-i2c 810c690000.i2c: I2C transfer timed out##

[  212.191760] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.295746] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.399924] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.503762] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.607769] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.711771] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.815754] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  212.919751] tegra-i2c 810c690000.i2c: I2C transfer timed out
[  213.023749] tegra-i2c 810c690000.i2c: I2C transfer timed out

$ sudo i2cdetect -y -r 8 → the detection process is very slow.

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

$ sudo i2cdetect -y -r 11 → another I2C interface that is working normally.

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

My test method is to connect an I2C device to the interface. If the device is detected successfully, it will show 0x48.

  1. Kernel DT: i2c@810c690000 { status = "okay"; }; (already true on P4071).
    → Yes, I can confirm this at tegra264=p4071-0000.dtsi

  2. Pinmux: i2c8_clk / i2c8_dat and e-io-od = ENABLE. Flash the MB1 pinmux BCT, not only kernel DTB.

dp_aux_ch3_p {
				nvidia,pins = "dp_aux_ch3_p";
				nvidia,function = "i2c8_clk";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,drv-type = <TEGRA_PIN_1X_DRIVER>;
				nvidia,e-io-od = <TEGRA_PIN_ENABLE>;
				nvidia,e-lpbk = <TEGRA_PIN_DISABLE>;
			};

			dp_aux_ch3_n {
				nvidia,pins = "dp_aux_ch3_n";
				nvidia,function = "i2c8_dat";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,drv-type = <TEGRA_PIN_1X_DRIVER>;
				nvidia,e-io-od = <TEGRA_PIN_ENABLE>;
				nvidia,e-lpbk = <TEGRA_PIN_DISABLE>;
			};
  1. External pull-ups on SCL/SDA at the I/O voltage.

  2. Confirm DPAUX3 is not left in Display AUX mode (padctl and/or disable DP3).
    → How to confirm DPAUX3 is not left in Display AUX mode?

  3. Do not add DMA to I2C8.
    → OK.

Also, could you please clarify why nvidia,e-io-od = <TEGRA_PIN_ENABLE>; needs to be set to enable?

I generated the pinmux configuration using the Pinmux Spreadsheet nvidia,e-io-od = <TEGRA_PIN_DISABLE>;, so I would like to understand why this setting needs to be manually changed.

Thanks!!

Do you probe to confirm the waveform?

Hi @ShaneCCC ,

Thanks for reply,

Yes, I checked the waveforms and compared I2C-8 and I2C-11.

i2c-8(I2C_GP8_CLK):
→ nothing

i2c-11(I2C11_CLK):

Thanks!!

Confirm it by reading the MISCREG override register for the DPAUX instance you use. For Thor I2C8 ↔ DPAUX3, the register is MISCREG_PADCTLREG_I2C_DPAUX_MODE_OVRD_3 at 0x0010400c.

What to check:

  • bit[31] SEL = 1 means the MISCREG override is active and takes precedence.
  • bit[11] MODE = 1 means I2C mode, not AUX mode.
  • bit[15] and bit[14] should be 1 to enable SDA/SCL input receivers.
  • bit[0] PAD_PWR = 0 means powered up.

So for Thor I2C8 on DPAUX3, a good override value is 0x8000CB70 in 0x0010400c.

Hi @ShaneCCC ,

Thanks for reply,

I used the following command to check the value of 0x0010400c.

$ sudo busybox devmem 0x0010400c 32
0x8000CB70

The result is indeed 0x8000CB70.

Thanks!!

Sorry for the late response.
Is this still an issue to support? Any result can be shared?

Hi @kayccc and @ShaneCCC ,

Thanks for reply,

The issue has been resolved. We later found that it was caused by a hardware problem.

Thanks!!