Patchwork [U-Boot,SPEAr13xx,5/7] spear1340lcad: Add support for LCAD machine

login
register
mail settings
Submitter Vipin Kumar
Date Nov. 2, 2012, 5:39 p.m.
Message ID <68c89698b193b46d6120f642fea7da45ad4e3f04.1351877394.git.vipin.kumar@st.com>
Download mbox | patch
Permalink /patch/196705/
State New
Delegated to: Vipin Kumar
Headers show

Comments

Vipin Kumar - Nov. 2, 2012, 5:39 p.m.
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
---
 MAINTAINERS                           |  1 +
 board/st/spear13xx/Makefile           |  1 +
 board/st/spear13xx/spear1340lcad.c    | 89 ++++++++++++++++++++++++++++++++++
 board/st/spear13xx/spear13xx_common.c |  2 +
 boards.cfg                            |  1 +
 include/configs/spear1340-lcad.h      | 91 +++++++++++++++++++++++++++++++++++
 6 files changed, 185 insertions(+)
 create mode 100644 board/st/spear13xx/spear1340lcad.c
 create mode 100644 include/configs/spear1340-lcad.h

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index f97b2cc..9513fd0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -749,6 +749,7 @@  Vipin Kumar <vipin.kumar@st.com>
 	spear600	ARM926EJS (spear600 Soc)
 	spear1310-evb	ARM ARMV7 (spear1310 SoC)
 	spear1340-evb	ARM ARMV7 (spear1340 SoC)
+	spear1340-lcad	ARM ARMV7 (spear1340 SoC)
 
 Sergey Lapin <slapin@ossfans.org>
 
diff --git a/board/st/spear13xx/Makefile b/board/st/spear13xx/Makefile
index abddc7b..a662ac4 100644
--- a/board/st/spear13xx/Makefile
+++ b/board/st/spear13xx/Makefile
@@ -31,6 +31,7 @@  COBJS-y	:=
 COBJS-y	+= spear13xx_common.o
 COBJS-$(CONFIG_MACH_SPEAR1310EVB) += spear1310evb.o
 COBJS-$(CONFIG_MACH_SPEAR1340EVB) += spear1340evb.o
+COBJS-$(CONFIG_MACH_SPEAR1340LCAD) += spear1340lcad.o
 
 COBJS	:= $(sort $(COBJS-y))
 SOBJS	:= $(sort $(SOBJS-y))
diff --git a/board/st/spear13xx/spear1340lcad.c b/board/st/spear13xx/spear1340lcad.c
new file mode 100644
index 0000000..719e4ee
--- /dev/null
+++ b/board/st/spear13xx/spear1340lcad.c
@@ -0,0 +1,89 @@ 
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.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 <netdev.h>
+#include <nand.h>
+#include <phy.h>
+#include <linux/mtd/fsmc_nand.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/pinmux.h>
+
+#if defined(CONFIG_CMD_NAND)
+static struct nand_chip nand_chip[CONFIG_SYS_MAX_NAND_DEVICE];
+#endif
+
+#if defined(CONFIG_BOARD_EARLY_INIT_F)
+int board_early_init_f(void)
+{
+	spear1340_pins_default();
+
+	spear1340_enable_pins(PMX_FSMCNAND, PMX_NAND_8BIT);
+	spear1340_enable_pins(PMX_UART0, PMX_UART_SIMPLE);
+	spear1340_enable_pins(PMX_SDMMC, 0);
+
+	return 0;
+}
+#endif
+
+#if defined(CONFIG_CMD_NAND)
+/*
+ * board_nand_init - Board specific NAND initialization
+ */
+void board_nand_init(void)
+{
+#if defined(CONFIG_NAND_FSMC)
+	fsmc_nand_init(&nand_chip[0]);
+#endif
+}
+#endif
+
+#if defined(CONFIG_CMD_NET)
+int board_eth_init(bd_t *bis)
+{
+	int ret = 0;
+	u32 interface = PHY_INTERFACE_MODE_RMII;
+#if defined(CONFIG_DESIGNWARE_ETH)
+#if defined(CONFIG_DW_AUTONEG)
+	interface = PHY_INTERFACE_MODE_RGMII;
+#endif
+	if (designware_initialize(0, CONFIG_SYS_ETH_BASE, CONFIG_DW0_PHY,
+				interface) >= 0)
+		ret++;
+#endif
+	return ret;
+}
+#endif
+
+#if defined(CONFIG_CMD_MMC)
+int board_mmc_init(bd_t *bis)
+{
+	int ret = 0;
+#if defined(CONFIG_SPEAR_SDHCI)
+	if (spear_sdhci_init(CONFIG_SYS_MMC_BASE, 24000000, 6000000, 0) >= 0)
+		ret++;
+#endif
+	return ret;
+}
+#endif
diff --git a/board/st/spear13xx/spear13xx_common.c b/board/st/spear13xx/spear13xx_common.c
index d996c34..7da6333 100644
--- a/board/st/spear13xx/spear13xx_common.c
+++ b/board/st/spear13xx/spear13xx_common.c
@@ -36,6 +36,8 @@  int checkboard(void)
 	printf("BOARD: SPEAr1340-EVB\n");
 #elif defined(CONFIG_MACH_SPEAR1310EVB)
 	printf("BOARD: SPEAr1310-EVB\n");
