[U-Boot] [PATCH 4/4] arm/kirkwood: Add Keymile SUEN3 support

Stefan Roese sr at denx.de
Wed Jul 8 17:46:55 CEST 2009


This patch adds support for the Keymile SUEN3 board which is based
on the Marvell Kirkwood (88F6281) SoC.

Signed-off-by: Stefan Roese <sr at denx.de>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 MAINTAINERS                       |    1 +
 MAKEALL                           |    1 +
 Makefile                          |    3 +
 board/keymile/suen3/Makefile      |   51 +++++++++
 board/keymile/suen3/config.mk     |   25 ++++
 board/keymile/suen3/sdramregs.txt |   28 +++++
 board/keymile/suen3/suen3.c       |  127 +++++++++++++++++++++
 include/configs/suen3.h           |  221 +++++++++++++++++++++++++++++++++++++
 8 files changed, 457 insertions(+), 0 deletions(-)
 create mode 100644 board/keymile/suen3/Makefile
 create mode 100644 board/keymile/suen3/config.mk
 create mode 100644 board/keymile/suen3/sdramregs.txt
 create mode 100644 board/keymile/suen3/suen3.c
 create mode 100644 include/configs/suen3.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 705bac5..ce117e1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -637,6 +637,7 @@ Stefan Roese <sr at denx.de>
 	ixdpg425	xscale
 	pdnb3		xscale
 	scpu		xscale
+	suen3		ARM926EJS (Kirkwood SoC)
 
 Alessandro Rubini <rubini at unipv.it>
 Nomadik Linux Team <STN_WMM_nomadik_linux at list.st.com>
diff --git a/MAKEALL b/MAKEALL
index 41f1445..6c80694 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -524,6 +524,7 @@ LIST_ARM9="			\
 	scb9328			\
 	smdk2400		\
 	smdk2410		\
+	suen3			\
 	trab			\
 	VCMA9			\
 	versatile		\
diff --git a/Makefile b/Makefile
index 2a06440..3afc4ba 100644
--- a/Makefile
+++ b/Makefile
@@ -2925,6 +2925,9 @@ smdk2400_config	:	unconfig
 smdk2410_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 samsung s3c24x0
 
+suen3_config: unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) keymile kirkwood
+
 SX1_stdout_serial_config \
 SX1_config:		unconfig
 	@mkdir -p $(obj)include
