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.

[参考译文] TDA4VE-Q1:无法在 U-Boot 和 Linux 环境中访问 I2C5 (OMAP_i2c 2050000.i2c)

Guru**** 2330570 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1518117/tda4ve-q1-unable-to-access-i2c5-omap_i2c-2050000-i2c-in-both-u-boot-and-linux-environments

器件型号:TDA4VE-Q1

工具/软件:

尊敬的 TI 专家:

我们将 TDA4VE EVM (包括 SOM、CPB 和融合板)作为定制电路板设计的基础。

UB960串行器连接到主域的 I2C5、这与 EVM 配置一致。

不过、我们发现在定制电路板上、I2C5目前无法进行读取和写入操作。

为了验证这一点、我们通过将以下配置添加到 U-Boot 器件树中、对 I2C5执行了一项简单的读取/写入测试。

文件:u-boot-2021.01+gitAUTOINC+7996ed51F1-g7996ed51F1/arch/arm/dts/k3-j721s2-common-proc-board.dts

    main_i2c5_pins_default: main-i2c5-default-pins {
        pinctrl-single,pins = <
            J721S2_IOPAD(0x01c, PIN_INPUT_PULLUP, 8) /* (Y24) MCAN15_TX.I2C5_SCL */
            J721S2_IOPAD(0x018, PIN_INPUT_PULLUP, 8) /* (W23) MCAN14_RX.I2C5_SDA */
        >;
    };
    
&main_i2c5 {
    pinctrl-names = "default";
    pinctrl-0 = <&main_i2c5_pins_default>;
    clock-frequency = <400000>;
    /*clock-frequency = <100000>;*/
    status = "okay";
};

在上 TDA4EVM EVM 、我们可以通过 I2C 总线成功地与 UB960通信

请参阅以下日志。 焊盘配置看起来正确、可以成功扫描总线上的 i2c 器件、并且可以读取 UB960 0x3D 的寄存器。

=> i2c bus
Bus 0:  i2c@42120000
Bus 1:  i2c@40b00000
Bus 2:  i2c@40b10000
Bus 3:  i2c@2000000
   21: gpio@21, offset len 1, flags 0
   20: gpio@20, offset len 1, flags 0
   22: gpio@22, offset len 1, flags 0
Bus 4:  i2c@2010000
Bus 5:  i2c@2030000
Bus 6:  i2c@2040000
   20: gpio@20, offset len 1, flags 0
Bus 7:  i2c@2050000

=> i2c dev 7
Setting bus to 7

=> md.l 0x0011C01C
0011c01c: 00060008 08214007 08214007 08214007    .....@!..@!..@!.
0011c02c: 08214007 08214007 08214007 08214007    .@!..@!..@!..@!.
0011c03c: 08214007 0005000e 0001000e 08214007    .@!..........@!.

=> md.l 0x0011C018
0011c018: 00060008 00060008 08214007 08214007    .........@!..@!.
0011c028: 08214007 08214007 08214007 08214007    .@!..@!..@!..@!.
0011c038: 08214007 08214007 0005000e 0001000e    .@!..@!.........

=> i2c probe
Valid chip addresses: 20 36 3D 50

=> i2c md 0x3d 0x35 1
0035: 00    .
=>

然而,同样的方法 失败 UB960的一些示例输入 定制板

=> i2c bus
Bus 0:  i2c@42120000
Bus 1:  i2c@40b00000
Bus 2:  i2c@40b10000
Bus 3:  i2c@2000000
   21: gpio@21, offset len 1, flags 0
   20: gpio@20, offset len 1, flags 0
   22: gpio@22, offset len 1, flags 0
Bus 4:  i2c@2010000
Bus 5:  i2c@2030000
Bus 6:  i2c@2040000
   20: gpio@20, offset len 1, flags 0
Bus 7:  i2c@2050000

=> i2c dev 7
Setting bus to 7

=> md.l 0x0011C01C
0011c01c: 00060008 08214007 08214007 08214007    .....@!..@!..@!.
0011c02c: 08214007 08214007 08214007 08214007    .@!..@!..@!..@!.
0011c03c: 08214007 0005000e 0001000e 08214007    .@!..........@!.

