[U-Boot] [PATCH] 7/12 Multiadapter/multibus I2C, drivers part 4

Heiko Schocher hs at denx.de
Thu Feb 19 08:39:42 CET 2009


Hello Wolfgang,

Wolfgang Denk wrote:
> Dear ksi at koi8.net,
> 
> In message <Pine.LNX.4.64ksi.0902181400470.5729 at home-gw.koi8.net> you wrote:
>> How would you know what to initialize and what not to? We were initializing
> 
> I don't know. You probably need some way to encode some kind of

Look at my proposal for i2c_set_bus_num().

http://lists.denx.de/pipermail/u-boot/2009-February/047860.html

This function is the central point for switching between busses. It
_must_ be called, when switching busses, so this function can decide,
if the hardware adapter is initialized or not. If not, it will
call the init function ... and there is no problem for calling
the init function, when running in flash. We _first_ call the
adapter specific init() function and _then_ switching the muxes.

Also we can do in this function the adapterspecific deinit()
function ... one central point for doing init(), deinit()
sounds good to me.

We just have to look, that boards who uses i2c_* functions,
now call before accessing the I2C bus, i2c_set_bus_num().
But this is with every implemntation for multibussuport a ToDo,
because there probably now more then one bus, so we must
take care of this.

>> It is easy to initialize just a selected set of adapters in the new code but
>> how do we decide what to initialize and what not to?
> 
> Good question. Probably each  I2C  device  will  have  some  list  of
> bus/adapter  ID's  that need to be up to access it, and that will get
> shut down afterwards.

No need for this i2c_set_bus_num() will do that automagically.

>> Should we add a config option like CONFIG_I2C_INIT_ADAPTERS {1,3,5,9} ? But
> 
> No, because we probably do not need to activate all tehse adapters at
> the same time.

We don;t need this, because there is i2c_set_bus_number, which can
do this for us.

>> There is also no way of DE-initilizing those interfaces so that init is like
>> a gun trigger -- once it is pulled, there is no way to bring the bullet
>> back.
> 
> That needs to be changed, too.

Ack.

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list