[U-Boot] [PATCH v3] net: ll_temac: Add LL TEMAC driver to u-boot

Wolfgang Denk wd at denx.de
Fri Sep 2 14:53:01 CEST 2011


Dear Michal Simek,

In message <4E60B220.6010309 at monstr.eu> you wrote:
> 
> As I see there is still ugly board/xilinx/common folder and ancient enet driver and i2c
> driver.

Indeed, and improvementrs are more than welcome.

> > Actually even this is incorrect - AFAIK Device Control Registers (DCR)
> > exist not on all PPC systems, but only on 4xx (and even there only on
> > some models).  So your code works on a few systems, silently does not
> > do anything on others, and crashes on yet others with an illegal
> > instruction.
> 
> That driver is not definitely for all ppc systems. That IP is available just for
> Xilinx FPGA where can be possible to use it with Microblaze and xilinx ppc440 (maybe ppc405).
> That DCR handling, which is implemented in this driver, fits to xilinx ppc440 implementation.
> Which means that none can add this IP to any other PPC system out of Xilinx FPGA.

So why not use something like CONFIG_440 in this test, and add an
#error for anything else?

Do we actually need this m{f,t}dcr_local() then?

> Sorry I can't see any problem to have driver for specific platform or even to have one driver
> which supports two completely different platform.

My issue is that this code silently breaks or crashes when certain
(undocumented) conditions are not met.  Preventing this seems not to
bee too difficult: add a comment, make it depend on the right CONFIG_
settings, and bail out with a clear error message when conditions are
not met.

As for the other part of the problem - you try to mix two different
cases: one where you refer to an index, and one where you refer to an
address.  This obviously doesn't mix well.  If there is no better way
of doing this, I'd still prefer deriving the index from the offset in
a struct than deriving the address from an offset - the intention is
to enable the compiler to perform type checking, which is impossible
with a typeless base+offset address.

> > I don't want to have this in mainline.
> 
> If this is your decision, I won't send any updated version.

Attempted extortion?

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
"Wagner's music is better than it sounds."               - Mark Twain


More information about the U-Boot mailing list