Skip to contentSkip to conversation

ixp: Support for NSLU2

PATCH New Rod Whitby 4 participants 6 messages Mar 27, 2008 – Mar 31, 2008 Kbuild

lore
Share & tools
lore

Rod Whitby

author
#0 lore raw

PATCH 1/1 ixp: Support for NSLU2

This patch adds support for the Linksys NSLU2.

---
 MAINTAINERS                       |    4 +
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/nslu2/Makefile              |   53 +++++++++
 board/nslu2/config.mk             |    1 +
 board/nslu2/load_sernum_ethaddr.c |   67 +++++++++++
 board/nslu2/nslu2.c               |   96 +++++++++++++++
 board/nslu2/u-boot.lds            |   56 +++++++++
 include/configs/nslu2.h           |  230 +++++++++++++++++++++++++++++++++++++
 lib_arm/board.c                   |    4 +-
 10 files changed, 513 insertions(+), 2 deletions(-)
 create mode 100644 board/nslu2/Makefile
 create mode 100644 board/nslu2/config.mk
 create mode 100644 board/nslu2/load_sernum_ethaddr.c
 create mode 100644 board/nslu2/nslu2.c
 create mode 100644 board/nslu2/u-boot.lds
 create mode 100644 include/configs/nslu2.h
MAINTAINERS +4 -0
Index: u-boot/MAINTAINERS
===================================================================
@@ -564,6 +564,10 @@
 	actux3			xscale
 	actux4			xscale
 
+Rod Whitby <[email protected]>
+
+	nslu2			xscale
+
 #########################################################################
 # x86 Systems:								#
 #									#
MAKEALL +1 -0
Index: u-boot/MAKEALL
===================================================================
@@ -529,6 +529,7 @@
 	actux4		\
 	ixdp425		\
 	ixdpg425	\
+	nslu2		\
 	pdnb3		\
 	scpu		\
 "
Makefile +3 -0
Index: u-boot/Makefile
===================================================================
@@ -2532,6 +2532,9 @@
 ixdpg425_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm ixp ixdp425
 
+nslu2_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm ixp nslu2
+
 lubbock_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm pxa lubbock
 
board/nslu2/Makefile new file +53 -0

53 lines not on this page · raw message

board/nslu2/config.mk new file +1 -0
Index: u-boot/board/nslu2/config.mk
===================================================================
@@ -0,0 +1 @@
+TEXT_BASE = 0x01d00000
board/nslu2/load_sernum_ethaddr.c new file +67 -0

67 lines not on this page · raw message

board/nslu2/nslu2.c new file +96 -0

96 lines not on this page · raw message

board/nslu2/u-boot.lds new file +56 -0

56 lines not on this page · raw message

include/configs/nslu2.h new file +230 -0

230 lines not on this page · raw message

lib_arm/board.c +2 -2
Index: u-boot/lib_arm/board.c
===================================================================
@@ -396,9 +396,9 @@
 
 	devices_init ();	/* get the devices list going. */
 
-#ifdef CONFIG_CMC_PU2
+#if defined(CONFIG_CMC_PU2) || defined (CONFIG_NSLU2)
 	load_sernum_ethaddr ();
-#endif /* CONFIG_CMC_PU2 */
+#endif /* CONFIG_CMC_PU2 || CONFIG_NSLU2 */
 
 	jumptable_init ();
 
#1 lore raw

PATCH 1/1 ixp: Support for NSLU2

Quoted 11 lines

-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Rod Whitby
Sent: 27 March 2008 04:51
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] [PATCH] ixp: Support for NSLU2

This patch adds support for the Linksys NSLU2.

Rod

I just need a Signed-off-by line. Example:

Regards

Peter

author
#2 lore raw

PATCH 1/1 ixp: Support for NSLU2

This patch adds support for the Linksys NSLU2.

---
 MAINTAINERS                       |    4 +
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/nslu2/Makefile              |   53 +++++++++
 board/nslu2/config.mk             |    1 +
 board/nslu2/load_sernum_ethaddr.c |   67 +++++++++++
 board/nslu2/nslu2.c               |   96 +++++++++++++++
 board/nslu2/u-boot.lds            |   56 +++++++++
 include/configs/nslu2.h           |  230 +++++++++++++++++++++++++++++++++++++
 lib_arm/board.c                   |    4 +-
 10 files changed, 513 insertions(+), 2 deletions(-)
 create mode 100644 board/nslu2/Makefile
 create mode 100644 board/nslu2/config.mk
 create mode 100644 board/nslu2/load_sernum_ethaddr.c
 create mode 100644 board/nslu2/nslu2.c
 create mode 100644 board/nslu2/u-boot.lds
 create mode 100644 include/configs/nslu2.h
