From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 17 Mar 2008 11:38:44 +0100 Subject: [U-Boot-Users] [PATCH] Add support for hammerhead AVR32 board In-Reply-To: <47DE488E.2060502@miromico.ch> References: <20080314155409.C2DE3247AF@gemini.denx.de> <47DE488E.2060502@miromico.ch> Message-ID: <20080317103844.GC26371@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11:31 Mon 17 Mar , Alex wrote: > Hi > > Sorry, as you might have guessed I did not run MAKEALL to check my patch :-( > Worse, It would have broken existing code... Sorry again. > > I try to avoid such things in future. > > I corrected the patch. I tried to run MAKEALL, but it fails, as I don't have all those cross-compilers > installed. Am I missing something? Do I need to install them, or what is the correct procedure? > > So instead of MAKEALL I compiled a few targets by hand. > > Alex > > > diff -Naur old/u-boot-avr32/board/miromico/hammerhead/eth.c new/u-boot-avr32/board/miromico/hammerhead/eth.c > --- old/u-boot-avr32/board/miromico/hammerhead/eth.c 1970-01-01 01:00:00.000000000 +0100 > +++ new/u-boot-avr32/board/miromico/hammerhead/eth.c 2008-03-14 16:06:35.000000000 +0100 > @@ -0,0 +1,37 @@ > +/* > + * Copyright (C) 2008 Miromico AG > + * > + * Ethernet initialization for the Miromico Hammerhead AVR32 board > + * > + * Mostly copied form Atmel ATNGW100 sources > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > +#include > + > +#include > + > +extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr); > + > +#ifdef CONFIG_CMD_NET Please move this to the Makefile > +void board_eth_initialize(bd_t *bi) > +{ > + macb_eth_initialize(0, (void *)MACB0_BASE, bi->bi_phy_id[0]); > +} > +#endif > diff -Naur old/u-boot-avr32/cpu/at32ap/at32ap700x/gpio.c new/u-boot-avr32/cpu/at32ap/at32ap700x/gpio.c > --- old/u-boot-avr32/cpu/at32ap/at32ap700x/gpio.c 2008-03-17 10:23:49.000000000 +0100 > +++ new/u-boot-avr32/cpu/at32ap/at32ap700x/gpio.c 2008-03-17 10:10:37.000000000 +0100 > @@ -142,3 +142,14 @@ > gpio_select_periph_A(GPIO_PIN_PA15, 0); /* DATA3 */ > } > #endif > + > +#ifdef CONFIG_HAMMERHEAD > +/* > + * Hammerhead board uses GCLK3 (Periph A on PB29) as 25MHz clock output > + * for ethernet PHY. > + */ > +void gpio_enable_gclk3(void) > +{ > + gpio_select_periph_A(GPIO_PIN_PB29, 0); /* GCLK3 */ > +} > +#endif I'll prefer a weak function > diff -Naur old/u-boot-avr32/cpu/at32ap/cpu.c new/u-boot-avr32/cpu/at32ap/cpu.c > --- old/u-boot-avr32/cpu/at32ap/cpu.c 2008-03-17 10:23:49.000000000 +0100 > +++ new/u-boot-avr32/cpu/at32ap/cpu.c 2008-03-14 15:43:09.000000000 +0100 > @@ -81,6 +81,16 @@ > #endif > } > > +#ifdef CONFIG_HAMMERHEAD > +static void gclk_init(void) same I'll prefer a weak function > +{ > + /* Hammerhead boards uses GCLK3 as 25MHz output to ethernet PHY */ > + > + /* Enable GCLK3 with no input divider, from OSC0 (crystal) */ > + sm_writel( PM_GCCTRL3, SM_BIT(CEN) ); > +} > +#endif > + Best Regards, J.