From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cristian Birsan Date: Mon, 06 Oct 2008 23:33:25 +0300 Subject: [U-Boot] [PATCH] Olimex SAM9-L9260 board support In-Reply-To: <20081006184325.2A2448356976@gemini.denx.de> References: <48EA52DA.2000309@gmail.com> <20081006184325.2A2448356976@gemini.denx.de> Message-ID: <48EA7615.8090706@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 Dear Wolfgang Denk, Thank you for your quick response. >> +#ifdef CONFIG_RESET_PHY_R >> +void reset_phy(void) >> +{ >> +#ifdef CONFIG_MACB >> + /* >> + * Initialize ethernet HW addr prior to starting Linux, >> + * needed for nfsroot >> + */ >> + eth_init(gd->bd); >> +#endif > > Please do NOT do this. It's a violation of the U-Boot design > principles, which clearly say that only such periphereals that are > actually being used by U-Boot shall be initialized, and even if they > are being used, these shall be deactivated after use. > > Carelessly leaving ports or devices in an initialized stated has been > the source for problems too many times before. > > Don't do that. > The above code section is used also in other ATMEL boards like at91sam9260ek ( /board/atmel/at91sam9260ek/at91sam9260ek.c ), at91sam9261ek, at91sam9263ek, at91sam9rlek. This is my first patch sent to U-Boot and I used that code as reference. The board that i have (SAM9-L9260 from Olimex ) is close to AT91SAM9260EK from ATMEL. How do you think i can do this the right way? >> +#define ROUND(A, B) (((A) + (B)) & ~((B) - 1)) > > First I think that this is wrong (maybe you need "B-1" instead of "B" > in the first part?), second we already have DIV_ROUND_UP defined in > common.h so please use this. Thanks, good catch. I will fix this and submit a new patch. Best regards, Cristian Birsan