MAINTAINERS +4 -0
index dc13580..891ae00 100644
@@ -564,6 +564,10 @@ Michael Schwingen <[email protected]>
 	actux3			xscale
 	actux4			xscale
 
+Rod Whitby <[email protected]>
+
+	nslu2			xscale
+
 #########################################################################
 # x86 Systems:								#
 #									#
MAKEALL +1 -0
index 0e1c0cb..2088e78 100755
@@ -529,6 +529,7 @@ LIST_ixp="		\
 	actux4		\
 	ixdp425		\
 	ixdpg425	\
+	nslu2		\
 	pdnb3		\
 	scpu		\
 "
Makefile +3 -0
index 2790865..ec3661e 100644
@@ -2563,6 +2563,9 @@ ixdp425_config	:	unconfig
 ixdpg425_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm ixp ixdp425
 
+nslu2_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm ixp nslu2
+
 lubbock_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm pxa lubbock
 
board/nslu2/Makefile new file +53 -0

53 lines not on this page · raw message

board/nslu2/config.mk new file +1 -0
new file mode 100644
index 0000000..6510cc4
@@ -0,0 +1 @@
+TEXT_BASE = 0x01d00000
board/nslu2/load_sernum_ethaddr.c new file +67 -0

67 lines not on this page · raw message

board/nslu2/nslu2.c new file +96 -0

96 lines not on this page · raw message

board/nslu2/u-boot.lds new file +56 -0

56 lines not on this page · raw message

include/configs/nslu2.h new file +230 -0

230 lines not on this page · raw message

lib_arm/board.c +2 -2
index 22d573a..a388d5d 100644
@@ -396,9 +396,9 @@ void start_armboot (void)
 
 	devices_init ();	/* get the devices list going. */
 
-#ifdef CONFIG_CMC_PU2
+#if defined(CONFIG_CMC_PU2) || defined (CONFIG_NSLU2)
 	load_sernum_ethaddr ();
-#endif /* CONFIG_CMC_PU2 */
+#endif /* CONFIG_CMC_PU2 || CONFIG_NSLU2 */
 
 	jumptable_init ();
 
Signature · 1 line
1.5.2.5
#3 lore raw

PATCH 1/1 ixp: Support for NSLU2

In reply to Peter Pearse
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines

Subject: [U-Boot-Users] [PATCH] ixp: Support for NSLU2

This patch adds support for the Linksys NSLU2.

...

Quoted 1 line

I just need a Signed-off-by line. Example:

Peter, please avoid duplicating efforts: IXP stuff is supposed to be handled by the custodian for the Intel IXP architecture, Jean- Christophe Plagniol-Villard - and he already signalled that he is working on this.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I may be synthetic, but I'm not stupid"  -  the  artificial  person,
from _Aliens_
#4 lore raw

PATCH 1/1 ixp: Support for NSLU2

Quoted 13 lines

-----Original Message-----
From: wd at denx.de [mailto:wd at denx.de]
Sent: 29 March 2008 17:33
To: Peter Pearse
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] [PATCH] ixp: Support for NSLU2

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Subject: [U-Boot-Users] [PATCH] ixp: Support for NSLU2

Quoted 8 lines
Quoted 1 line
Quoted 1 line

This patch adds support for the Linksys NSLU2.

...

Quoted 1 line

I just need a Signed-off-by line. Example:

Peter, please avoid duplicating efforts: IXP stuff is supposed to be handled by the custodian for the Intel IXP architecture, Jean- Christophe Plagniol-Villard - and he already signalled that he is working on this.

Sorry - missed that.

Regards

Peter

Quoted 13 lines

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: 
wd at denx.de "I may be synthetic, but I'm not stupid"  -  the  
artificial  person, from _Aliens_
#5 lore raw

PATCH 1/1 ixp: Support for NSLU2

