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.

Might have found a bug in tps65910.c device detection (includes fix description)

Other Parts Discussed in Thread: TPS65910

Hi,

I'm running the kernel out of the "rowboat-jb-am335x-4.1.2" branch and I found that after a reboot the tps65910 device is not always detected by the kernel if the TPS RTC is used. When it fails, you'll see the following in the boot log:

tps65910 1-002d: unknown version

This also only happens after a reboot. And not even on every reboot.

Looking closely at the driver I saw that it tries to verify if it's talking to a valid device on the other and of the i2c bus. To do this it looks at the register 0x00 thinking it's the JTAGREVNUM but it's not. According to the datasheet register 0x00 is the second counter and JTAGREVNUM is regiter 0x80 (Check at the end of the message for a snippet). This explains why, if the rtc is used, the second will start ticking and it will prevent the value from matching a valid jtag revision number. Am I making sens?

Has this been spotted before and is there an official fix somewhere?

Thanks

kernel\drivers\mfd\tps65910.c: line 164

/* Check that the device is actually there */
ret = tps65910_i2c_read(tps65910, 0x0, 1, &buff);
if (ret < 0) {
dev_err(tps65910->dev, "could not be detected\n");
ret = -ENODEV;
goto err;
}

dev_info(tps65910->dev, "JTAGREVNUM 0x%x\n", buff);

if (buff & ~JTAGVERNUM_VERNUM_MASK) {
dev_err(tps65910->dev, "unknown version\n");
ret = -ENODEV;
goto err;
}

  • Hi,

    I can also confirm this. But I am in linux with sdk 6.

    After integrating an RTC driver for the TPS65910 mfb driver, I noticed this strange behavior during reboot. each time it picked up a different JTAG version.

    After looking into the TPS65910 driver code, I realised that JTAG Version is being read from 0x0. After changing this to read from 0x80, the driver gets loaded every time. (Reset / fresh start after shutdown).

    Thanks.

    Ram