From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 26 Mar 2008 12:43:50 +0100 Subject: [U-Boot-Users] [RFC][PATCH 1/1] Add board_eth_init() function In-Reply-To: <20080326120610.71996505@hskinnemo-gx620.norway.atmel.com> References: <200803221114.40956.sr@denx.de> <200803261134.08925.sr@denx.de> <20080326120610.71996505@hskinnemo-gx620.norway.atmel.com> Message-ID: <200803261243.51429.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 26 March 2008, Haavard Skinnemoen wrote: > > 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. Most of it is not board-specific, but platform-specific. This driver handles all 4xx EMAC variants and there are quite a lot. But basically you are correct. > > > 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. In net/eth.c? It can't get overwritten 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. I could use board_eth_init() as a common PPC4xx platform code. But I would loose the chance being able to implement a "real" board specific board_eth_init() for some boards in the future then. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================