Skip to contentSkip to conversation

Add support for AT91CAP9 cpu and AT91CAP9A-DK board

PATCH New Stelian Pop 2 participants 6 messages Jan 16, 2008 – Jan 18, 2008

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Add support for AT91CAP9 cpu and AT91CAP9A-DK board

[Repost: previous patch was too big for the mailing list, let's try again...]

Hi,

The patch below adds support for Atmel's AT91CAP9 Customizable Microcontrollers family:
http://www.atmel.com/products/AT91CAP/Default.asp
and more specifically for the AT91CAP9A-DK development kit:

	http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138

The supported features include:
- SDRAM
- Serial port DBGU
- LEDs
- SPI
- NOR Flash
- NAND Flash with ECC soft
- DataFlash (through SPI)
- Ethernet

This patch is to be applied on top of my three small patches I submitted yesterday:

	http://article.gmane.org/gmane.comp.boot-loaders.u-boot/35306
	http://article.gmane.org/gmane.comp.boot-loaders.u-boot/35307
	http://article.gmane.org/gmane.comp.boot-loaders.u-boot/35309

For size reasons, the patch has been hand edited, splitted in several chunks, and the AT91CAP9.h file (440 kB !) is not in the patch at all. Please download the full version from:

	http://www.popies.net/tmp/uboot-at91cap9-full.patch

instead.

Comments are welcomed.

---
 CREDITS                                  |    4 +
 MAKEALL                                  |    1 +
 Makefile                                 |    3 +
 board/at91cap9adk/Makefile               |   50 +
 board/at91cap9adk/at91cap9adk.c          |  273 ++
 board/at91cap9adk/config.mk              |    1 +
 board/at91cap9adk/led.c                  |   79 +
 board/at91cap9adk/nand.c                 |   63 +
 board/at91cap9adk/u-boot.lds             |   57 +
 cpu/arm926ejs/at91cap9/Makefile          |   46 +
 cpu/arm926ejs/at91cap9/config.mk         |    5 +
 cpu/arm926ejs/at91cap9/ether.c           |   35 +
 cpu/arm926ejs/at91cap9/lowlevel_init.S   |   43 +
 cpu/arm926ejs/at91cap9/serial.c          |  107 +
 cpu/arm926ejs/at91cap9/spi.c             |  125 +
 cpu/arm926ejs/at91cap9/timer.c           |  165 +
 cpu/arm926ejs/at91cap9/usb.c             |   64 +
 cpu/arm926ejs/interrupts.c               |    2 +-
 cpu/arm926ejs/start.S                    |    3 +
 drivers/mtd/dataflash.c                  |    4 +-
 drivers/net/macb.c                       |    8 +
 drivers/net/macb.h                       |    6 +
 include/asm-arm/arch-at91cap9/AT91CAP9.h | 5594 ++++++++++++++++++++++++++++++
 include/asm-arm/arch-at91cap9/clk.h      |   34 +
 include/asm-arm/arch-at91cap9/hardware.h |   38 +
 include/asm-arm/dma-mapping.h            |   50 +
 include/asm-arm/mach-types.h             |   15 +
 include/configs/at91cap9adk.h            |  234 ++
 net/eth.c                                |    4 +
 29 files changed, 7110 insertions(+), 3 deletions(-)
 create mode 100644 board/at91cap9adk/Makefile
 create mode 100644 board/at91cap9adk/at91cap9adk.c
 create mode 100644 board/at91cap9adk/config.mk
 create mode 100644 board/at91cap9adk/led.c
 create mode 100644 board/at91cap9adk/nand.c
 create mode 100644 board/at91cap9adk/u-boot.lds
 create mode 100644 cpu/arm926ejs/at91cap9/Makefile
 create mode 100644 cpu/arm926ejs/at91cap9/config.mk
 create mode 100644 cpu/arm926ejs/at91cap9/ether.c
 create mode 100644 cpu/arm926ejs/at91cap9/lowlevel_init.S
 create mode 100644 cpu/arm926ejs/at91cap9/serial.c
 create mode 100644 cpu/arm926ejs/at91cap9/spi.c
 create mode 100644 cpu/arm926ejs/at91cap9/timer.c
 create mode 100644 cpu/arm926ejs/at91cap9/usb.c
 create mode 100644 include/asm-arm/arch-at91cap9/AT91CAP9.h
 create mode 100644 include/asm-arm/arch-at91cap9/clk.h
 create mode 100644 include/asm-arm/arch-at91cap9/hardware.h
 create mode 100644 include/asm-arm/dma-mapping.h
 create mode 100644 include/configs/at91cap9adk.h
Signature · 1 line
Stelian Pop <[email protected]>
#1 lore raw

PATCH 1/3 Add support for AT91CAP9 cpu and AT91CAP9A-DK board

cpu/* parts of the patch.

cpu/arm926ejs/at91cap9/Makefile new file +46 -0
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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$(SOC).a
+
+COBJS	= ether.o serial.o timer.o spi.o usb.o
+SOBJS	= lowlevel_init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
cpu/arm926ejs/at91cap9/config.mk new file +5 -0
@@ -0,0 +1,5 @@
+PLATFORM_CPPFLAGS += -march=armv5te
+PLATFORM_CPPFLAGS += $(call cc-option,-mtune=arm926ejs,)
+# gcc version 4.2.1 (CodeSourcery Sourcery G++ Lite 2007q3-51) has some issues
+# with -Os: net/net.c:NetReceive() gets miscompiled. Switch to -O2 for now.
+PLATFORM_CPPFLAGS += -O2
cpu/arm926ejs/at91cap9/ether.c new file +35 -0
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2007
+ * Stelian Pop <[email protected]>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * 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/AT91CAP9.h>
+
+extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
+
+#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
+void at91cap9_eth_initialize(bd_t *bi)
+{
+	macb_eth_initialize(0, (void *)AT91C_BASE_MACB, 0x00);
+}
+#endif
cpu/arm926ejs/at91cap9/lowlevel_init.S new file +43 -0

43 lines not on this page · raw message

cpu/arm926ejs/at91cap9/serial.c new file +107 -0

107 lines not on this page · raw message

cpu/arm926ejs/at91cap9/spi.c new file +125 -0

125 lines not on this page · raw message

cpu/arm926ejs/at91cap9/timer.c new file +165 -0

165 lines not on this page · raw message

cpu/arm926ejs/at91cap9/usb.c new file +64 -0

64 lines not on this page · raw message

cpu/arm926ejs/interrupts.c +1 -1
@@ -172,7 +172,7 @@ void do_irq (struct pt_regs *pt_regs)
 	bad_mode ();
 }
 
-#ifdef CONFIG_INTEGRATOR
+#if defined(CONFIG_INTEGRATOR) || defined(CONFIG_AT91CAP9ADK)
 
 	/* Timer functionality supplied by Integrator board (AP or CP) */
 
cpu/arm926ejs/start.S +3 -0
@@ -182,6 +182,9 @@ clbss_l:str	r2, [r0]		/* clear loop...                    */
 	cmp	r0, r1
 	ble	clbss_l
 
+	bl coloured_LED_init
+	bl red_LED_on
+
 	ldr	pc, _start_armboot
 
 _start_armboot:
Signature · 1 line
Stelian Pop <[email protected]>
#2 lore raw

PATCH 2/3 Add support for AT91CAP9 cpu and AT91CAP9A-DK board

In reply to Stelian Pop

board/* parts of the patch.

board/at91cap9adk/Makefile new file +50 -0
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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	:= at91cap9adk.o led.o nand.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+	rm -f $(SOBJS) $(OBJS)
+
+distclean:	clean
+	rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/at91cap9adk/at91cap9adk.c new file +273 -0

273 lines not on this page · raw message

board/at91cap9adk/config.mk new file +1 -0
@@ -0,0 +1 @@
+TEXT_BASE = 0x73000000
board/at91cap9adk/led.c new file +79 -0

79 lines not on this page · raw message

board/at91cap9adk/nand.c new file +63 -0

63 lines not on this page · raw message

board/at91cap9adk/u-boot.lds new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
Stelian Pop <[email protected]>
#3 lore raw

PATCH 3/3 Add support for AT91CAP9 cpu and AT91CAP9A-DK board

In reply to Stelian Pop

other parts of the patch.

CREDITS +4 -0
index 1130c9e..a07d842 100644
@@ -391,6 +391,10 @@ E: dan.poirot at windriver.com
 D: Support for the Wind River sbc405, sbc8240 board
 W: http://www.windriver.com
 
+N: Stelian Pop
+E: stelian.pop at leadtechdesign.com
+D: Atmel AT91CAP9ADK support
+
 N: Stefan Roese
 E: sr at denx.de
 D: AMCC PPC4xx Support
MAKEALL +1 -0
index bec3541..e653380 100755
@@ -443,6 +443,7 @@ LIST_ARM7="		\
 #########################################################################
 
 LIST_ARM9="			\
+	at91cap9adk		\
 	at91rm9200dk		\
 	cmc_pu2			\
 	ap920t			\
Makefile +3 -0
index 8a888b9..b7684df 100644
@@ -2206,6 +2206,9 @@ xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$
 
 xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
 
+at91cap9adk_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk NULL at91cap9
+
 at91rm9200dk_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk NULL at91rm9200
 
board/at91cap9adk/Makefile new file +0 -0
new file mode 100644
index 0000000..00db381
board/at91cap9adk/at91cap9adk.c new file +0 -0
new file mode 100644
index 0000000..fd659ff
board/at91cap9adk/config.mk new file +0 -0
new file mode 100644
index 0000000..e241aee
board/at91cap9adk/led.c new file +0 -0
new file mode 100644
index 0000000..9052180
board/at91cap9adk/nand.c new file +0 -0
new file mode 100644
index 0000000..57f4a69
board/at91cap9adk/u-boot.lds new file +0 -0
new file mode 100644
index 0000000..df986d5
cpu/arm926ejs/at91cap9/Makefile new file +0 -0
new file mode 100644
index 0000000..1a103df
cpu/arm926ejs/at91cap9/config.mk new file +0 -0
new file mode 100644
index 0000000..d4565b4
cpu/arm926ejs/at91cap9/ether.c new file +0 -0
new file mode 100644
index 0000000..d398cf8
cpu/arm926ejs/at91cap9/lowlevel_init.S new file +0 -0
new file mode 100644
index 0000000..658ef37
cpu/arm926ejs/at91cap9/serial.c new file +0 -0
new file mode 100644
index 0000000..a39d2e6
cpu/arm926ejs/at91cap9/spi.c new file +0 -0
new file mode 100644
index 0000000..260c50f
cpu/arm926ejs/at91cap9/timer.c new file +0 -0
new file mode 100644
index 0000000..ce20f17
cpu/arm926ejs/at91cap9/usb.c new file +0 -0
new file mode 100644
index 0000000..b6c354f
cpu/arm926ejs/interrupts.c +0 -0
index 9cac969..33da56a 100644
cpu/arm926ejs/start.S +0 -0
index aa09fbf..297efe0 100644
drivers/mtd/dataflash.c +2 -2
index 2421407..81857a4 100644
@@ -36,7 +36,7 @@ struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
 	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
 	{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
 };
-#elif defined(CONFIG_AT91SAM9263EK)
+#elif defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
 struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
 	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
 };
@@ -48,7 +48,7 @@ struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
 #endif
 
 /*define the area offsets*/
-#if defined(CONFIG_AT91SAM9261EK) || defined(CONFIG_AT91SAM9260EK) || defined(CONFIG_AT91SAM9263EK)
+#if defined(CONFIG_AT91SAM9261EK) || defined(CONFIG_AT91SAM9260EK) || defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
 #if	defined(CONFIG_NEW_PARTITION)
 dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
 	{0x00000000,	0x00003FFF, 	FLAG_PROTECT_SET,	0,    		"Bootstrap"},  	/* ROM code */
drivers/net/macb.c +8 -0
index 6657d22..9c98338 100644
@@ -417,10 +417,18 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
 	/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
+#ifdef CONFIG_AT91CAP9ADK
+	macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
+#else
 	macb_writel(macb, USRIO, 0);
+#endif
+#else
+#ifdef CONFIG_AT91CAP9ADK
+	macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
 	macb_writel(macb, USRIO, MACB_BIT(MII));
 #endif
+#endif /* CONFIG_RMII */
 
 	if (!macb_phy_init(macb))
 		return -1;
drivers/net/macb.h +6 -0
index c778e4e..83207e8 100644
@@ -222,6 +222,12 @@
 #define MACB_TX_PAUSE_ZERO_OFFSET		3
 #define MACB_TX_PAUSE_ZERO_SIZE			1
 
+/* Bitfields in USRIO (AT91) */
+#define MACB_RMII_OFFSET                        0
+#define MACB_RMII_SIZE                          1
+#define MACB_CLKEN_OFFSET                       1
+#define MACB_CLKEN_SIZE                         1
+
 /* Bitfields in WOL */
 #define MACB_IP_OFFSET				0
 #define MACB_IP_SIZE				16
include/asm-arm/arch-at91cap9/clk.h new file +34 -0
new file mode 100644
index 0000000..4af44f8
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2007
+ * Stelian Pop <[email protected]>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * 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
+ */
+#ifndef __ASM_ARM_ARCH_CLK_H__
+#define __ASM_ARM_ARCH_CLK_H__
+
+#include <asm/arch/hardware.h>
+
+static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
+{
+	return AT91C_MASTER_CLOCK;
+}
+
+#endif /* __ASM_ARM_ARCH_CLK_H__ */
include/asm-arm/arch-at91cap9/hardware.h new file +38 -0
new file mode 100644
index 0000000..2ffab3a
@@ -0,0 +1,38 @@
+/*
+ * (C) Copyright 2007
+ * Stelian Pop <[email protected]>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * 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
+ */
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#include <asm/sizes.h>
+
+#include "AT91CAP9.h"
+
+/**
+ *  container_of - cast a member of a structure out to the containing structure
+ *
+ *    @ptr:        the pointer to the member.
+ *    @type:       the type of the container struct this is embedded in.
+ *    @member:     the name of the member within the struct.
+ */
+#define container_of(ptr, type, member) ({                      \
+	const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+	(type *)( (char *)__mptr - offsetof(type,member) );})
+
+#endif
include/asm-arm/dma-mapping.h new file +50 -0

