From patchwork Fri Nov 2 17:39:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipin Kumar X-Patchwork-Id: 196705 X-Patchwork-Delegate: vipin.kumar@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 182932C007A for ; Sat, 3 Nov 2012 05:06:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3AB14AD7A; Fri, 2 Nov 2012 19:03:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JbkzPGn107Tb; Fri, 2 Nov 2012 19:03:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9ABE04AB27; Fri, 2 Nov 2012 19:01:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 352694AADF for ; Fri, 2 Nov 2012 19:01:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Mz6UtzI3hvy for ; Fri, 2 Nov 2012 19:01:00 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from eu1sys200aog117.obsmtp.com (eu1sys200aog117.obsmtp.com [207.126.144.143]) by theia.denx.de (Postfix) with ESMTPS id 8C0924A923 for ; Fri, 2 Nov 2012 19:00:18 +0100 (CET) Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKUJQKMkwK7vpz7b7e2f1O8jsPZ8I06xc3@postini.com; Fri, 02 Nov 2012 18:00:20 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2C401169; Fri, 2 Nov 2012 17:34:40 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas2.st.com [10.80.176.10]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5C316107D; Fri, 2 Nov 2012 17:42:53 +0000 (GMT) Received: from localhost (10.251.136.62) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.245.1; Sat, 3 Nov 2012 01:42:52 +0800 From: Vipin Kumar To: Date: Fri, 2 Nov 2012 23:09:36 +0530 Message-ID: <68c89698b193b46d6120f642fea7da45ad4e3f04.1351877394.git.vipin.kumar@st.com> X-Mailer: git-send-email 1.7.10.rc2.10.gb47606 In-Reply-To: References: MIME-Version: 1.0 Cc: sr@denx.de, spear-devel@list.st.com Subject: [U-Boot] [SPEAr13xx PATCH 5/7] spear1340lcad: Add support for LCAD machine X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Vipin Kumar --- 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 diff --git a/MAINTAINERS b/MAINTAINERS index f97b2cc..9513fd0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -749,6 +749,7 @@ Vipin Kumar spear600 ARM926EJS (spear600 Soc) spear1310-evb ARM ARMV7 (spear1310 SoC) spear1340-evb ARM ARMV7 (spear1340 SoC) + spear1340-lcad ARM ARMV7 (spear1340 SoC) Sergey Lapin 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 +#include +#include +#include +#include +#include +#include +#include + +#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, + * + * 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 +#endif