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.

AM6548: U-boot i2c access EEPROM command

Part Number: AM6548


Hi Ti,

We are using Linux RT SDK 07.01.00.18 and tried to access EEPROM via i2c command in u-boot.

However, we always got below error:

Hit any key to stop autoboot:  0

=>

=>

=> i2c probe

Valid chip addresses: 60

=> i2c bus

Bus 0:  i2c@42120000  (active 0)

   60: generic_60, offset len 1, flags 0

Bus 1:  i2c@40b00000

Bus 2:  i2c@2000000

   50: eeprom@50, offset len 1, flags 0

Bus 3:  i2c@2010000

Bus 4:  i2c@2020000

Bus 5:  i2c@2030000

=> i2c bus 2

Bus 2:  i2c@2000000  (active 2)

   50: eeprom@50, offset len 1, flags 0

=> i2c md 0x50 0 10

i2c_write: error waiting for data ACK (status=0x116)

Error reading the chip: -121

=> i2c md 0x50 0 10

i2c_write: error waiting for data ACK (status=0x116)

Error reading the chip: -121

Below are our dts setting in k3-am654-base-board.dts.

&main_i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&main_i2c0_pins_default>;
clock-frequency = <400000>;
u-boot,dm-spl;

eeprom: eeprom@50 {
compatible = "atmel,24c16a";
reg = <0x50>;
pagesize = <16>;
u-boot,dm-spl;
};
};

And we also enable CONFIG_I2C_EEPROM=y in am65x_evm_a53_defconfig.

Is there any setting or config lost?

Thanks.

Eric

  • Hi Ti,

    Any one can help this?

    Thanks.

    Eric

  • Eric,

    Which board is this?

    My u-boot output from SDK 7.3:

    => i2c bus
    Bus 0: i2c@42120000 (active 0)
    38: gpio@38, offset len 1, flags 0
    52: generic_52, offset len 2, flags 0
    54: generic_54, offset len 2, flags 0
    39: generic_39, offset len 1, flags 0
    50: generic_50, offset len 1, flags 0
    51: generic_51, offset len 1, flags 0
    60: generic_60, offset len 1, flags 0
    Bus 1: i2c@40b00000
    Bus 2: i2c@2000000
    21: gpio@21, offset len 1, flags 0
    Bus 3: i2c@2010000
    Bus 4: i2c@2020000
    Bus 5: i2c@2030000

    Also i2c bus 2

    => i2c dev 2
    Setting bus to 2
    => i2c probe
    Valid chip addresses: 21 41 57 60 63 6F

    I do not have 0x50 as a valid Slave ID.

    I am having the PG2.0 AM654 EVM.

    Best Regards,
    Keerthy

  • Hi Keerthy,

    This is our evm board.

    As you can see below, I also can access 0x60. But 0x50 on bus 2 always failed.

    We also use main_i2c0 for 0x50 eeprom in kernel, and it works as well in kernel.

    So, I have no idea why it cannot work in uboot.

    Any idea about this?

    Hit any key to stop autoboot:  0

    =>

    => i2c bus

    Bus 0:  i2c@42120000  (active 0)

    Bus 1:  i2c@40b00000

    Bus 2:  i2c@2000000

       50: eeprom@50, offset len 1, flags 0

    Bus 3:  i2c@2010000

    Bus 4:  i2c@2020000

    Bus 5:  i2c@2030000

    => i2c probe

    Valid chip addresses: 60

    => i2c bus

    Bus 0:  i2c@42120000  (active 0)

       60: generic_60, offset len 1, flags 0

    Bus 1:  i2c@40b00000

    Bus 2:  i2c@2000000

       50: eeprom@50, offset len 1, flags 0

    Bus 3:  i2c@2010000

    Bus 4:  i2c@2020000

    Bus 5:  i2c@2030000

    => i2c md 60 0 10

    0000: 2e ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................

    => i2c md 50 0 10

    i2c_write: error waiting for data ACK (status=0x116)

    Error reading the chip: -121

    Thanks.

    Eric

  • Eric,


    As you can see below, I also can access 0x60.

    This is on a different I2C bus right?

    I2C2 only lists slave-ID 0x50.

    Is the pin muxing done correctly on your custom board?

    60: generic_60, offset len 1, flags 0

    This is I2C0 i believe.

    So Main_I2C0 is failing for you. Please check the pin muxing on your custom board.
    Also the u-boot does not probe all the device tree nodes. Can you please check if
    the main_i2c0 instance is even getting probed?

    - Keerthy

    - Keerthy