=> md.l 0x0011C018
0011c018: 00060008 00060008 08214007 08214007    .........@!..@!.
0011c028: 08214007 08214007 08214007 08214007    .@!..@!..@!..@!.
0011c038: 08214007 08214007 0005000e 0001000e    .@!..@!.........

=> i2c probe
Valid chip addresses:Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured
Timed out in wait_for_event: status=0000

我们也尝试在 Linux 中进行类似的访问、但仍然失败。

root@j721s2-evm:~# devmem2 0x0011C01C
/dev/mem opened.
Memory mapped at address 0xffff8113f000.
Read at address  0x0011C01C (0xffff8113f01c): 0x40060008
root@j721s2-evm:~# devmem2 0x0011C018
/dev/mem opened.
Memory mapped at address 0xffffaa3da000.
Read at address  0x0011C018 (0xffffaa3da018): 0x00060008
root@j721s2-evm:~#
root@j721s2-evm:~# i2cdetect -l
i2c-3   i2c             OMAP I2C adapter                        I2C adapter
i2c-1   i2c             OMAP I2C adapter                        I2C adapter
i2c-4   i2c             OMAP I2C adapter                        I2C adapter
i2c-2   i2c             OMAP I2C adapter                        I2C adapter
i2c-0   i2c             OMAP I2C adapter                        I2C adapter
root@j721s2-evm:~# i2cdetect -y 4
Warning: Can't use SMBus Quick Write command, will skip some addresses
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:
10:
20:
30: [   72.559377] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   73.571375] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   74.583373] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   75.595376] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   76.607375] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   77.623373] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   78.639375] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   79.651374] omap_i2c 2050000.i2c: timeout waiting for bus ready
--
40:
50: [   80.663373] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   81.675377] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   82.687372] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   83.699372] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   84.711376] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   85.723374] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   86.735374] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   87.747375] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   88.759374] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   89.775375] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   90.787374] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   91.803372] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   92.815371] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   93.827373] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   94.839374] omap_i2c 2050000.i2c: timeout waiting for bus ready
-- [   95.851373] omap_i2c 2050000.i2c: timeout waiting for bus ready
--
60:
70:
root@j721s2-evm:~#

我们不知道为什么定制电路板上的相同软件配置会失败。

非常感谢你的指导、 我期待着你的答复。

此致、

