From: Wolfgang Denk Date: Fri, 12 May 2006 21:01:33 +0200 Subject: [U-Boot-Users] Using a second I2C interface In-Reply-To: Your message of "Fri, 12 May 2006 13:00:13 CDT." Message-ID: <20060512190133.538D8352B0C@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 Hello, in message you wrote: > > > The CPU I'm using (MPC8349) has two hardware I2C interfaces, and > > I'd like to access the second one in U-boot. Implementing this > > looks easy to me, but I don't want to reinvent the wheel if it's > > already been done elsewhere. Has anyone done this? If not, I'll > > follow up with a proposal. > > Depending on what you want to do, you can cheat and just change the > pointer to the 2nd interface. If you want something more full > featured up to the command level then I think some discussion would > be required on how the commands should work for specifying which > controller to use. A clean design should allow to switch I2C busses usign a command; additionally, I think we should try to stay backward-compatible with the existing code. Eventually this is not too difficult: similar to the "ide" or "usb" commands we could create a new command "i2c device" which takes as argument the number of the I2C bus which shal become the current (= active) bus. Then all existing I2C related commands can be left unchanged (and "i2c device" without arguments should of course print the ID of the current bus). In parallel, existing I2C commands could be changed to migrate to a new "i2c" group of commands: "imd" would become "i2c md", "imw" becomes "i2c mw", "iprobe" becomes "i2c probe", etc. For some (long) transition period old and new commands could be provided in parallel (at least optionally). Later, the old syntax could be dropped. Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Ever try. Ever fail. No matter. Try again. Fail again. Fail better. -- S. Beckett