diff --git a/board/keymile/suen3/Makefile b/board/keymile/suen3/Makefile
new file mode 100644
index 0000000..de05cc8
--- /dev/null
+++ b/board/keymile/suen3/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <prafulla at marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).a
+
+COBJS	:= suen3.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
+
+#########################################################################
diff --git a/board/keymile/suen3/config.mk b/board/keymile/suen3/config.mk
new file mode 100644
index 0000000..fb29a1b
--- /dev/null
+++ b/board/keymile/suen3/config.mk
@@ -0,0 +1,25 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor <www.marvell.com>
+# Prafulla Wadaskar <prafulla at marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+TEXT_BASE = 0x00600000
diff --git a/board/keymile/suen3/sdramregs.txt b/board/keymile/suen3/sdramregs.txt
new file mode 100644
index 0000000..74abb20
--- /dev/null
+++ b/board/keymile/suen3/sdramregs.txt
@@ -0,0 +1,28 @@
+0xFFD10000 0x01111111
+0xFFD10008 0x00001100
+0xFFD100E0 0x1B1B1B1B
+0xFFD20134 0xBBBBBBBB
+0xFFD20138 0x00BBBBBB
+0xFFD20154 0x00000200
+0xFFD2014C 0x00001C00
+0xFFD20148 0x00000001
+0xFFD01400 0x43000400
+0xFFD01404 0x36343000
+0xFFD01408 0x2302544B
+0xFFD0140C 0x00000032
+0xFFD01410 0x0000000D
+0xFFD01414 0x00000000
+0xFFD01418 0x00000000
+0xFFD0141C 0x00000642
+0xFFD01420 0x00000040
+0xFFD01424 0x0000F07F
+0xFFD01504 0x07FFFFF1
+0xFFD01508 0x00000000
+0xFFD0150C 0x00000000
+0xFFD01514 0x00000000
+0xFFD0151C 0x00000000
+0xFFD01494 0x00000000
+0xFFD01498 0x00000000
+0xFFD0149C 0x0000E90F
+0xFFD01480 0x00000001
+0x0 0x0
diff --git a/board/keymile/suen3/suen3.c b/board/keymile/suen3/suen3.c
new file mode 100644
index 0000000..231745f
--- /dev/null
+++ b/board/keymile/suen3/suen3.c
@@ -0,0 +1,127 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <prafulla at marvell.com>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include <common.h>
+#include <netdev.h>
+#include <miiphy.h>
+#include <asm/arch/kirkwood.h>
+#include <asm/arch/mpp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+	/* Multi-Purpose Pins Functionality configuration */
+	u32 kwmpp_config[] = {
+		MPP0_NF_IO2,
+		MPP1_NF_IO3,
+		MPP2_NF_IO4,
+		MPP3_NF_IO5,
+		MPP4_NF_IO6,
+		MPP5_NF_IO7,
+		MPP6_SYSRST_OUTn,
+		MPP7_PEX_RST_OUTn,
+		MPP8_TW_SDA,
+		MPP9_TW_SCK,
+		MPP10_UART0_TXD,
+		MPP11_UART0_RXD,
+		MPP12_GPO,		/* Reserved */
+		MPP13_UART1_TXD,
+		MPP14_UART1_RXD,
+		MPP15_GPIO,		/* Not used */
+		MPP16_GPIO,		/* Not used */
+		MPP17_GPIO,		/* Reserved */
+		MPP18_NF_IO0,
+		MPP19_NF_IO1,
+		MPP20_GPIO,
+		MPP21_GPIO,
+		MPP22_GPIO,
+		MPP23_GPIO,
+		MPP24_GPIO,
+		MPP25_GPIO,
+		MPP26_GPIO,
+		MPP27_GPIO,
+		MPP28_GPIO,
+		MPP29_GPIO,
+		MPP30_GPIO,
+		MPP31_GPIO,
+		MPP32_GPIO,
+		MPP33_GPIO,
+		MPP34_GPIO,		/* CDL1 (input) */
+		MPP35_GPIO,		/* CDL2 (input) */
+		MPP36_GPIO,		/* MAIN_IRQ (input) */
+		MPP37_GPIO,		/* BOARD_LED */
+		MPP38_GPIO,		/* Piggy3 LED[1] */
+		MPP39_GPIO,		/* Piggy3 LED[2] */
+		MPP40_GPIO,		/* Piggy3 LED[3] */
+		MPP41_GPIO,		/* Piggy3 LED[4] */
+		MPP42_GPIO,		/* Piggy3 LED[5] */
+		MPP43_GPIO,		/* Piggy3 LED[6] */
+		MPP44_GPIO,		/* Piggy3 LED[7] */
+		MPP45_GPIO,		/* Piggy3 LED[8] */
+		MPP46_GPIO,		/* Reserved */
+		MPP47_GPIO,		/* Reserved */
+		MPP48_GPIO,		/* Reserved */
+		MPP49_GPIO,		/* SW_INTOUTn */
+		0
+	};
+
+	kirkwood_mpp_conf(kwmpp_config);
+
+	/*
+	 * arch number of board
+	 */
+	gd->bd->bi_arch_number = MACH_TYPE_SUEN3;
+
+	/* address of boot parameters */
+	gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+
+	return 0;
+}
+
+int dram_init(void)
+{
+	int i;
+
+	for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+		gd->bd->bi_dram[i].start = kw_sdram_bar(i);
+		gd->bd->bi_dram[i].size = kw_sdram_bs(i);
+	}
+	return 0;
+}
+
+/* Configure and enable MV88E1118 PHY */
+void reset_phy(void)
+{
+	char *name = "egiga0";
+
+	if (miiphy_set_current_dev(name))
+		return;
+
+	/* reset the phy */
+	miiphy_reset(name, CONFIG_PHY_BASE_ADR);
+}
diff --git a/include/configs/suen3.h b/include/configs/suen3.h
new file mode 100644
index 0000000..1b971e0
--- /dev/null
+++ b/include/configs/suen3.h
@@ -0,0 +1,221 @@
+/*
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Prafulla Wadaskar <prafulla at marvell.com>
+ *
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, sr 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef _CONFIG_SUEN3_H
+#define _CONFIG_SUEN3_H
+
+/*
+ * Version number information
+ */
+#define CONFIG_IDENT_STRING	"\nKeymile SUEN3"
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+#define CONFIG_MARVELL
+#define CONFIG_ARM926EJS		/* Basic Architecture */
+#define CONFIG_FEROCEON_88FR131		/* CPU Core subversion */
+#define CONFIG_KIRKWOOD			/* SOC Family Name */
+#define CONFIG_KW88F6281		/* SOC Name */
+#define CONFIG_MACH_SUEN3		/* Machine type */
+
+#define CONFIG_MD5	/* get_random_hex on krikwood needs MD5 support */
+#define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
+#define CONFIG_KIRKWOOD_EGIGA_INIT	/* Enable GbePort0/1 for kernel */
+#undef  CONFIG_KIRKWOOD_PCIE_INIT	/* Disable PCIE Port0 for kernel */
+#define CONFIG_KIRKWOOD_RGMII_PAD_1V8	/* Set RGMII Pad voltage to 1.8V */
+
+#define CONFIG_SYS_64BIT_VSPRINTF
+
+/*
+ * CLKs configurations
+ */
+#define CONFIG_SYS_HZ		1000
+
+/*
+ * NS16550 Configuration
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
+#define CONFIG_SYS_NS16550_CLK		CONFIG_SYS_TCLK
+#define CONFIG_SYS_NS16550_COM1		KW_UART0_BASE
+
+/*
+ * Serial Port configuration
+ * The following definitions let you select what serial you want to use
+ * for your console driver.
+ */
+
+#define CONFIG_CONS_INDEX	1	/* Console on UART0 */
+#define CONFIG_BAUDRATE			115200	/* console baudrate */
+#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
+					  115200,230400, 460800, 921600 }
+/* auto boot */
+#define CONFIG_BOOTDELAY	3	/* default enable autoboot */
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CONFIG_BOOTMAPSZ	(8 << 20)	/* Initial Memmap for Linux */
+#define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs  */
+#define CONFIG_INITRD_TAG		/* enable INITRD tag */
+#define CONFIG_SETUP_MEMORY_TAGS 	/* enable memory tag */
+
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+#define CONFIG_SYS_LONGHELP		/* undef to save memory	    */
+#define CONFIG_SYS_PROMPT	"=> "	/* Command Prompt */
+#define CONFIG_SYS_CBSIZE	1024	/* Console I/O Buff Size */
+#define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE \
+		+sizeof(CONFIG_SYS_PROMPT) + 16)	/* Print Buff */
+#define CONFIG_CMDLINE_EDITING		/* add command line history     */
+#define CONFIG_AUTO_COMPLETE		/* add autocompletion support	*/
+
+/*
+ * Commands configuration
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_ECHO
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_UBI
+
+/*
+ * Without NOR FLASH we need this
+ */
+#define CONFIG_SYS_NO_FLASH
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+
+/*
+ * NAND Flash configuration
+ */
+#define CONFIG_SYS_MAX_NAND_DEVICE	1
+#define NAND_MAX_CHIPS			1
+#define CONFIG_NAND_KIRKWOOD
+#define CONFIG_SYS_NAND_BASE		0xd8000000
+
+/*
+ *  Environment variables configurations
+ */
+#define CONFIG_ENV_IS_IN_NAND		/* use NAND for environment vars	*/
+#define CONFIG_ENV_SIZE			(128 << 10)	/* NAND chip block size	*/
+#define CONFIG_ENV_OFFSET		(512 << 10)	/* Offset to env	*/
+#define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+
+/*
+ * Default environment variables
+ */
+
+#define CONFIG_EXTRA_ENV_SETTINGS					\
+	"load=tftp 400000 suen3/u-boot.bin\0"				\
+	"update=nand erase 0 60000;nand write 400000 0 60000\0"		\
+	"upd=run load update\0"						\
+	"mtdparts=orion_nand:512k(uboot),512k at 512k(env),"		\
+		"2m at 1m(kernel),13m at 3m(rootfs)\0"			\
+	"netdev=eth0\0"							\
+	"nfsargs=setenv bootargs root=/dev/nfs rw "			\
+		"nfsroot=${serverip}:${rootpath}\0"			\
+	"ramargs=setenv bootargs root=/dev/ram rw\0"			\
+	"addip=setenv bootargs ${bootargs} "				\
+		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"	\
+		":${hostname}:${netdev}:off panic=1\0"			\
+	"addtty=setenv bootargs ${bootargs}"				\
+		" console=ttyS0,${baudrate}\0"				\
+	"addmisc=setenv bootargs ${bootargs} ${mtdparts}\0"		\
+	"rootpath=/opt/eldk/arm\0"					\
+	"kernel_addr=400000\0"						\
+	"ramdisk_addr_r=C00000\0"					\
+	"hostname=suen3\0"						\
+	"bootfile=suen3/uImage\0"					\
+	"ramdisk_file=suen3/uRamdisk\0"					\
+	"net_nfs=tftp ${kernel_addr} ${bootfile};"			\
+		"run nfsargs addip addtty addmisc;"			\
+		"bootm ${kernel_addr}\0"
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_SYS_MALLOC_LEN	0x00400000	/* 4M */
+/* size in bytes reserved for initial data */
+#define CONFIG_SYS_GBL_DATA_SIZE	128
+
+/*
+ * Other required minimal configurations
+ */
+#define CONFIG_CONSOLE_INFO_QUIET	/* some code reduction */
+#define CONFIG_ARCH_CPU_INIT	/* call arch_cpu_init() */
+#define CONFIG_ARCH_MISC_INIT	/* call arch_misc_init() */
+#define CONFIG_DISPLAY_CPUINFO	/* Display cpu info */
+#define CONFIG_NR_DRAM_BANKS	4
+#define CONFIG_STACKSIZE	0x00100000	/* regular stack- 1M */
+#define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
+#define CONFIG_SYS_MEMTEST_START 0x00400000	/* 4M */
+#define CONFIG_SYS_MEMTEST_END	0x007fffff	/*(_8M -1) */
+#define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
+#define CONFIG_SYS_MAXARGS	16	/* max number of command args */
+
+/*
+ * Ethernet Driver configuration
+ */
+#define CONFIG_NETCONSOLE	/* include NetConsole support   */
+#define CONFIG_NET_MULTI	/* specify more that one ports available */
+#define CONFIG_MII		/* expose smi ove miiphy interface */
+#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
+#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_PHY_BASE_ADR	0
+#define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
+#define CONFIG_RESET_PHY_R	/* use reset_phy() to init mv8831116 PHY */
+
+/*
+ * UBI related stuff
+ */
+#define CONFIG_SYS_USE_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT		"nand0=orion_nand"
+#define MTDPARTS_DEFAULT	"mtdparts=orion_nand:512k(u-boot),"	\
+					"256k(env),"		\
+					"2m(kernel),"		\
+					"16m(rootfs),"		\
+					"32m(fs),"		\
+					"-(ubifs)"
+
+#endif /* _CONFIG_SUEN3_H */
-- 
1.6.3.3



More information about the U-Boot mailing list