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

Wolfgang Denk wd at denx.de
Thu Feb 19 21:50:02 CET 2009


Dear ksi at koi8.net,

In message <Pine.LNX.4.64ksi.0902191141090.18501 at home-gw.koi8.net> you wrote:
> 
> > in board config file ... OK, we are worser against your approach, because
> > we have for all I2C_SDA, I2C_SCL accesses + 1 switch, but I don;t think
> > this is such a problem.
> 
> First of all, you are using an external global variable for object methods.
> That is a VERY BAD practice and I can't even imagine a use case that would
> justify this.

We are pretty pragmatic here. If it solves a problem efficiently, we
use even global variables.

> That means you'll have to rewrite the entire U-Boot. 99% of the boards have
> only one bus so they did not switch busses. That means they never called
> that i2c_set_bus_num() relying on i2c_init() in libxxx/board.c instead.

I cannot follow your argument.

Yes, the status quo is as you describe, it relies on  i2c_init()  and
is   simple-minded   and  does  not  support  an  arbitry  number  of
arbitrarily complex I2C bus trees and multiplexors and expanders  and
what  else.  But  it  was  sufficient  for the first 10 years and 500
boards of U-Boot development.

Now we are discussion a major redesign, so what is the big problem of
changing this part? "rewrite the entire U-Boot"? Please stay serious.
Compared to the other changes you suggest, this is  not  that  big  a
part.

> Sorry guys, I do not have THAT much free time that my employer would let me
> to spend on this.

Well, you at least have some commercial motivation to spend time  for
this code and discussion, while for me it's all my "free" time (and I
better  don't  tell you what my wife says of my interpretation "free"
here).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
To be a winner, all you need to give is all you have.


More information about the U-Boot mailing list