Skip to contentSkip to conversation

Add support for the hammerhead (AVR32) board

PATCH New Haavard Skinnemoen 3 participants 5 messages Jul 24, 2008 – Jul 30, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for the hammerhead (AVR32) board

From: Julien May <[email protected]>

The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel. It offers versatile peripherals, such as ethernet, usb device, usb host etc.

The board also incooperates a power supply and is a Power over Ethernet (PoE) Powered Device (PD).

Additonally, a Cyclone III FPGA from Altera is integrated on the board. The FPGA is mapped into the 32-bit AVR memory bus. The FPGA offers two DDR2 SDRAM interfaces, which will cover even the most exceptional need of memory bandwidth. Together with the onboard video decoder the board is ready for video processing.

For more information see: http:///www.miromico.com/hammerhead

[haavard.skinnemoen at atmel.com: various small fixes and adaptions]
---
 MAINTAINERS                             |    5 +
 MAKEALL                                 |    1 +
 Makefile                                |    3 +
 board/miromico/hammerhead/Makefile      |   40 +++++++
 board/miromico/hammerhead/config.mk     |    3 +
 board/miromico/hammerhead/hammerhead.c  |  114 ++++++++++++++++++++
 board/miromico/hammerhead/u-boot.lds    |   73 +++++++++++++
 cpu/at32ap/at32ap700x/sm.h              |    2 +-
 cpu/at32ap/cpu.c                        |    3 +
 include/asm-avr32/arch-at32ap700x/clk.h |    1 +
 include/configs/hammerhead.h            |  172 +++++++++++++++++++++++++++++++
 11 files changed, 416 insertions(+), 1 deletions(-)
 create mode 100644 board/miromico/hammerhead/Makefile
 create mode 100644 board/miromico/hammerhead/config.mk
 create mode 100644 board/miromico/hammerhead/hammerhead.c
 create mode 100644 board/miromico/hammerhead/u-boot.lds
 create mode 100644 include/configs/hammerhead.h
MAINTAINERS +5 -0
index cbe5c47..bcac300 100644
@@ -709,6 +709,11 @@ Haavard Skinnemoen <[email protected]>
 	ATSTK1006	AT32AP7000
 	ATNGW100	AT32AP7000
 
+Alex Raimondi <[email protected]>
+Julien May <[email protected]>
+
+	HAMMERHEAD		AT32AP7000
+
 #########################################################################
 # SuperH Systems:							#
 #									#
MAKEALL +1 -0
index c1a9c60..729ee5d 100755
@@ -715,6 +715,7 @@ LIST_avr32="		\
 	atstk1004	\
 	atstk1006	\
 	atngw100	\
+	hammerhead	\
 "
 
 #########################################################################
Makefile +3 -0
index 369bbd7..5e80a09 100644
@@ -2914,6 +2914,9 @@ atstk1004_config	:	unconfig
 atstk1006_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x
 
+hammerhead_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) avr32 at32ap hammerhead miromico at32ap700x
+
 #========================================================================
 # SH3 (SuperH)
 #========================================================================
board/miromico/hammerhead/Makefile new file +40 -0
new file mode 100644
index 0000000..4b74d16
@@ -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
+
+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
new file mode 100644
index 0000000..9a794e5
@@ -0,0 +1,3 @@
+TEXT_BASE		= 0x00000000
+PLATFORM_RELFLAGS	+= -ffunction-sections -fdata-sections
+PLATFORM_LDFLAGS	+= --gc-sections
board/miromico/hammerhead/hammerhead.c new file +114 -0

114 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/sm.h +1 -1
index 6492c8e..b6e4409 100644
@@ -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 +3 -0
index 0ba8361..1a13702 100644
@@ -65,6 +65,9 @@ int cpu_init(void)
 	sysreg_write(EVBA, (unsigned long)&_evba);
 	asm volatile("csrf	%0" : : "i"(SYSREG_EM_OFFSET));
 
+	if(gclk_init)
+		gclk_init();
+
 	return 0;
 }
 
include/asm-avr32/arch-at32ap700x/clk.h +1 -0
index a9d8431..e9a4fe4 100644
@@ -82,6 +82,7 @@ static inline unsigned long get_spi_clk_rate(unsigned int dev_id)
 #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/configs/hammerhead.h new file +172 -0

