From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Mon, 05 Oct 2009 13:18:46 -0700 Subject: [U-Boot] [PATCH 2/3 v3] Add bb_miiphy_init call before any ethernet bring-up code. In-Reply-To: References: <1253711456-6309-1-git-send-email-luigi.mantellini.ml@gmail.com> <1253711456-6309-2-git-send-email-luigi.mantellini.ml@gmail.com> <1253711456-6309-3-git-send-email-luigi.mantellini.ml@gmail.com> <4AC99282.50402@gmail.com> Message-ID: <4ACA54A6.7050609@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Luigi Mantellini wrote: > The lib_[arch]/board.c code calls the bb_miiphy_init that will do just 2 things: > > 1) Relocate the bb_mii_buses[i].* hooks (.init, .mdio_active, .delay, ...) > 2) Call the board bb_mii_buses[i].init (board specific code). > > The board specifc code will be contained into the hook .init filed > into the bb_mii_buses vector. > > Do you have a better solution? > > In each case, you put the bb_miiphy_init() right before eth_initialize(). One of the first things eth_initialize() does is call board_eth_init(). Moving the call to each board's specific code would therefore not make any difference code-wise, but IMHO is architecturally cleaner. If #ifdef's are necessary (in this case they are), I believe it's better to have them in the more specific code (board) than generic (arch). regards, Ben