Skip to contentSkip to conversation

multiple i2c controllers

U-Boot-Users Andy Fleming 2 participants 2 messages Sep 2, 2004

lore
Share & tools
lore
#0 lore raw

I've been looking into adding support for a system that has 2 i2c controllers accessible by the processor to u-boot. Has anyone done something like this? Does u-boot's current i2c infrastructure support the idea of two separate i2c busses?

Thanks,
Andy Fleming

#1 lore raw

Dear Andy,

Quoted 4 lines · in message <[email protected]> you wrote:

I've been looking into adding support for a system that has 2 i2c controllers accessible by the processor to u-boot. Has anyone done something like this? Does u-boot's current i2c infrastructure support the idea of two separate i2c busses?

No, this is not supported yet. But I think it should be possible to add this in a compatible way.

For example, we could use a notation of "[bus:]chip" addresses so the existing commands in the i2* family will continue to work on systems with a single I2C bus, and on multi-bus systems you just add the bus number to the device address separated by a colon. For example, to address the device with chip address 0x50 on bus 1 you would type "imd 1:50 ..."; omitting the bus specifier would access the default I2C bus. For simplicity, we can define that this is the same as bus 0 always. If you have time to play around, you could add a default bus environment variable.

This would also work for example with the eeprom command; we could use the "bus:" extension in the offset part, like:

	eeprom read 100000 1:400 100

What do you think?

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
There is is no reason for any individual to have a computer in  their
home.      -- Ken Olsen (President of Digital Equipment Corporation),
              Convention of the World Future Society, in Boston, 1977