50 lines not on this page · raw message

include/asm-arm/mach-types.h +15 -0
index ef3dd65..b45c8e6 100644
@@ -1362,6 +1362,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_CSB726               1359
 #define MACH_TYPE_TIK27                1360
 #define MACH_TYPE_MX_UC7420            1361
+#define MACH_TYPE_AT91CAP9ADK          1566
 
 #ifdef CONFIG_ARCH_EBSA110
 # ifdef machine_arch_type
@@ -17563,6 +17564,20 @@ extern unsigned int __machine_arch_type;
 # define machine_is_mx_uc7420()	(0)
 #endif
 
+#ifdef CONFIG_MACH_AT91CAP9ADK
+# ifdef machine_arch_type
+#  undef machine_arch_type
+#  define machine_arch_type	__machine_arch_type
+# else
+#  define machine_arch_type	MACH_TYPE_AT91CAP9ADK
+# endif
+# define machine_is_at91cap9adk()	\
+	(machine_arch_type == MACH_TYPE_AT91CAP9ADK)
+#else
+# define machine_is_at91cap9adk()	(0)
+#endif
+
+
 /*
  * These have not yet been registered
  */
include/configs/at91cap9adk.h new file +234 -0

234 lines not on this page · raw message

net/eth.c +4 -0
index 5d9e9c1..6fffa12 100644
@@ -61,6 +61,7 @@ extern int uec_initialize(int);
 extern int bfin_EMAC_initialize(bd_t *);
 extern int atstk1000_eth_initialize(bd_t *);
 extern int mcffec_initialize(bd_t*);
