[U-Boot-Users] PATCH: Add command support for multiple I2C controllers

Ben Warren bwarren at qstreams.com
Wed May 17 21:21:35 CEST 2006


Attached is a second stab at a patch to allow access to multiple I2C
controllers.  It enhances the command set by adding the following
command, which changes the 'current' I2C bus.  Further write, read,
probe etc. commands will deal with the newly selected bus:

ibus [bus_index] [speed in Hz]

In addition, the logic for ignoring I2C devices during a probe command
has been enhanced to work with multiple controllers.  The software has
been tested with new and old configurations (i.e. is backwards

Old way of ignoring devices:

#define CFG_I2C_NOPROBES {0x11, 0x22}

New way:

#define CFG_I2C_MULTI_NOPROBES {0x11, 0x22, 0xff, 0x33, 0x44, 0xff}

where controller lists are delimited by '0xff', which is an invalid I2C

Note: In order to use, drivers must be modified to implement the
following API extensions:

int	i2c_set_bus(uchar bus, int speed);
uchar	i2c_get_bus_num(void);
int	i2c_get_bus_speed(void);

Code is conditionally compiled using:


	If CONFIG_I2C_MULTI_BUS is defined, the 'ibus' command becomes
available, allowing the user to switch between I2C buses and to change
bus speeds.  Additionally, devices may be excluded from being probed by
defining a CFG_I2C_MULTI_NOPROBES array, where lists for each controller
are delimited by '0xff'

Please have a look and feed back any suggestions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: I2C_MULTIBUS.patch
Type: text/x-patch
Size: 5032 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060517/704f7a3c/attachment.bin 

More information about the U-Boot mailing list