172 lines not on this page · raw message

Signature · 1 line
1.5.6.2
#1 lore raw

PATCH 1/1 Add support for the hammerhead (AVR32) board

Quoted 44 lines · Haavard Skinnemoen

From: Julien May <[email protected]>

The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel. It offers versatile peripherals, such as ethernet, usb device, usb host etc.

The board also incooperates a power supply and is a Power over Ethernet (PoE) Powered Device (PD).

Additonally, a Cyclone III FPGA from Altera is integrated on the board. The FPGA is mapped into the 32-bit AVR memory bus. The FPGA offers two DDR2 SDRAM interfaces, which will cover even the most exceptional need of memory bandwidth. Together with the onboard video decoder the board is ready for video processing.

For more information see: http:///www.miromico.com/hammerhead

[haavard.skinnemoen at atmel.com: various small fixes and adaptions]
---
 MAINTAINERS                             |    5 +
 MAKEALL                                 |    1 +
 Makefile                                |    3 +
 board/miromico/hammerhead/Makefile      |   40 +++++++
 board/miromico/hammerhead/config.mk     |    3 +
 board/miromico/hammerhead/hammerhead.c  |  114 ++++++++++++++++++++
 board/miromico/hammerhead/u-boot.lds    |   73 +++++++++++++
 cpu/at32ap/at32ap700x/sm.h              |    2 +-
 cpu/at32ap/cpu.c                        |    3 +
 include/asm-avr32/arch-at32ap700x/clk.h |    1 +
 include/configs/hammerhead.h            |  172 +++++++++++++++++++++++++++++++
 11 files changed, 416 insertions(+), 1 deletions(-)
 create mode 100644 board/miromico/hammerhead/Makefile
 create mode 100644 board/miromico/hammerhead/config.mk
 create mode 100644 board/miromico/hammerhead/hammerhead.c
 create mode 100644 board/miromico/hammerhead/u-boot.lds
 create mode 100644 include/configs/hammerhead.h
MAINTAINERS +0 -0
index cbe5c47..bcac300 100644

MAINTAINERS Haavard Skinnemoen <[email protected]> · line 713

Quoted 5 lines
MAINTAINERS +2 -0
@@ -709,6 +709,11 @@ Haavard Skinnemoen <[email protected]>
 	ATSTK1006	AT32AP7000
 	ATNGW100	AT32AP7000
 
+Alex Raimondi <[email protected]>
+Julien May <[email protected]>

IMHO, it's supposed to have only one board Maintainer

Quoted 12 lines
MAINTAINERS +3 -0
+
+	HAMMERHEAD		AT32AP7000
+
 #########################################################################
 # SuperH Systems:							#
 #									#
cpu/at32ap/at32ap700x/sm.h +0 -0
index 6492c8e..b6e4409 100644

cpu/at32ap/at32ap700x/sm.h line 24

Quoted 5 lines
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)

why do you modify? As I see it's never used.

cpu/at32ap/at32ap700x/sm.h line 27

Quoted 3 lines
cpu/at32ap/at32ap700x/sm.h +0 -0
 #define SM_RTC_CTRL				0x0080
 #define SM_RTC_VAL				0x0084
 #define SM_RTC_TOP				0x0088

Best Regards,
J.

#2 lore raw

PATCH 1/1 Add support for the hammerhead (AVR32) board

Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines · Haavard Skinnemoen
MAINTAINERS +0 -0
index cbe5c47..bcac300 100644
@@ -709,6 +709,11 @@ Haavard Skinnemoen <[email protected]>
 	ATSTK1006	AT32AP7000
 	ATNGW100	AT32AP7000
 
Quoted 3 lines

MAINTAINERS Haavard Skinnemoen <[email protected]> · line 713

Quoted 2 lines
MAINTAINERS +2 -0
+Alex Raimondi <[email protected]>
+Julien May <[email protected]>

IMHO, it's supposed to have only one board Maintainer

Doesn't hurt with two, does it? Many Linux subsystems have several maintainers.

Quoted 3 lines

MAINTAINERS Haavard Skinnemoen <[email protected]> · line 714