+extern int at91cap9_eth_initialize(bd_t *);
 
 #ifdef CONFIG_API
 extern void (*push_packet)(volatile void *, int);
@@ -272,6 +273,9 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_MCFFEC)
 	mcffec_initialize(bis);
 #endif
+#if defined(CONFIG_AT91CAP9)
+	at91cap9_eth_initialize(bis);
+#endif
 
 	if (!eth_devices) {
 		puts ("No ethernet found.\n");
Signature · 5 lines
1.5.3.3


-- 
Stelian Pop <[email protected]>
#4 lore raw

PATCH 3/3 Add support for AT91CAP9 cpu and AT91CAP9A-DK board

Quoted 30 lines · On Wed, 16 Jan 2008 11:38:17 +0100 Stelian Pop <[email protected]> wrote:
drivers/net/macb.c +8 -0
index 6657d22..9c98338 100644
@@ -417,10 +417,18 @@ static int macb_init(struct eth_device *netdev,
 bd_t *bd) 
 	/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
+#ifdef CONFIG_AT91CAP9ADK
+	macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
+#else
 	macb_writel(macb, USRIO, 0);
+#endif
+#else
+#ifdef CONFIG_AT91CAP9ADK
+	macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
 	macb_writel(macb, USRIO, MACB_BIT(MII));
 #endif
+#endif /* CONFIG_RMII */
 
 	if (!macb_phy_init(macb))
 		return -1;
drivers/net/macb.h +0 -0
index c778e4e..83207e8 100644
@@ -222,6 +222,12 @@
 #define MACB_TX_PAUSE_ZERO_OFFSET		3
 #define MACB_TX_PAUSE_ZERO_SIZE			1

drivers/net/macb.h line 233

Quoted 10 lines
drivers/net/macb.h +6 -0
 
+/* Bitfields in USRIO (AT91) */
+#define MACB_RMII_OFFSET                        0
+#define MACB_RMII_SIZE                          1
+#define MACB_CLKEN_OFFSET                       1
+#define MACB_CLKEN_SIZE                         1
+
 /* Bitfields in WOL */
 #define MACB_IP_OFFSET				0
 #define MACB_IP_SIZE				16

Cool, I always was curious about whether post-rm9200 AT91 chips could use this driver too. The changes you've done nicely match the Linux driver, so ACK on this part from me. If you had submitted one patch per driver (aka per logical change ;-) I could have acked a whole patch, not only part of it. If you need to resend, I recommend that you do that, and send them before the actual cpu- and board support; that way they can be applied independently as soon as each one is ready.

We should probably get rid of the CONFIG_RMII symbol at some point, but that might as well go on top of this patch.

Haavard

#5 lore raw

PATCH 3/3 Add support for AT91CAP9 cpu and AT91CAP9A-DK board

Le vendredi 18 janvier 2008 ? 09:45 +0100, Haavard Skinnemoen a ?crit :

Quoted 4 lines
Quoted 1 line · On Wed, 16 Jan 2008 11:38:17 +0100 Stelian Pop <[email protected]> wrote:
drivers/net/macb.c +0 -0

[...]

Quoted 2 lines

Cool, I always was curious about whether post-rm9200 AT91 chips could use this driver too.

There are other avr32 drivers we should be able to use, for example usba.

Quoted 7 lines

The changes you've done nicely match the Linux
driver, so ACK on this part from me. If you had submitted one patch per
driver (aka per logical change ;-) I could have acked a whole patch, not only part of it. If you need to resend, I recommend that you do that, and send them before the actual cpu- and board support; that way they can be applied independently as soon as each one is ready.

Well, the macb changes is the only logical change outside for cpu/ and board/ directories (except for a few #ifdefs in drivers/mtd/dataflash.c...).

Thanks,

Stelian.

Signature · 1 line
Stelian Pop <[email protected]>