[U-Boot-Users] [RFC][PATCH 1/1] Add board_eth_init() function

Haavard Skinnemoen
2008-03-26T11:06:10Z

On Wed, 26 Mar 2008 11:34:08 +0100
Stefan Roese <sr@denx.de> wrote:

> On Wednesday 26 March 2008, Haavard Skinnemoen wrote:
> > > Because on PPC4xx for example, all boards are using exactly the same
> > > eth_init code (for the SoC interfaces). And I don't like adding this code
> > > to more than 80 boards.
> >
> > All 80 boards have exactly the same ethernet interface (i.e. same kind
> > of PHY, same MII address, etc.)?
>
> Yes, same SoC ethernet interfaces. Currently PHY address etc is configured via
> config options.

Judging by the number of #ifdefs in ppc_4xx_eth_initialize, that
function contains quite a bit of board-specific code.

> > Can't you just add a weak definition of board_eth_init() in the CPU
> > code then?
>
> No. The weak definition is already in net/eth.c.

Make it non-weak then. If a platform wants to implement board-specific
ethernet init code as #ifdef hell, it should be free to do so. I don't
think we should add workarounds in the generic code for such platforms
though.

Haavard