During investigation, I figured out this TPM module reacts to I2C speed very seriously.
Though default I2C speed is 100000, I had to down to 30000.
At 30000 or under, TPM chip answers to I2C commands as follow:
I’m investigating a little bit more.
Now, I figured out regs in the TPM can be accessed during operation through I2C.
Problem to init TPM is iic_tpm_write_generic() after get_burstcount() in the tpm_tis_i2c_send() function.
When I input tpm startup TPM_ST_CLEAR command after tpm init command, tpm command will send STARTUP command pattern.
But iic_tpm_write function passes 0 as an addr and alen parameters. These values are kicked out at tegra_i2c_write() function.
static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
unsigned int sleep_time, u8 max_count)
{
...
for (count = 0; count < max_count; count++) {
rc = i2c_write(tpm_dev.addr, <b>0, 0</b>, tpm_dev.buf, len + 1);
if (rc == 0)
break; /* Success, break to skip sleep */
udelay(sleep_time);
}
...
}
/* Write bytes */
static int tegra_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
int alen, uchar *buffer, int len)
{
...
if (!i2c_addr_ok(addr, alen)) {
printf("i2c_write: Bad address %x.%d.\n", addr, alen);
return 1;
}
...
}
When I modified to pass 0x5 and 0x1 for addr and alen for i2c_write in iic_tpm_write_generic forcely,
send_recv_packets() does return 0x88, not VALID status. and failed tpm_tis_i2c_send function.
Any mistakes I did during this test??
FYI, if I do warm reset at Linux shell, tpm locality can be acquired well. But after cold reset, it fails.
Would it be related to this issue?
I did not test it whether TPM REGs are able to be accessed on Linux yet.
BTW, I doubt that 2014.10 U-Boot of L4T 21.5 supports slb9645tt TPM chip.
Because, mainline U-Boot changed TPM message format from 2015.10 release. iic_tpm_write_generic() in “u-boot/drivers/tpm/tpm_tis_i2c.c”