TK1 I2C6 Timeout. How to make I2C6 working? (pin of DPAUX)

Hi Dears,

Our project is using I2C6 as a CTP interface (In Ubuntu, its bus-num is 5 (i2c-5), but it is named I2C6 on Tegra’s document). The original function (DPAUX) is disabled (in fact, we disabled DP function totally). We are using DPAUX_CH+/- as I2C6 pins.

But the I2C6 doesn’t work. It always timeout when operation it:
when I touch it using “i2cset”, it reports:


ubuntu@tegra-ubuntu:~$ sudo ./i2cset 5 0x03 0x00
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-5, chip address 0x03, data address
0x00, no data.
Continue? [Y/n] y
tegra-i2c tegra12-i2c.5: — register dump for debugging ----
[ 2268.352263] tegra-i2c tegra12-i2c.5: — register dump for debugging ----
tegra-i2c tegra12-i2c.5: I2C_CNFG - 0x2c00
[ 2268.365014] tegra-i2c tegra12-i2c.5: I2C_CNFG - 0x2c00
tegra-i2c tegra12-i2c.5: I2C_PACKET_TRANSFER_STATUS - 0xff0001
[ 2268.376270] tegra-i2c tegra12-i2c.5: I2C_PACKET_TRANSFER_STATUS - 0xff0001
tegra-i2c tegra12-i2c.5: I2C_FIFO_CONTROL - 0xe0
[ 2268.388179] tegra-i2c tegra12-i2c.5: I2C_FIFO_CONTROL - 0xe0
tegra-i2c tegra12-i2c.5: I2C_FIFO_STATUS - 0x800070
[ 2268.399237] tegra-i2c tegra12-i2c.5: I2C_FIFO_STATUS - 0x800070
tegra-i2c tegra12-i2c.5: I2C_INT_MASK - 0xec
[ 2268.409828] tegra-i2c tegra12-i2c.5: I2C_INT_MASK - 0xec
tegra-i2c tegra12-i2c.5: I2C_INT_STATUS - 0x0
[ 2268.419647] tegra-i2c tegra12-i2c.5: I2C_INT_STATUS - 0x0
tegra-i2c tegra12-i2c.5: msg->len - 1
[ 2268.428978] tegra-i2c tegra12-i2c.5: msg->len - 1
tegra-i2c tegra12-i2c.5: is_msg_write - 1
[ 2268.437995] tegra-i2c tegra12-i2c.5: is_msg_write - 1
tegra-i2c tegra12-i2c.5: buf_remaining - 0
[ 2268.447428] tegra-i2c tegra12-i2c.5: buf_remaining - 0
tegra-i2c tegra12-i2c.5: i2c transfer timed out, addr 0x0003, data 0x00
[ 2268.459407] tegra-i2c tegra12-i2c.5: i2c transfer timed out, addr 0x0003, data 0x00
Error: Write failed

It should recieve a NAK but it NOT, untill timeout (waited about 1 second). No signal occurs on I2C6 pins.
While on other working I2C bus, for example, on i2c-4(Tegra’s I2C5), the result is :


ubuntu@tegra-ubuntu:~$ sudo ./i2cset 4 0x03 0x00
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will write to device file /dev/i2c-4, chip address 0x03, data address
0x00, no data.
Continue? [Y/n] y
tegra-i2c tegra12-i2c.4: no acknowledge from address 0x3
Error: Write failed

On trying, I have tried force change the mode of DPAUX to I2C: (powered and clocked DPAUX then write register as below):

tegra_dpaux_writel(dp, DPAUX_HYBRID_PADCTL,
DPAUX_HYBRID_PADCTL_AUX_DRVZ_OHM_50 |
DPAUX_HYBRID_PADCTL_AUX_CMH_V0_70 |
(0x18 << DPAUX_HYBRID_PADCTL_AUX_DRVI_SHIFT) |
DPAUX_HYBRID_PADCTL_MODE_I2C);

but it is still not work.

From the code, the output log above is coming from the fucntion “tegra_i2c_xfer_msg”,

ret = wait_for_completion_timeout(&i2c_dev->msg_complete,
					TEGRA_I2C_TIMEOUT);  // the timeout is 1 second (1000ms)

It seems that I2C6 hardware is not working entirely, no any interrupt is triggered, caused tegra_i2c_xfer_msg timeout after 1 second. (no ACK, nor NAK).

Is there any thing I missed? How should I do to make I2C6 working?

Any help is appreciated, thanks very much!

Regards

Did you add PU resistors to DP_AUX_P/N? Also you need to remove R2B3, R2B4.

Hi Trumany,

Thanks for your reply and sorry to my late response.

