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

Wolfgang Denk wd at denx.de
Thu Feb 19 22:22:29 CET 2009


Dear ksi at koi8.net,

In message <Pine.LNX.4.64ksi.0902191024560.18501 at home-gw.koi8.net> you wrote:
> 
> Argh... Do you understand that those send_start etc. are _NOT_ the
> functions? One more time -- they are _NOT_ functions, they are _TEMPLATES_.


Please, please: calm down.

I think there is no reason to claim that Heiko did not understand
this.

On the other side, I,  too,  feel  that  you  should  (just  for  the
theoretical  possibility  of  another,  probably completey stupid and
braindead and whatever, but still another approach to solve the  same
set  of  problems)  try to follow Heiko's thoughts and see where that
would take us?

If you continue to perseverate on the position that your code is  the
only possible solution, we might as well stop the discussion here.



> Hm... Please explain how are you going to use 2 different sets of pins with
> different access methods with one function?

Been there before. See for example
http://lists.denx.de/pipermail/u-boot/2009-February/047937.html

> So we should make a monster with switches off of each and every send_start()
> and friends and pass them a value to decide which set to use?

No, of course not.

> That makes everything more messy and has a performance penalty -- instead of
> simple branch to those simple blocks you are adding at least one register
> load per call to load that argument.

That seams a _terrible_ overhead to me: one register load per call.
How fast is that I2C bus? Well below 50 kByte per second, right?

Please stay serious.


> > No problem with this.
> 
> There IS a problem First, that means you have _ABSOLUTELY_ no way to access
> any other adapter than default one until that variable made writable.

Please let's stop considering this as a problem.

Let's accept that this is a self-imposed and accepted restriction.


> Second, all class functions must be self-sufficient, they should NOT rely on
> some external global variable to work. That might sound C++ese but no matter
> how I don't like C++ it does many things right.

We don't use C++ here, and we are not that strict if it allows for
smaller code or solves other problems.


> I can call a member function for any adapter directly if needed with
> adap[N]->function(). You can NOT because in your case that "N" does not have
> any effect and your functions rely on an external global variable that you
> can not change.

Regards from the rat race. I am really tired of that.

It makes no sense to continue this discussion with you when  you  are
not  willing  to  even  discuss  the  possibility  of  an alternative
implementation that allows for a  (writable!)  global  variable,  and
then  you  continue  claiming  we  could  not  use writable variables
(especially when we will not even require it because  we  don;t  need
bus switching before relocation).

There are better things I can do in my spare time.


> That's a separate issue. I can offer N other ways to achieve this other than
> using that horror. And if they use the same binary image for different
> boards those boards are not different. If they put a chip on different bus
> that means the hardware is different. Different hardware means quite a
> lengthy process involving changes to the schematics, then re-layout, new set
> of gerbers, new PCBs, new BOM, new P&P programs etc. Such an effort
> definitely deserves a separate config file and simple repompile of U-Boot
> that takes less than a minute time.

Do you  know  which  effort  is  involved  in  maintaining  different
software  versions  in  a big project? It is a BIG win if you can use
the same binary image on many differen board configurations.

And who tells you that that allthe I2C busses and devices are on one
board? There is things like backplanes that connect boards, where
different boards in differnt configfurations may be inserted or
removed and ... and ... 

Please get a clue before making such statements!

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
Egotist: A person of low taste, more interested in  himself  than  in
me.                                                  - Ambrose Bierce


More information about the U-Boot mailing list