[U-Boot-Users] Using a second I2C interface

Wolfgang Denk wd at denx.de
Fri May 12 21:01:33 CEST 2006


Hello,

in message <E541A453-EC07-4597-8D60-2EE3919C1A18 at kernel.crashing.org> 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




More information about the U-Boot mailing list