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