From: Wolfgang Denk Date: Thu, 02 Sep 2004 23:20:54 +0200 Subject: [U-Boot-Users] multiple i2c controllers In-Reply-To: Your message of "Thu, 02 Sep 2004 15:58:59 CDT." <2acbd3e404090213583c7c9e6@mail.gmail.com> Message-ID: <20040902212059.F13B0C109F@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Andy, in message <2acbd3e404090213583c7c9e6@mail.gmail.com> 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 -- 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