+#elif defined(CONFIG_MACH_SPEAR1340LCAD)
+	printf("BOARD: SPEAr1340-LCAD\n");
 #else
 #error BOARD not supported
 #endif
diff --git a/boards.cfg b/boards.cfg
index aecee77..2a50773 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -275,6 +275,7 @@  spear1310_usbtty             arm         armv7       spear13xx           st
 spear1340                    arm         armv7       spear13xx           st             spear13xx       spear1340-evb:spear1340
 spear1340_nand               arm         armv7       spear13xx           st             spear13xx       spear1340-evb:spear1340,nand
 spear1340_usbtty             arm         armv7       spear13xx           st             spear13xx       spear1340-evb:spear1340,usbtty
+spear1340lcad                arm         armv7       spear13xx           st             spear13xx       spear1340-lcad:spear1340
 trats                        arm         armv7       trats               samsung        exynos
 harmony                      arm         armv7:arm720t harmony           nvidia         tegra20
 seaboard                     arm         armv7:arm720t seaboard          nvidia         tegra20
diff --git a/include/configs/spear1340-lcad.h b/include/configs/spear1340-lcad.h
new file mode 100644
index 0000000..770a16f
--- /dev/null
+++ b/include/configs/spear1340-lcad.h
@@ -0,0 +1,91 @@ 
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, STMicroelectronics, <vipin.kumar@st.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 __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_MACH_SPEAR1340LCAD
+#define CONFIG_MACH_TYPE			3395
+
+/* Timer configurations */
+#define CONFIG_ARMV7_CA9LTIMER
+#define CONFIG_ARMV7_LTMR_CLK			250000000
+
+/* ARASAN SD MMC configuration */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_SPEAR_SDHCI
+#endif
+
+
+/* Designware UDC configurations */
+#if defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_DW_OTG
+	#define CONFIG_DW_OTG_PHYINIT
+#endif
+
+/* ST SMI (Serial flash) configurations */
+#define CONFIG_ST_SMI
+
+/* GPIO configurations */
+#define CONFIG_SPEAR_GPIO
+
+/* AMBA PL011 configurations */
+#define CONFIG_PL011_SERIAL
+#define CONFIG_CONS_INDEX			0
+
+/* USB EHCI configurations */
+#if !defined(CONFIG_SPEAR_USBTTY)
+	#define CONFIG_USB_EHCI_SPEAR
+#endif
+
+/* FSMC NAND configurations */
+#define CONFIG_NAND_FSMC
+#define CONFIG_SYS_FSMC_NAND_8BIT
+
+/* Environment Variable configs */
+/* Environment is in NAND */
+#define CONFIG_ENV_IS_IN_NAND
+
+#define CONFIG_ENV_OFFSET		0x00480000
+
+#define CONFIG_BOOTCOMMAND	"run bootusb; run bootupg;" \
+		"nand read.jffs2 0x800000 0x500000 0x020000; " \
+		"nand read.jffs2 0x900000 0x600000 0x500000; " \
+		"bootm 0x900000 - 0x800000"
+
+#define CONFIG_BOOTARGS		"console=ttyAMA0,115200 " \
+	"mem=960M noinitrd no_console_suspend androidboot.console=ttyAMA0 " \
+	"android.checkjni=0 root=/dev/mtdblock5 rw rootfstype=yaffs2 " \
+	"rootflags=inband-tags,tags-ecc-off rootdelay=3" \
+	"video=db9000:800x480-32@0 init=/init"
+
+#define CONFIG_BOARD_EXTRA_ENV		"" \
+	"bootusb=mw 0x0 0x0; usb start; fatload usb 0:2 0x0 run.img; " \
+	"source 0x0\0" \
+	"bootupg=mw 0x0 0x0; fatload usb 0:1 0x0 vInstaller/upgrade.img; " \
+	"source 0x0\0" \
+	"loados=tftpboot 0x900000 $(rootpath)/spear13xx_uImage\0"	\
+	"loaddtb=tftpboot 0x800000 $(rootpath)/spear1340-lcad.dtb\0"
+
+#include <configs/spear1340.h>
+#endif