Quoted 2 lines
MAINTAINERS +1 -1
-#define SM_PM_GCCTRL				0x0060
+#define SM_PM_GCCTRL(x)				(0x0060 + 4 * x)

why do you modify? As I see it's never used.

It is used here:

board/miromico/hammerhead/hammerhead.c line 114

Quoted 10 lines
board/miromico/hammerhead/hammerhead.c new file +10 -0
+void gclk_init(void)
+{
+	/* Hammerhead boards uses GCLK3 as 25MHz output to ethernet PHY */
+
+	/* Select GCLK3 peripheral function */
+	gpio_select_periph_A(GPIO_PIN_PB29, 0);
+
+	/* Enable GCLK3 with no input divider, from OSC0 (crystal) */
+	sm_writel(PM_GCCTRL(3), SM_BIT(CEN));
+}

Haavard

#3 lore raw

PATCH 1/1 Add support for the hammerhead (AVR32) board

In reply to Haavard Skinnemoen
Quoted 5 lines · Haavard Skinnemoen

From: Julien May <[email protected]>

The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel. It offers versatile peripherals, such as ethernet, usb device, usb host etc.

Since I didn't receive any explanation of why it's bad with two maintainers, I've applied this as-is to my 'next' branch:

	git://git.denx.de/u-boot-avr32.git next

I intend this to be a fairly stable branch which will normally not be rebased. Since the patches aren't applied there until they have been fully reviewed, it's unlikely that anything needs fixing once it's been applied.

Mistakes do of course happen, so I'm not saying that I will _never_ rebase the tree, I'm just saying that I will try my best not to.

I'm also going to try out a 'topic branch' strategy so that even if the history does get mangled, the commit IDs of the unaffected topics will be stable as I just re-pull the topic branches after fixing whatever it is that needs fixing. Currently, my tree has two topic branches:
'eth-cleanup' and 'hammerhead', but I expect at least two more boards to join in before the next merge window.

So if you need to pull something from 'next', please try pulling a topic branch as it is more likely to stay stable than the 'next' branch itself.

When the next merge window opens, I'll pull all the topic branches into 'master'. Or perhaps it's better to just pull the 'next' branch. I'm not really sure about this.

I'd appreciate some feedback from other maintainers on whether or not you think this sounds like a good plan.

Haavard

#4 lore raw

PATCH 1/1 Add support for the hammerhead (AVR32) board

Hi

Overall I like the idea of the topic branches and also like the idea behind the next branch, even time will show if the next branch concept will work due to bugfix commits.

A problem I see is that it could be hard for new developers to find out which branch is the branch to choose. It would be great if there is a possibility to get a short description of remote branches so even new developers can get behind your idea by them self and do not have to fill the mailinglist with questions.

But as I am relatively new to git itself the mentioned thing above is already possible and therefore if all of the branches are attached to a short desc. it should all work just fine.

Best rgds.

- Julien

Quoted 40 lines · Haavard Skinnemoen
Quoted 5 lines · Haavard Skinnemoen

From: Julien May <[email protected]>

The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel. It offers versatile peripherals, such as ethernet, usb device, usb host etc.

Since I didn't receive any explanation of why it's bad with two maintainers, I've applied this as-is to my 'next' branch:

	git://git.denx.de/u-boot-avr32.git next

I intend this to be a fairly stable branch which will normally not be rebased. Since the patches aren't applied there until they have been fully reviewed, it's unlikely that anything needs fixing once it's been applied.

Mistakes do of course happen, so I'm not saying that I will _never_ rebase the tree, I'm just saying that I will try my best not to.

I'm also going to try out a 'topic branch' strategy so that even if the history does get mangled, the commit IDs of the unaffected topics will be stable as I just re-pull the topic branches after fixing whatever it is that needs fixing. Currently, my tree has two topic branches:
'eth-cleanup' and 'hammerhead', but I expect at least two more boards to join in before the next merge window.

So if you need to pull something from 'next', please try pulling a topic branch as it is more likely to stay stable than the 'next' branch itself.

When the next merge window opens, I'll pull all the topic branches into 'master'. Or perhaps it's better to just pull the 'next' branch. I'm not really sure about this.

I'd appreciate some feedback from other maintainers on whether or not you think this sounds like a good plan.

Haavard