Project

General

Profile

uBoot I2C Speed Command [MityDSP L138]

Added by Michael B about 3 hours ago

Hi All,
I'm in the middle of debugging some I2C issues and was curious how the uBoot i2c speed command is handled. It seems to take/return Hz, does that relate to baud rate, bitrate, or just SCL frequency?

The i2c speed is defaulting to 25000 Hz according to command: "U-Boot > i2c speed" returning 25000. What are the valid options that this speed can be changed to? I have tried changing this value but always get "Failure changing bus speed (-1)" return.

Best,
Michael


Replies (2)

RE: uBoot I2C Speed Command [MityDSP L138] - Added by Michael B about 2 hours ago

As a follow up, is there any way to test I2C 1 bus through uBoot?

RE: uBoot I2C Speed Command [MityDSP L138] - Added by Jonathan Cormier about 1 hour ago

Michael B wrote:

Hi All,
I'm in the middle of debugging some I2C issues and was curious how the uBoot i2c speed command is handled. It seems to take/return Hz, does that relate to baud rate, bitrate, or just SCL frequency?

The i2c speed is defaulting to 25000 Hz according to command: "U-Boot > i2c speed" returning 25000. What are the valid options that this speed can be changed to? I have tried changing this value but always get "Failure changing bus speed (-1)" return.

In the 2009 u-boot, i2c set speed is not implemented. There are provisions for architecture specific implementations but there are none relevant for the L138.

https://support.criticallink.com/gitweb/?p=u-boot-mitydspl138.git;a=blob;f=common/cmd_i2c.c;h=62cbd335e5a458e31b1ff8a9950b62ed6875e4af;hb=refs/heads/master#l133

/* TODO: Implement architecture-specific get/set functions */
unsigned int __def_i2c_get_bus_speed(void)
{
    return CONFIG_SYS_I2C_SPEED;
}
unsigned int i2c_get_bus_speed(void)
    __attribute__((weak, alias("__def_i2c_get_bus_speed")));

int __def_i2c_set_bus_speed(unsigned int speed)
{
    if (speed != CONFIG_SYS_I2C_SPEED)
        return -1;

    return 0;
}
int i2c_set_bus_speed(unsigned int)
    __attribute__((weak, alias("__def_i2c_set_bus_speed")));

Note the 25Khz comes from this config:
https://support.criticallink.com/gitweb/?p=u-boot-mitydspl138.git;a=blob;f=include/configs/mityomapl138.h;h=2b604d16260cedda661a4e569409c18327aa113b;hb=refs/heads/master#l99

We do have a 2019 u-boot which might have i2c speed support. I can try it out tomorrow.
https://support.criticallink.com/gitweb/?p=u-boot-mitydspl138.git;a=shortlog;h=refs/heads/u-boot-2019.01

As a follow up, is there any way to test I2C 1 bus through uBoot?

Not with the u-boot shipped on the units. In the 2009 u-boot source, CONFIG_I2C_MULTI_BUS would need to be enabled and the i2c1 pinmuxes would need to be configured. I can create a test build if you would like to try, though maybe building the providing the 2019 u-boot would be better for you.

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)