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.

AM3352: I2C1 probe fails

Part Number: AM3352
Other Parts Discussed in Thread: BQ32000, TPS65217

Hi all,

I am working on an AM3352 based custom board. I am using TI SDK 4.0 and had a custom uboot based on the AM335x EVM. 

We don't have board detect EEPROM and we don't use I2C0 for anything. We have TPS65217C and BQ32000 on I2C1.

I have done the pin mux as follow:

static struct module_pin_mux i2c1_pin_mux[] = {
{OFFSET(spi0_d1), (MODE(2) | RXACTIVE |
PULLUP_EN | SLEWCTRL)}, /* I2C_DATA */
{OFFSET(spi0_cs0), (MODE(2) | RXACTIVE |
PULLUP_EN | SLEWCTRL)}, /* I2C_SCLK */
{-1},
};

I am calling the i2c_set_bus_num(1); in the board file to switch to I2C1.

ISSUE:


When I boot the U-boot and try to probe the chips on I2C1. U-boot throw below errors.

Hit any key to stop autoboot:  0  
=> i2c dev 1
Setting bus to 1
=> i2c probe
Valid chip addresses:Timed out in wait_for_event: status=0100
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
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

Same way it shows below errors in Kernel boot:

[    2.561037] omap_i2c 4802a000.i2c: controller timed out
[    2.591040] tps65217 1-0024: Read from reg 0x16 failed
[    2.596211] vdds_dpr: failed to enable
[    2.599996] tps65217 1-0024: failed to register tps65217-pmic regulator
[    2.606711] tps65217-pmic: probe of tps65217-pmic failed with error -110
[    3.681025] omap_i2c 4802a000.i2c: controller timed out
[    3.711029] tps65217 1-0024: Failed to read revision register: -110
[    3.717817] tps65217: probe of 1-0024 failed with error -110
[    3.724058] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
[    3.730731] hctosys: unable to open rtc device (rtc0)
[    3.736579] wlan-en-regulator: disabling

Please suggest possible cause of this issue.

Thank you,