In reply to Rod Whitby
Quoted 31 lines
board/nslu2/load_sernum_ethaddr.c new file +31 -0
+
+#include <common.h>
+
+/*-----------------------------------------------------------------------
+ * Linksys NSLU2 RedBoot Trailer Block:
+ *
+ * If we boot from RAM on a system which still contains the original
+ * RedBoot bootloader, check if the trailer signature exists and save
+ * the MAC address information it contains.
+ *
+ * 0x3ffb0: six byte binary mac address
+ * 0x3fff8: ' sErCoMm'
+ */
+
+void load_sernum_ethaddr (void)
+{
+	unsigned char *hwi;
+	unsigned char  ethaddr[19]; /* 6 x "%02X", + 1 */
+	unsigned short ih, ie;
+
+	/* Check for signature at the end of RedBoot partition */
+	/* If RedBoot has been replaced, this will not exist. */
+	hwi = (unsigned char *)(CFG_FLASH_BASE + CFG_SERCOMM_OFFSET);
+	if (strncmp((char *)hwi, " sErCoMm", 8)) {
+		return;
+	}
+
+	hwi = (unsigned char *)(CFG_FLASH_BASE + CFG_ETHADDR_OFFSET);
+	ie = 0;
+
+	/* copy MAC address */

board/nslu2/load_sernum_ethaddr.c line 66

Quoted 10 lines
board/nslu2/load_sernum_ethaddr.c new file +10 -0
+	for (ih = 0; ih < 6; ih++) {
+		sprintf((char *)&ethaddr[ie], "%02X:", hwi[ih]);
+		ie += 3;
+	}
+	ethaddr[--ie] = '\0';
+
+	/* set ethaddr if not yet defined */
+	if (getenv("ethaddr") == NULL) {
+		setenv ((char *)"ethaddr", (char *)ethaddr);
+	}

read the mac address only if the getenv return NULL

	/* set ethaddr if not yet defined */
	if (getenv("ethaddr") == NULL) {
		hwi = (unsigned char *)(CFG_FLASH_BASE + CFG_ETHADDR_OFFSET);
		ie = 0;

		/* copy MAC address */
		for (ih = 0; ih < 6; ih++) {
			sprintf((char *)&ethaddr[ie], "%02X:", hwi[ih]);
			ie += 3;
		}
		ethaddr[--ie] = '\0';

		setenv ((char *)"ethaddr", (char *)ethaddr);
	}
Quoted 82 lines

Index: u-boot/board/nslu2/nslu2.c
===================================================================

board/nslu2/nslu2.c new file +77 -0
@@ -0,0 +1,96 @@
+/*
+ * (C) Copyright 2008
+ * Rod Whitby <[email protected]>
+ *
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr at denx.de.
+ *
+ * (C) Copyright 2002
+ * Kyle Harris, Nexus Technologies, Inc. kharris at nexus-tech.net
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <[email protected]>
+ *
+ * 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 <command.h>
+#include <malloc.h>
+#include <asm/arch/ixp425.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+int board_init (void)
+{
+	/* arch number of NSLU2 */
+	gd->bd->bi_arch_number = MACH_TYPE_NSLU2;
+
+	/* adress of boot parameters */
+	gd->bd->bi_boot_params = 0x00000100;
+
+	/*
+	 * Setup GPIO's for PCI interrupts
+	 */
+	GPIO_OUTPUT_DISABLE(CFG_GPIO_PCI_INTA_N);
+	GPIO_INT_ACT_LOW_SET(CFG_GPIO_PCI_INTA_N);
+	GPIO_OUTPUT_DISABLE(CFG_GPIO_PCI_INTB_N);
+	GPIO_INT_ACT_LOW_SET(CFG_GPIO_PCI_INTB_N);
+	GPIO_OUTPUT_DISABLE(CFG_GPIO_PCI_INTC_N);
+	GPIO_INT_ACT_LOW_SET(CFG_GPIO_PCI_INTC_N);
+
+	/*
+	 * Setup GPIO's for 33MHz clock output
+	 */
+	*IXP425_GPIO_GPCLKR = 0x01FF01FF;
+	GPIO_OUTPUT_ENABLE(CFG_GPIO_PCI_CLK);
+	GPIO_OUTPUT_ENABLE(CFG_GPIO_EXTBUS_CLK);
+
+	return 0;
+}
+
+/*
+ * Check Board Identity
+ */
+int checkboard(void)
+{
+	char *s = getenv("serial#");

board/nslu2/nslu2.c line 87

Quoted 10 lines
board/nslu2/nslu2.c new file +10 -0
+
+	puts("Board: NSLU2 - Linksys NSLU2");
+
+	if (s != NULL) {
+		puts(", serial# ");
+		puts(s);
+	}
+	putc('\n');
+
+	return (0);

please choose a style
return 0;
or
return (0);

Quoted 76 lines
board/nslu2/nslu2.c new file +76 -0
+}
+
+int dram_init (void)
+{
+	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+	gd->bd->bi_dram[0].size  = PHYS_SDRAM_1_SIZE;
+
+	return (0);
+}
+#define CONFIG_ENV_OVERWRITE	1	/* Allow changing of the MAC address */
+
+/*
+ * Default Environment
+ */
+#define	CONFIG_EXTRA_ENV_SETTINGS					\
+	"hostname=nslu2\0"						\
+	"setncip=setenv autoload no;dhcp;setenv autoload;"		\
+		"setenv ncip ${serverip}\0"				\
+	"setnc=setenv stdin nc;setenv stdout nc;setenv stderr nc\0"	\
+	"setser=setenv stdin serial;setenv stdout serial;"		\
+		"setenv stderr serial\0"				\
+	"bootfile=/tftpboot/nslu2/uImage\0"				\
+	"rootpath=/tftpboot/nslu2/rootfs\0"				\
+	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
+		"nfsroot=${serverip}:${rootpath}\0"			\
+	"addip=setenv bootargs ${bootargs} "				\
+		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"	\
+		":${hostname}:eth0:off panic=1\0"			\
+	"addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
+	"net_nfs=tftp 10000 ${bootfile};run nfsargs addip addtty;"	\
+		"bootm\0"						\
+	""
+
+/*
+ * Configuration Settings
+ */
+#define CFG_LONGHELP		1		/* undef to save memory		*/
+#define CFG_PROMPT		"=> "	/* Monitor Command Prompt	*/
+
+#define CFG_CBSIZE		256		/* Console I/O Buffer Size	*/
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS		16		/* max number of command args	*/
+#define CFG_BARGSIZE		CFG_CBSIZE	/* Boot Argument Buffer Size	*/
+
+#define CFG_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
+
+#define CFG_MEMTEST_START	0x00400000	/* memtest works on	*/
+#define CFG_MEMTEST_END		0x00800000	/* 4 ... 8 MB in DRAM	*/
+
+#define CFG_LOAD_ADDR		0x00010000	/* default load address */
+
+#define CFG_MONITOR_BASE	CFG_FLASH_BASE
+#define CFG_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor	*/
+
+#define CFG_MALLOC_LEN		(256 << 10)
+
+#define CFG_FLASH_BASE		0x50000000
+
+#define CFG_MAX_FLASH_BANKS	1	/* max number of memory banks		*/
+#define CFG_MAX_FLASH_SECT	128	/* max number of sectors on one chip	*/
+
+#define CFG_FLASH_CFI		1	/* The flash is CFI compatible	*/
+#define CFG_FLASH_CFI_DRIVER	1	/* Use common CFI driver	*/
+
+#define CFG_FLASH_CFI_WIDTH	FLASH_CFI_16BIT	/* no byte writes on IXP4xx	*/
+
+#define CFG_FLASH_EMPTY_INFO	1	/* print 'E' for empty sector on flinfo */
+#define CFG_FLASH_USE_BUFFER_WRITE 1	/* use buffered writes (20x faster)	*/
+
+#define CFG_ENV_IS_IN_FLASH	1
+#define CFG_ENV_OFFSET		0x40000	/* use the sysconfig partition */
+#define CFG_ENV_SECT_SIZE	0x20000	/* size of one complete sector	*/
+#define CFG_ENV_SIZE		0x2000	/* Total Size of Environment Sector	*/
+
+#define CFG_ETHADDR_OFFSET	0x3FFB0	/* Location of MAC address in flash */
+#define CFG_SERCOMM_OFFSET	0x3FFF8	/* Location of " sErCoMm" signature */

board/nslu2/nslu2.c

Quoted 10 lines
board/nslu2/nslu2.c new file +10 -0
+
+#define CFG_CACHELINE_SIZE	32
+
+#define CFG_HZ			33000000	/* NSLU2 has a 33.000 MHz crystal */
+
+#define CONFIG_STACKSIZE	(128*1024)	/* regular stack */
+
+#define CFG_GBL_DATA_SIZE	128	/* size in bytes reserved for initial data */
+
+/*

If possible add the HUSH support and the completion support.

Best Regards,
J.