I have no skill to remove R2B3/R2B4(they are under the CPU FAN) as I am afraid of damaging the tk1 board.
So I hold waiting utill our new board come, and tried it on the new board.

In our new board, there are only two pull-up resistors (10k Ohm) on DP_AUX_P/N (pull-up to +3.3v power), no any other component connected.

I tried this on new board but the result is same, the debug log is exactly identical to before. The expected log is “NAK” message but in fact “transfer timed out” message is returned.

By the way, I also test this on other i2c-bus. When I pull-down the SCL of GEN2_I2C, yes, the I2C bus report “transfer timed out” message, and when I pull-up the SCL of GEN2_I2C, the I2C bus report “NAK” message.

So it seems that the “PU resistors” resolved one problem of I2C6, but there are still other problems need be resolved on I2C6.

To verify the external circuit of I2C6, I connected I2C6 to HDMI_DDC_SCL (parallel connection), and result is that DDC_SCL works correctly but still I2C6 works incorrectly (i2c-3 report “NAK” and i2c-5 report “transfer timed out” when access a non-exist device). So I think the external circuit of I2C6 is correct on the new board.

Is there any other point need be noticed on I2C6?

Did you configure the pinmux - set DP_AUX_P/N pins to SFIO1 (I2C6) ?

Hi Trumany,

No, I didn’t.

It should to be do but I can’t find the pin names of DP_AUX_P/N in file “tegra124-jetson_tk1-pinmux-pm375-0000-c00-00.dtsi”. I can find pin names for other I2C such as “cam_i2c_scl_pbb1”,“cam_i2c_sda_pbb2” for i2c3, but I can’t find them for i2c6. This caused that I don’t know how to configure it.

What pin names should I use to configure DP_AUX_P/N pins to SFIO1?

I have imported dtsi files which generated by TK1_pinmux.xlsm, the pin in xlsm is set as I2C6:

        	Ball Locations	Pin Muxing 	Pin State	Customer Usage	Pin Direction


DP_AUX_CH0_P AC6 I2C6_CLK z I2C6_CLK Open-Drain
DP_AUX_CH0_N AC5 I2C6_DAT z I2C6_DAT Open-Drain

recompiled DTB and updated, the problem is same as before.

I searched the file tegra124-jetson tk1-pinmux.dtsi generated by TK1_pinmux.xlsm, no “DP_AUX” or “I2C6” is found.

I think the default state of DP_AUX_P/N is SFIO1, and they have no other choices, so that there are no settings for them in dtsi files.

The DP_AUX_P/N is already put as SFIO1 by default, is this correct?

Hello, evanxiao:
To configure dpaux pads as I2c pin, please follow these steps.

  1. Remove reset of DPAUX.

  2. Enable clock of DPAUX.

  3. Program below registers:
    DPAUX_HYBRID_PADCTL_0
    Bit Reset Description
    15 DISABLE I2C_SDA_INPUT_RCV:0 = DISABLE 1 = ENABLE
    14 DISABLE I2C_SCL_INPUT_RCV:0 = DISABLE 1 = ENABLE

    DPAUX_HYBRID_SPARE_0
    Bit Reset SW Default Description
    31:1 0x0 NONE REG
    0 POWERUP POWERDOWN PAD_PWR:0 = POWERUP 1 = POWERDOWN

br
ChenJian

I couldn’t solved that problem. How can solve that problem ?
[ 2037.728550] tegra-i2c tegra12-i2c.0: — register dump for debugging ----
[ 2037.744323] tegra-i2c tegra12-i2c.0: I2C_CNFG - 0x2c00
[ 2037.751817] tegra-i2c tegra12-i2c.0: I2C_PACKET_TRANSFER_STATUS - 0xff0001
[ 2037.758918] tegra-i2c tegra12-i2c.0: I2C_FIFO_CONTROL - 0xe0
[ 2037.764716] tegra-i2c tegra12-i2c.0: I2C_FIFO_STATUS - 0x800040
[ 2037.771009] tegra-i2c tegra12-i2c.0: I2C_INT_MASK - 0xed
[ 2037.776568] tegra-i2c tegra12-i2c.0: I2C_INT_STATUS - 0x0
[ 2037.782190] tegra-i2c tegra12-i2c.0: msg->len - 1
[ 2037.787030] tegra-i2c tegra12-i2c.0: is_msg_write - 1
[ 2037.792455] tegra-i2c tegra12-i2c.0: next_msg->len - 1
[ 2037.797734] tegra-i2c tegra12-i2c.0: is_next_msg_write - 0
[ 2037.803429] tegra-i2c tegra12-i2c.0: buf_remaining - 1
[ 2037.808705] tegra-i2c tegra12-i2c.0: i2c transfer timed out, addr 0x006b, da