Christopher

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    [引述 userid="549220" url="~/support/processors-group/processors/f/processors-forum/1518117/tda4ve-q1-unable-to-access-i2c5-omap_i2c-2050000-i2c-in-both-u-boot-and-linux-environments

    我们不知道为什么定制电路板上的相同软件配置会失败。

    [/报价]
    1. 您能否仔细检查定制电路板上的 I2C5是否使用了相同的引脚?
      1. 有2组引脚、因此只需仔细确认引脚。
    2. 您是否还可以通过读回引脚多路复用寄存器在 Linux 中对定制电路板进行交叉检查?
      1. /*该文件是由2025年5月26日 上的 TI PinMux 于上午10:11:27自动生成的。 */
        /*此文件只能用作参考。 一些引脚/外设、*/
        /*根据您的使用情况,可能需要额外的配置。 */

        &main_pmx0{
        myi2c1_pins_default:myi2c1-default-pins{
        pinctrl-single、pins =<
        J721S2_IOPAD (0x01c、PIN_INPUT、8)/*(Y24) MCAN15_TX.I2C5_SCL */
        J721S2_IOPAD (0x018、PIN_INPUT、8)/*(W23) MCAN14_RX.I2C5_SDA */
        >;
        };

        }

    3. 在定制电路板引导至 Linux 并尝试:
      'dmesg | grep i2c'请仔细检查 MAIN_i2c5是否成功探测。

    - Keerthy

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Keerthy:

    感谢您的反馈。

    我们在 Linux 中跟踪了您的建议并在我们的定制电路板上进行了交叉检查。

    进行以下中的修改  k3-j721s2-common-proc-board.dts

    &main_pmx0 {
    ..
    
        main_i2c5_pins_default: main-i2c5-pins-default {
            pinctrl-single,pins = <
                J721S2_IOPAD(0x01c, PIN_INPUT_PULLUP, 8) /* (Y24) MCAN15_TX.I2C5_SCL */
                J721S2_IOPAD(0x018, PIN_INPUT_PULLUP, 8) /* (W23) MCAN14_RX.I2C5_SDA */
     
            >;
        };
    };
    
    &main_i2c5 {                                                                                                   
        pinctrl-names = "default";
        pinctrl-0 = <&main_i2c5_pins_default>;
        clock-frequency = <400000>;
    };
    

    并按如下方式回读引脚多路复用寄存器

    root@j721s2-evm:~# devmem2 0x0011C01C
    /dev/mem opened.
    Memory mapped at address 0xffff8113f000.
    Read at address  0x0011C01C (0xffff8113f01c): 0x40060008
    root@j721s2-evm:~# devmem2 0x0011C018
    /dev/mem opened.
    Memory mapped at address 0xffffaa3da000.
    Read at address  0x0011C018 (0xffffaa3da018): 0x00060008
    root@j721s2-evm:~#
    root@j721s2-evm:~# i2cdetect -l
    i2c-3   i2c             OMAP I2C adapter                        I2C adapter
    i2c-1   i2c             OMAP I2C adapter                        I2C adapter
    i2c-4   i2c             OMAP I2C adapter                        I2C adapter
    i2c-2   i2c             OMAP I2C adapter                        I2C adapter
    i2c-0   i2c             OMAP I2C adapter                        I2C adapter
    root@j721s2-evm:~# i2cdetect -y 4
    Warning: Can't use SMBus Quick Write command, will skip some addresses
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:
    10:
    20:
    30: [   72.559377] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   73.571375] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   74.583373] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   75.595376] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   76.607375] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   77.623373] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   78.639375] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   79.651374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    --
    40:
    50: [   80.663373] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   81.675377] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   82.687372] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   83.699372] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   84.711376] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   85.723374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   86.735374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   87.747375] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   88.759374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   89.775375] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   90.787374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   91.803372] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   92.815371] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   93.827373] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   94.839374] omap_i2c 2050000.i2c: timeout waiting for bus ready
    -- [   95.851373] omap_i2c 2050000.i2c: timeout waiting for bus ready
    --
    60:
    70:
    root@j721s2-evm:~#

    它似乎是 MAIN_i2c5 不会 探测成功

    root@j721s2-evm:~# dmesg |grep "i2c"
    [    0.689104] i2c /dev entries driver
    [    0.815933] omap_i2c 42120000.i2c: bus 0 rev0.12 at 100 kHz
    [    0.822188] omap_i2c 40b00000.i2c: bus 1 rev0.12 at 100 kHz
    [    0.828290] omap_i2c 40b10000.i2c: bus 2 rev0.12 at 100 kHz
    [    0.934569] omap_i2c 2000000.i2c: bus 3 rev0.12 at 400 kHz
    [    1.959428] omap_i2c 2050000.i2c: timeout waiting for bus ready
    [    1.976186] omap_i2c 2050000.i2c: bus 4 rev0.12 at 400 kHz
    

    我们想知道:由于相同的可引导 SD 卡在 TDA4VE EVM 上正常工作、并且 main_i2c5 接口是可读的。

    这是否意味着 main_i2c5 已正确配置?

    我们还仔细检查了 Y24、W23仅连接到 UB960

    非常感谢。

    Christopher

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Christopher、

    我可以看到引脚多路复用器设置正确。 并邀请我们的硬件专家。 请期待收到延迟的回复、因为这是美国球队的漫长周末。

    - Keerthy

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Keerthy:

    感谢您对软件配置的认可、并期待硬件专家的见解。

    此致、

    Christopher

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Keerthy:

    我们选择了几个引脚进行实验、并使用 devmem2直接修改焊盘配置、将模式设置为 GPIO 以进行读取/写入操作。

    例如:

    1. unbind i2c5
    echo 2050000.i2c > /sys/bus/platform/drivers/omap_i2c/unbind
    
    2. set pinmux to GPIO mode for ball Y24 and W23
    devmem2 0x0011C01C w 0x40060007
    devmem2 0x0011C018 w 0x40060007
    
    3. export gpio sysfs to contrl, and measure the voltage by meter

    在我们的定制板上、我们观察到以下情况:

    1.下面的引脚 VDDSHV2 IO 组、例如 Y24/I2C5_SCL、W23/I2C5_SDA 和 W25/UART5_TXD 不能 失调电压。
    2.下面的插针 VDDSHV0 可以控制 IO 组、例如 AH25/I2C0_SCL、AE24/I2C0_SDA 和 AG26/UART2_RXD 接地平面 。 在输入模式下、它们正确读取高/低电平、而在输出模式下、它们可以按预期设置为高/低电平。

    请注意、在 TDA4VE EVM 上、可以正确控制上述所有引脚(在 VDDSHV2和 VDDSHV0下)。

    问题:

    1. VDDSHV2下的 IO 引脚在我们的定制电路板上无法正常工作的可能原因是什么?
    2.我们如何确定 IO 组是否由于某些错误而进入了失效防护模式?

    谢谢。

    此致、

    Christopher

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Keerthy:

    我们为实验、选择了更多引脚、但结果保持不变。 无法正确控制与 VDDSHV2 IO 组关联的引脚。

    VDDSHV0 group: AH25, AE24, AG26, AH26, AE27
    These pins functioned correctly in GPIO mode.
    
    VDDSHV2 group: Y24, W23, T25, W25, V23, T26, AB28, U27, AD26, U25
    These pins could not be properly controlled in GPIO mode.

    下面提供了 PMIC 的上电序列。

    A-GPIO9		= EN_MCU3V3_VIO			= R967	= -56us
    B-GPIO11	= EN_3V3_IO 			= R700	= -55us
    A-LDO2		= VDD_MCU_GPIORET_3V3	= C727	= 0us
    B-LDO2		= VDD_GPIORET_3V3		= C760	= 0us    <-- Yellow (Reference)
    B-GPIO3		= EN_DDR_VDD1			= R699	= 1680us
    A-LDO4		= VDA_MCU_1V8			= R729	= 1790us
    A-LDO3		= VDD_MCUIO_1V8			= R728	= 1750us
    B-BUCK3		= VDD_PHY_1V8			= C750	= 1860us
    B-BUCK1		= VDD_IO_1V8			= C734	= 1860us
    B-LDO4		= VDD_PLL_1V8			= C762 	= 1810us
    A-BUCK5		= VDD_MCU_0V85			= C722	= 2860us
    A-LDO1		= VDD_MCU_WK_0V8		= C726	= 2760us
    A-BUCK1234	= VDD_CPU_AVS			= C695	= 2860us
    C-BUCK1234	= VDD_CORE_0V8			= C768 	= 2740us
    B-LDO1		= VDD_WK_0V8			= C759	= 2760us
    B-LDO3		= VDA_DLL_0V8			= C761	= 2760us
    B-BUCK5		= VDD_RAM_0V85			= C756	= 4940us
    B-BUCK4		= VDD_DDR_1V1			= C754	= 4940us
    A-nRSTOUT	= H_MCU_PORz			= TP190	= 12800us
    A-GPIO11	= H_SOC_PORz			= TP191	= 12800us

    谢谢。

    Christopher

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我之前没有看到这种类型的误差。  如何为 VDDSHV2供电?  您是否验证了这些电源引脚(M20、R20)上的电压正确(3.3V)?  请注意、EVM 支持一些更高级的 IO 功能(IO 保持)、因此这些引脚可能已连接到不同的电源。 另请确认电源轨 VDD_WAKE0 (引脚20)。   它应连接到 VDD_CORE (如果不支持保持模式)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Robert:  

    感谢您发送编修。

    我们已经检查了 VDD_WAKE0 (引脚20)是否连接到 VDD_WK_0V8。 但我们注意到、在我们的定制电路板上、VDD_WK_0V8未连接到 VDD_WK_0V8_REG、这是 PMIC-B LDO1的输出。

    连接 VDD_WK_0V8_REG 和 VDD_WK_0V8后、可以 正确控制 VDDSHV2 IO 组的 IO 引脚。

    再次感谢,线程可以关闭。

    此致、

    Christopher