Skip to contentSkip to conversation

mxc_i2c driver

U-Boot York Sun 2 participants 3 messages Jan 14, 2014

lore
Share & tools
lore

York Sun

author
#0 lore raw

Troy,

I am trying to use mxc_i2c driver with multiple buses. I didn't figure out how the bases are set. Can you shed some light on this?

Thanks,

York

#1 lore raw
Quoted 9 lines · York Sun

Troy,

I am trying to use mxc_i2c driver with multiple buses. I didn't figure out how the bases are set. Can you shed some light on this?

Thanks,

York

see board/boundary/nitrogen6x/nitrogen6x.c

It calls

         setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
         setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
         setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);

which is in
arch/arm/imx-common/i2c-mxv7.c

This file has an array of base addresses

static void * const i2c_bases[] = {
         (void *)I2C1_BASE_ADDR,
         (void *)I2C2_BASE_ADDR,
#ifdef I2C3_BASE_ADDR
         (void *)I2C3_BASE_ADDR,

#endif
};

author
#2 lore raw
Quoted 21 lines · Troy Kisky
Quoted 9 lines · York Sun

Troy,

I am trying to use mxc_i2c driver with multiple buses. I didn't figure out how the bases are set. Can you shed some light on this?

Thanks,

York

see board/boundary/nitrogen6x/nitrogen6x.c

It calls

         setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info0);
         setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
         setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2);

which is in
arch/arm/imx-common/i2c-mxv7.c

This file has an array of base addresses

Quoted 8 lines
static void * const i2c_bases[] = {
         (void *)I2C1_BASE_ADDR,
         (void *)I2C2_BASE_ADDR,
#ifdef I2C3_BASE_ADDR
         (void *)I2C3_BASE_ADDR,

#endif
};

Great! Thanks.

York