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.

Linux/am5728: PMIC I2C bus change

Part Number: AM5728
Other Parts Discussed in Thread: AM5728

Tool/software: Linux

Hello,

On our custom AM5728 design, Instead of I2C1, we have used I2C3 port to control PMIC. We tried to change I2C1 on MLO and uboot source code but we have problems.

I'm using Linux Ubuntu 16.04 and version of SDK (03.03.00.04). Our aim is to change AM5728 I2C bus from I2C1 to I2C3 to control PMIC (On our custom board we've connected AM5728 I2C3 to PMIC I2C bus). We've made these changes:

1- (Uboot source dir)/arch/arm/dts/am57xx-beagle-x15.dts in this file we've added i2c3 settings for PMIC control.

2- (Uboot source dir)/include/configs/ti_armv7_omap.h in this file under I2C IP Block we've changed to 3 from 1 for this definition (#define CONFIG_SYS_OMAP24_I2C_SLAVE 3)

3- (Uboot source dir)/arch/arm/include/asm/arch-omap5/i2c.h/ in this file we've changed to 3 from 1 this definition (#define I2C_DEFAULT_BASE I2C_BASE3)

4- (Uboot source dir)/board/ti/am57xx/mux_data.h in this file we've removed pin mux i2c1 and added i2c3 pin mux under these struct const struct pad_conf_entry early_padconf and const struct pad_conf_entry core_padconf_array_essential_x15[]

5- (Uboot source dir)/arch/arm/cpu/armv7/omap5/hw_data.c in this file under enable_basic_clocks function we've added (*prcm)->cm_l4per_i2c3_clkctrl,

Is there any other files that we need to change in order to get result?

We've added Uboot debug console for our custom board as an attachment. You can see the error below.

Best regards

Alican

  • The software team have been notified. They will respond here.
  • Hi Alican,

    In step 4, see if you have:
    const struct pad_conf_entry early_padconf[]

    If you do, change I2C1 to the one used in your system, that is I2C3.

    Best Regards,
    Yordan
  • Hi Yordan,

    We've already changed it.

    const struct pad_conf_entry early_padconf[] = {
    {SPI2_SCLK, (M1 | PIN_INPUT_SLEW)}, /* spi2_sclk.uart3_rxd */
    {SPI2_D1, (M1 | PIN_INPUT_SLEW)}, /* spi2_d1.uart3_txd */
    {GPIO6_10, (M2 | PIN_INPUT_PULLUP)}, /* gpio6_10.i2c3_sda */
    {GPIO6_11, (M2 | PIN_INPUT_PULLUP)}, /* gpio6_11.i2c3_scl */
    };

    Best regards
    Alican
  • Hi Alican,

    Have you tried putting a scope on the I2C lines? Any activity? It would be interesting to know if you see any activity on I2C3 or I2C1.

    Next I'd set some breakpoints to understand what's going on. Take a look at some of the low-level I2C functions like i2c_set_bus_num to verify your I2C3 instance is getting set, and take a look a bit higher up in the do_scale_vcore function (arch/arm/cpu/armv7/omap_common.c).

    Regards,
    Mike
  • Hi Mike,

    We've solved the problem. Our custom AM5728 design, Instead of I2C1, we have used I2C3 port to control PMIC (TPS6590377 different from AM57xx GP EVM Rev A3). We're using Linux Ubuntu 16.04 and version of SDK (03.03.00.04). We've made these changes:

    1- (Uboot source dir)/arch/arm/dts/am57xx-beagle-x15.dts in this file we've added I2C3 settings instead of I2C1 for PMIC control.

    2- (Uboot source dir)/board/ti/am57xx/mux_data.h in this file we've removed pin mux I2C1 and added I2C3 pin mux under these struct const struct pad_conf_entry early_padconf and const struct pad_conf_entry core_padconf_array_essential_x15[]

    3- (Uboot source dir)/arch/arm/cpu/armv7/omap5/hw_data.c in this file under "enable_basic_clocks" function we've added (*prcm)->cm_l4per_i2c3_clkctrl, instead of (*prcm)->cm_l4per_i2c1_clkctrl (default)

    4- (Uboot source dir)/drivers/power/palmas.c in this file under "palmas_mmc1_poweron_ldo" function we've added "i2c_set_bus_num(2)" to set I2C3 bus. Before sending the command to PMIC, we have to set to I2C3 bus number.

    5- (Uboot source dir)/drivers/i2c/i2c_core.c in this file under "i2c_init" function we've added "i2c_set_bus_num(2)" to set I2C3 bus. This step is necessary because "i2c_init" function sets to I2C1 bus number by default.

    Best regards
    Alican
  • Hi Alican,

    Thank you very much for reporting back and summarizing your results!

    Regards,
    Mike