From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Tue, 14 Feb 2006 17:28:11 -0600 Subject: [U-Boot-Users] Peripheral initialization hooks In-Reply-To: <482F3C06ECF00C44AEC226520C6FCB1A51ECB9@EXCHANGEVS.HYPERCOM.COM> References: <482F3C06ECF00C44AEC226520C6FCB1A51ECB9@EXCHANGEVS.HYPERCOM.COM> Message-ID: <43F2678B.7000602@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Steve, Steve Strublic wrote: > I have a PPC852T platform running U-Boot. My platform has the ability > to enable or disable the Ethernet PHY directly, and at boot the PHY is > disabled. It must be enabled, through a register in an FPGA that is > accessed through a separate chip select. > > > > Is it acceptable to modify board_init_r() to include a call to an > enable/disable function that would only apply if my board were defined? > Or are there any hooks for board-specific initializations? > > > > Also, given that this is related to Ethernet, I think it?s best that I > enable the PHY immediately before querying the config for ?ethaddr? in > board_init_r(). Agree/disagree? I personally would stay away modifying common code if there is a way to do it. You surely will make it modifications conditional for your board but still it is a distribution of your board programming logic into other files that are not obvious immediately. What if you enable CONFIG_BOARD_EARLY_INIT_F in your board config file and create a board_early_init_f() that enables all your PHYs and leave it enabled? Unless there is a serious issues with that, I would choose to keep all your PHYs enabled. This assumes that you have initialized your FPGA CS in your board initialization. I use early init to initialize PLL to generate correct frquency for my external serial console clock and a number of other clocks. Tolunay