Divyeshkumar M

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

    Latest TISDK also uses device tree for u-boot. Can you share the relevant i2c portion of the device tree located in arch/arm/dts?

    Best Regards,
    Yordan

  • Hi Yordan,

    Thanks for your response.

    To make the pin mux unique. I have modified the pin muxing of i2c1. Below is the mux details of i2c1 in mux.c and device tree of u-boot:

    mux.c:

    static struct module_pin_mux i2c1_pin_mux[] = {

    {OFFSET(uart0_ctsn), (MODE(3) | RXACTIVE |

    PULLUP_EN | SLEWCTRL)}, /* I2C1_DATA */

    {OFFSET(uart0_rtsn), (MODE(3) | RXACTIVE |

    PULLUP_EN | SLEWCTRL)}, /* I2C_SCLK */

    {-1},

    };

    U-boot Device Tree:

    i2c1_pins: pinmux_i2c1_pins {

    pinctrl-single,pins = <

    0x168 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_ctsn.i2c1_sda */

    0x16c (PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_rtsn.i2c1_scl */

    >;

    };

    &i2c1 {

    pinctrl-names = "default";

    pinctrl-0 = <&i2c1_pins>;

    status = "okay";

    clock-frequency = <100000>;

    tps: tps@24 {

    reg = <0x24>;

    };

    bq32k_rtc: rtc@68 {

    compatible = "ti,bq32000", "dallas,ds1307";

    reg = <0x68>;

    };

    };

    After this changes, I don't get the time-out errors, but I don't get anything in the detected chip list too. Below is the findings:

    U-boot:

    Hit any key to stop autoboot:  0  
    => i2c dev 1
    Setting bus to 1
    => i2c probe
    Valid chip addresses:
    =>

    Linux:

    root@am335x-evm:~# i2cdetect -r 1

    WARNING! This program can confuse your I2C bus, cause data loss and worse!

    I will probe file /dev/i2c-1 using read byte commands.

    I will probe address range 0x03-0x77.

    Continue? [Y/n] y

        0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

    00:          -- -- -- -- -- -- -- -- -- -- -- -- --

    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

    70: -- -- -- -- -- -- -- --                        

    root@am335x-evm:~#

    Can you also please tell me the modifications required in U-boot to support PMIC on I2C1?

    Thank you,

    Divyeshkumar M

  • Hi,

    Try adding something similar for I2C1 in board/ti/am335x/board.c:
    void do_board_detect(void)
    {
    enable_i2c0_pin_mux();
    i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);

    if (ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR))
    printf("ti_i2c_eeprom_init failed\n");
    }

    Best Regards,
    Yordan
  • Hi Yordan,

    I have already tried doing that. It does not work.

    Since i2c0 is not being used on my board, I have moved the chips on i2c0 just to confirm. Both the chips are getting detected on i2c0.

    Thus there is some issue with i2c1 I suspect. Would you guide me through all the changes I need to make in u-boot to make the i2c1 work at u-boot level and hence kernel.

    Thanks,

    Divyeshkumar M

  • Hi,

    Let me test this on my BBB and I will get back to you with my feedback.

    Best Regards,
    Yordan
  • OK Yordan,

    Thank you for your help.

    Regards,
    Divyeshkumar
  • Sorry for the delay, I got caught up with other tasks and I've not been able to test this.
    I just wanted to let you know that I will try it by the end of the week and update.

    Best Regards,
    Yordan
  • Hi Yordan,

    No problem, thank you for your help again. Really appreciate it.

    Regards,
    Divyeshkumar M
  • Okay, I've managed to enable the I2C1 on my BBB expansion headers.
    Can you also please tell me the modifications required in U-boot to support PMIC on I2C1?

    I can't actually verify this, because I don't have my hands on an external i2c device, which should be connected to i2c1.
    Have you added the enable_i2c1_pin_mux(); in gpi2c_init in board.c:
    void gpi2c_init(void)
    {
    /* When needed to be invoked prior to BSS initialization */
    static bool first_time = true;

    if (first_time) {
    - enable_i2c0_pin_mux();
    + enable_i2c1_pin_mux();
    i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED,
    CONFIG_SYS_OMAP24_I2C_SLAVE);
    first_time = false;
    }
    }

    Then search for tps related code in board.c and if needed change the controller to I2C1.

    Best Regards,
    Yordan
  • In addition, change:
    #define CONFIG_SYS_OMAP24_I2C_SLAVE
    in include/configs/ti_armv7_omap.h. Currently there is the following definition:
    #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
    Change this to 2, which means I2C_BASE2 0x4802A000

    Also in arch/arm/include/asm/arch-am33xx/i2c.h change
    #define I2C_DEFAULT_BASE I2C_BASE1
    to
    #define I2C_DEFAULT_BASE I2C_BASE2

    Best Regards,
    Yordan
  • HI Yordan,

    Thank you for your response. I have already tried all the above changes in my files. I could switch to i2c1 in u-boot but, u-boot is not able to detect any devices on it. It shows no detected devices.

    I think I have not defined #define I2C_DEFAULT_BASE I2C_BASE2 in my i2c.h file. I would do that change and give it a try.

    I'll update the thread with the results. I am OOTO today, so I'll get the chance to do that on Monday.

    Regards,
    Divyeshkumar M
  • Hi,

    I've not heard back. I consider this issue is resolved, so I am closing this thread.

    Best Regards,
    Yordan
  • Hi Yordan,

    Sorry I got busy with other assignments. Also we decided to use I2C0 instead of I2C1 for our next revision of boards. If I'll get a free slot, I would load the old files and try to test I2C1 as per your suggestions.

    Thank you for your support. Really appreciate that.

    Regards,
    Divyeshkumar