Add support for the hammerhead (AVR32) board
Subsystems (2)
Hi
This patch adds support for our new hammerhead (AVR32) board.
Thanks & best rgds.
Julien May
PATCH 1/1 Add support for the hammerhead (AVR32) board
--- MAKEALL | 1 + Makefile | 3 + board/miromico/hammerhead/Makefile | 40 +++++++ board/miromico/hammerhead/config.mk | 3 + board/miromico/hammerhead/eth.c | 37 ++++++ board/miromico/hammerhead/hammerhead.c | 105 +++++++++++++++++ board/miromico/hammerhead/u-boot.lds | 73 ++++++++++++ cpu/at32ap/at32ap700x/gpio.c | 11 ++ cpu/at32ap/at32ap700x/sm.h | 2 +- cpu/at32ap/cpu.c | 5 + include/asm-avr32/arch-at32ap700x/clk.h | 1 + include/asm-avr32/arch-at32ap700x/gpio.h | 3 + include/configs/hammerhead.h | 179 ++++++++++++++++++++++++++++++ net/eth.c | 4 + 14 files changed, 466 insertions(+), 1 deletions(-) create mode 100644 board/miromico/hammerhead/Makefile create mode 100644 board/miromico/hammerhead/config.mk create mode 100644 board/miromico/hammerhead/eth.c create mode 100644 board/miromico/hammerhead/hammerhead.c create mode 100644 board/miromico/hammerhead/u-boot.lds create mode 100644 include/configs/hammerhead.h
MAKEALL +1 -0
@@ -699,6 +699,7 @@ LIST_avr32=" \ atstk1004 \ atstk1006 \ atngw100 \ + hammerhead \ " #########################################################################
Makefile +3 -0
@@ -2885,6 +2885,9 @@ atstk1006_config : unconfig atngw100_config : unconfig @$(MKCONFIG) $(@:_config=) avr32 at32ap atngw100 atmel at32ap700x +hammerhead_config : unconfig + @$(MKCONFIG) $(@:_config=) avr32 at32ap hammerhead miromico at32ap700x + ######################################################################### ######################################################################### #########################################################################
board/miromico/hammerhead/Makefile new file +40 -0
@@ -0,0 +1,40 @@ +# +# Copyright (C) 2008 Miromico AG +# +# 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 $(TOPDIR)/config.mk + +LIB := $(obj)lib$(BOARD).a + +COBJS := $(BOARD).o eth.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
board/miromico/hammerhead/config.mk new file +3 -0
@@ -0,0 +1,3 @@ +TEXT_BASE = 0x00000000 +PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections +PLATFORM_LDFLAGS += --gc-sections
board/miromico/hammerhead/eth.c new file +37 -0
@@ -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 <common.h> + +#include <asm/arch/memory-map.h> + +extern int macb_eth_initialize (int id,void *regs,unsigned int phy_addr); + +#ifdef CONFIG_CMD_NET +void board_eth_initialize (bd_t *bi) +{ +macb_eth_initialize (0 , (void *)MACB0_BASE , bi->bi_phy_id[0 ]); +} +#endif
board/miromico/hammerhead/hammerhead.c new file +105 -0
105 lines not on this page · raw message
board/miromico/hammerhead/u-boot.lds new file +73 -0
73 lines not on this page · raw message
cpu/at32ap/at32ap700x/gpio.c +11 -0
@@ -142,3 +142,14 @@ void gpio_enable_mmci(void) gpio_select_periph_A(GPIO_PIN_PA15, 0); /* DATA3 */ }#endif + +/* +* 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 */ +} + +void gpio_enable_gclk3 (void ) __attribute__((weak,alias ("__gpio_enable_gclk3" )));
cpu/at32ap/at32ap700x/sm.h +1 -1
@@ -21,7 +21,7 @@#define SM_PM_IMR 0x0048#define SM_PM_ISR 0x004c#define SM_PM_ICR 0x0050 -#define SM_PM_GCCTRL 0x0060 +#define SM_PM_GCCTRL (x) (0x0060 + 4 * x)#define SM_RTC_CTRL 0x0080#define SM_RTC_VAL 0x0084#define SM_RTC_TOP 0x0088
cpu/at32ap/cpu.c +5 -0
@@ -65,6 +65,11 @@ int cpu_init(void)sysreg_write (EVBA , (unsigned long )&_evba); asmvolatile ("csrf %0" : :"i" (SYSREG_EM_OFFSET )); +if (gclk_init) + { +gclk_init (); + } +return 0 ; }
include/asm-avr32/arch-at32ap700x/clk.h +1 -0
@@ -76,6 +76,7 @@ static inline unsigned long get_mci_clk_rate(void)#endif extern void clk_init (void ); +extern void gclk_init (void ) __attribute__((weak));/* Board code may need the SDRAM base clock as a compile-time constant */ #define SDRAMC_BUS_HZ (MAIN_CLK_RATE >> CFG_CLKDIV_HSB)
include/asm-avr32/arch-at32ap700x/gpio.h +3 -0
@@ -216,5 +216,8 @@ void gpio_enable_macb1(void);#ifdef AT32AP700x_CHIP_HAS_MMCIvoid gpio_enable_mmci (void );#endif +#ifdef CONFIG_HAMMERHEAD +void gpio_enable_gclk3 (void ); +#endif #endif /* __ASM_AVR32_ARCH_GPIO_H__ */
include/configs/hammerhead.h new file +179 -0
179 lines not on this page · raw message
net/eth.c +4 -0
@@ -65,6 +65,7 @@ extern int atngw100_eth_initialize(bd_t *);extern int mcffec_initialize (bd_t *);extern int mcdmafec_initialize (bd_t *);extern int at91sam9_eth_initialize (bd_t *); +extern int board_eth_initialize (bd_t *);#ifdef CONFIG_API extern void (*push_packet)(volatile void *,int );
@@ -291,6 +292,9 @@ int eth_initialize(bd_t *bis)#if defined(CONFIG_AT91CAP9 ) || defined(CONFIG_AT91SAM9260 )at91sam9_eth_initialize (bis);#endif +#if defined(CONFIG_HAMMERHEAD ) +board_eth_initialize (bis); +#endif if (!eth_devices) {puts ("No ethernet found.\n" );
Signature · 1 line
1.5.5.GIT
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 6 lines · Julien May
MAKEALL | 1 + Makefile | 3 + board/miromico/hammerhead/Makefile | 40 +++++++ board/miromico/hammerhead/config.mk | 3 + board/miromico/hammerhead/eth.c | 37 ++++++ board/miromico/hammerhead/hammerhead.c | 105 +++++++++++++++++
Quoted 8 lines
board/miromico/hammerhead/u-boot.lds | 73 ++++++++++++ cpu/at32ap/at32ap700x/gpio.c | 11 ++ cpu/at32ap/at32ap700x/sm.h | 2 +- cpu/at32ap/cpu.c | 5 + include/asm-avr32/arch-at32ap700x/clk.h | 1 + include/asm-avr32/arch-at32ap700x/gpio.h | 3 + include/configs/hammerhead.h | 179 ++++++++++++++++++++++++++++++ net/eth.c | 4 +
I was just going to rebase and fold the hammerhead patch to prepare it for the next merge window when I noticed that MAINTAINERS isn't updated.
Can you send me a patch adding yourself to MAINTAINERS, assuming you're the one that will be maintaining this board?
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Hi & welcome back from holiday :)
According to your request...
- Julien
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 1 line · Julien May
Hi & welcome back from holiday :)
Thanks :)
Quoted 1 line
According to your request...
This was rather more than I asked for, and it didn't apply to the hammerhead branch I already had.
After resolving the conflicts, I ended up with just a change to MAINTAINERS, so I've committed only that part. The rest is already there (except the net/eth.c stuff which shouldn't be necessary anymore after Ben's patch hit mainline)
Could you have a look at the result at
git://git.denx.de/u-boot-avr32.git hammerhead
If it looks ok to you (and still works), I'll fold it all into a single patch tomorrow. The commit messages are somewhat bogus...I'll fix it up at the same time.
Haavard
PATCH 1/1 Set GD_FLG_RELOC for boards skipping relocation to RAM
when would you not want to relocate ?
my understanding was when the bootldr come up it first runs the monitor and then relocates to ram and shoots off from there. right ?
any clarification would be appreciated. TIA !
Quoted 67 lines
Date: Tue, 22 Jul 2008 14:20:15 +0200
From: linux at bohmer.net
To: u-boot-users at lists.sourceforge.net; wd at denx.de
CC: joakim.tjernlund at transmode.se
Subject: [U-Boot-Users] [patch 1/1] SetGD_FLG_RELOCfor boards skipping relocation to RAMIf
CONFIG_SKIP_RELOCATE_UBOOTis set the flagGD_FLG_RELOCis usually never set, because relocation to RAM is actually never done by U-boot itself. However, several pieces of code check if this flag is set at some time.So, to make sure this flag is set on boards skipping relocation, this is added to the initialisation of U-boot at a moment where it is safe to do so.
Signed-off-by Remy Bohmer <[email protected]>---
lib_arm/board.c| 16 ++++++++++++++++1 file changed, 16 insertions(+)Index:
u-boot-git-almost-1.3.4/lib_arm/board.c
===================================================================lib_arm/board.c 2008-07-21 12:25:32.000000000 +0200 renamed from lib_arm/board.c 2008-07-21 11:53:23.000000000 +0200 +11
-0@@ -233,6 +233,17 @@ static int init_func_i2c (void) } #endif +#ifdef CONFIG_SKIP_RELOCATE_UBOOT +/* + * This routine sets the relocation done flag, because even if + * relocation is skipped, the flag is used by other generic code. + */ +static int reloc_init(void) +{ + gd->flags |= GD_FLG_RELOC; +} +#endif + /* * Breathe some life into the board... *@@ -262,6 +273,11 @@ int print_cpuinfo (void); /* test-only * init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */lib_arm/board.c 2008-07-21 12:25:32.000000000 +0200 renamed from lib_arm/board.c 2008-07-21 11:53:23.000000000 +0200 +5
-0+#if defined(CONFIG_SKIP_RELOCATE_UBOOT) + reloc_init, /* Set the relocation done flag, must + do this AFTER cpu_init(), but as soon + as possible */ +#endif
board_init, /* basic board dependent setup */interrupt_init, /* set up exceptions */env_init, /* initialize environment */--
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
PATCH 1/1 Set GD_FLG_RELOC for boardsskipping relocation to RAM
Quoted 1 line · u-boot-users-bounces at lists.sourceforge.net
when would you not want to relocate ?
Hi,
On some platforms U-Boot is loaded from flash to RAM memory by a ROM bootloader.
Hugo V.
Hugo Villeneuve
Hardware developer | Concepteur mat?riel
Lyrtech
Phone/T?l. : (1) (418) 877-4644 #2395
Toll-free/Sans frais - Canada & USA : (1) (888) 922-4644 #2395 Fax/T?l?c. : (1) (418) 877-7710
www.lyrtech.com
Infinite possibilities...TM
PATCH 1/1 Add support for the hammerhead (AVR32) board
In reply to Haavard SkinnemoenQuoted 15 lines · Haavard Skinnemoen
Quoted 1 line · Julien May
Hi & welcome back from holiday :)
Thanks :)
Quoted 1 line
According to your request...
This was rather more than I asked for, and it didn't apply to the hammerhead branch I already had.
After resolving the conflicts, I ended up with just a change to
MAINTAINERS, so I've committed only that part. The rest is already there (except thenet/eth.cstuff which shouldn't be necessary anymore after Ben's patch hit mainline)
Quoted 7 lines
Could you have a look at the result at
git://git.denx.de/u-boot-avr32.githammerheadIf it looks ok to you (and still works), I'll fold it all into a single patch tomorrow. The commit messages are somewhat bogus...I'll fix it up at the same time.
Currently I even cannot compile it, due to some not only to our board related errors. I'll check them and give you feedback asap or not later than tomorrow.
- Julien
Quoted 3 lines
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 3 lines · Julien May
Currently I even cannot compile it, due to some not only to our board related errors. I'll check them and give you feedback asap or not later than tomorrow.
Oh...right. I did fix those, but I forgot to pull them in.
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 6 lines · Haavard Skinnemoen
Quoted 3 lines · Julien May
Currently I even cannot compile it, due to some not only to our board related errors. I'll check them and give you feedback asap or not later than tomorrow.
Oh...right. I did fix those, but I forgot to pull them in.
Done. I've also applied a couple of other fixes due to recent API changes, so it should at least build now.
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 10 lines · Haavard Skinnemoen
Quoted 6 lines · Haavard Skinnemoen
Quoted 3 lines · Julien May
Currently I even cannot compile it, due to some not only to our board related errors. I'll check them and give you feedback asap or not later than tomorrow.
Oh...right. I did fix those, but I forgot to pull them in.
Done. I've also applied a couple of other fixes due to recent API changes, so it should at least build now.
Ah great!
Are those already committed to your hammerhead branch? Right now I couldn't pull anything new.
Maybe you can check those in so that I can pull and test the u-boot.
- Julien
Quoted 3 lines
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 10 lines · Julien May
Quoted 2 lines · Haavard Skinnemoen
Done. I've also applied a couple of other fixes due to recent API changes, so it should at least build now.
Ah great!
Are those already committed to your hammerhead branch? Right now I couldn't pull anything new.
Maybe you can check those in so that I can pull and test the u-boot.
Hmm...they _should_ be there:
hskinnemoen at hskinnemo-gx745:~/work/u-boot/hammerhead$ git remote show avr32
* remote avr32
URL: git://git.denx.de/u-boot-avr32.git
Tracked remote branches
atmel-1.3.0 atmel-1.3.1 format-warnings hammerhead master spiflash stk1000-lcd
hskinnemoen at hskinnemo-gx745:~/work/u-boot/hammerhead$ git show --stat avr32/hammerhead commit 50ca883c61c88f463fc4d8e635b7aa195fffdb65
Author: Haavard Skinnemoen <[email protected]> Date: Thu Jul 24 09:44:01 2008 +0200
hammerhead: Define CONFIG_ATMEL_MCI
Since the MMC driver was moved into drivers/mmc, you now need to define CONFIG_ATMEL_MCI in addition to CONFIG_MMC to include it.
include/configs/hammerhead.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
I am currently having problems in initializing the eth.
in net/eth.c the following is defined
static int __def_eth_init(bd_t *bis)
{
return -1;
}int cpu_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init"))); int board_eth_init(bd_t *bis) __attribute((weak, alias("__def_eth_init")));
this is not calling my implementation of board_eth_init. I see and like the idea behind this but do not understand why my implementation is not getting called...
btw. I did update the implementation function header from void to int.
- Julien
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 8 lines · Julien May
I am currently having problems in initializing the eth.
in
net/eth.cthe following is definedstatic int
__def_eth_init(bd_t *bis){ return -1; }
Quoted 6 lines
int
cpu_eth_init(bd_t *bis)__attribute((weak, alias("__def_eth_init"))); intboard_eth_init(bd_t *bis)__attribute((weak, alias("__def_eth_init")));this is not calling my implementation of
board_eth_init. I see and like the idea behind this but do not understand why my implementation is not getting called...
Hmm, that's probably the "weak functions cannot be overriden by functions defined in their own file" crap that was discussed earlier. Can you try moving board_eth_init() into hammerhead.c?
Which reminds me...Ben posted a patch which did that for all the existing avr32 boards. I should probably apply it.
Quoted 1 line
btw. I did update the implementation function header from void to int.
Yeah, that's probably a good idea too :-)
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 12 lines · Haavard Skinnemoen
Quoted 11 lines · Julien May
I am currently having problems in initializing the eth.
in
net/eth.cthe following is definedstatic int
__def_eth_init(bd_t *bis){ return -1; }int
cpu_eth_init(bd_t *bis)__attribute((weak, alias("__def_eth_init"))); intboard_eth_init(bd_t *bis)__attribute((weak, alias("__def_eth_init")));
Quoted 7 lines
Quoted 3 lines
this is not calling my implementation of
board_eth_init. I see and like the idea behind this but do not understand why my implementation is not getting called...Hmm, that's probably the "weak functions cannot be overriden by functions defined in their own file" crap that was discussed earlier. Can you try moving
board_eth_init()intohammerhead.c?
Did so and it works now. I could make for this an incremental patch and send this to you.
Quoted 3 lines
Which reminds me...Ben posted a patch which did that for all the existing avr32 boards. I should probably apply it.
Otherwise I wait until you applied bens patch and test again hammerheads functionality in u-boot.
Quoted 7 lines
Quoted 2 lines
btw. I did update the implementation function header from void to int.
Yeah, that's probably a good idea too :-)
Haavard
- Julien
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 6 lines · Julien May
Quoted 3 lines
Hmm, that's probably the "weak functions cannot be overriden by functions defined in their own file" crap that was discussed earlier. Can you try moving
board_eth_init()intohammerhead.c?Did so and it works now. I could make for this an incremental patch and send this to you.
That would be great.
Quoted 5 lines
Quoted 2 lines
Which reminds me...Ben posted a patch which did that for all the existing avr32 boards. I should probably apply it.
Otherwise I wait until you applied bens patch and test again hammerheads functionality in u-boot.
I've applied it, but it doesn't affect hammerhead. It just does the same change you just did to a few other boards.
Haavard
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 7 lines
Quoted 4 lines
Did so and it works now. I could make for this an incremental patch and send this to you.
That would be great.
Please find below the incrementel patch. This patch just fixes the eth stuff of our board. As hopefully understood right the patch from ben sould fix the rest.
- Julien
PATCH 1/1 Add support for the hammerhead (AVR32) board
Quoted 3 lines · Julien May
Please find below the incrementel patch. This patch just fixes the eth stuff of our board. As hopefully understood right the patch from ben sould fix the rest.
Yeah, that should do it, thanks. I think it's time to create a "next" branch for this stuff now.
Haavard
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Add support for the hammerhead (AVR32) board
Could someone explain me what this message has relation with AVR32? This is 100% microblaze relate problems.
Please change subject and cc to me if you have any problem with latest U-BOOT for Microblaze.
Michal Simek
Quoted 74 lines
Hi John,
look at
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/2008/05/msg00163.htmlPlease use
Quoted 46 lines
Hi, again.
I've used a new vendor/platform, I have the uclinux running in the same target a ML501 with an older version based on ise and edk 8.2, but I need approach the advantages of microblaze v7.00 and the PLB. Please thanks for your help, and excuse my English.
I don't know about inittab, and that init is selected in the application menu.
2008/7/24 Mostafa Ali <[email protected]>:
Quoted 33 lines
Look there are so many reasons for this problem, Please mention more detalis(like have you used one of the predefined platforms in the vendor/platform menu or you created a new one).
One of the reasons is that the kernel doesn't find a start up application. Make sure that inittab is exist in /romfs and init is selected in the application menu in petalinux configuration wizard. I need more de tails fro you, I'll be waiting.
--- On *Thu, 7/24/08, John Osorio <[email protected]>* wrote:
From: John Osorio <[email protected]>
Subject: [microblaze-uclinux] Help with kernel boot, PLEASE
To: microblaze-uclinux at itee.uq.edu.au
Date: Thursday, July 24, 2008, 8:36 AMHi, folks
I have a problem with the kernel boot, I'm using petalinux-v0.30-rc1 and kernel 2.6, my hardware is development under EDK 9.2_02 and ISE 9.2_04. When I'll try boot the image, the boot show in kermit the following:
## Booting image at
8c080000...Image Name: PetaLinux Kernel 2.6 Image Type: Microblaze Linux Kernel Image (uncompressed) Data Size: 2678812 Bytes = 2.6 MBLoad Address: 90000000
Entry Point: 90000000
Verifying Checksum ... OK
OKQuoted 14 lines
Quoted 8 lines
That's all I don't know, what's the problem, Please I need your Help, Bye. The boot is freeze, Kermit don't show anything
--
John OsorioSignature · 1 line
John OsorioNo virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.5/1571 - Release Date: 24.7.2008 05:42