From patchwork Thu May 10 07:25:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: srikanth.reddy@lntinfotech.com X-Patchwork-Id: 158231 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 E3095B6FAA for ; Thu, 10 May 2012 19:12:11 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2493E280A0; Thu, 10 May 2012 11:11:40 +0200 (CEST) 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 M73vDrtOtNf3; Thu, 10 May 2012 11:11:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD63B280A2; Thu, 10 May 2012 11:11:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F85628090 for ; Thu, 10 May 2012 09:35:45 +0200 (CEST) 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 ltAda45Zgx3B for ; Thu, 10 May 2012 09:35:44 +0200 (CEST) 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 mail1.bemta8.messagelabs.com (mail1.bemta8.messagelabs.com [216.82.243.50]) by theia.denx.de (Postfix) with ESMTPS id 977DB2808D for ; Thu, 10 May 2012 09:35:42 +0200 (CEST) Received: from [216.82.241.243:51585] by server-3.bemta-8.messagelabs.com id B4/DC-16195-E2E6BAF4; Thu, 10 May 2012 07:28:46 +0000 X-Env-Sender: Srikanth.Reddy@lntinfotech.com X-Msg-Ref: server-2.tower-192.messagelabs.com!1336634920!17627300!3 X-Originating-IP: [203.101.96.7] X-StarScan-Version: 6.5.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18573 invoked from network); 10 May 2012 07:28:46 -0000 Received: from unknown (HELO BLRINMSHTCAS01.bglrodc.lntinfotech.com) (203.101.96.7) by server-2.tower-192.messagelabs.com with AES128-SHA encrypted SMTP; 10 May 2012 07:28:46 -0000 Received: from INFBA02474.BGLRODC.lntinfotech.com (172.28.9.86) by BLRINMSHTCAS01.bglrodc.lntinfotech.com (172.28.0.81) with Microsoft SMTP Server id 8.2.176.0; Thu, 10 May 2012 12:55:52 +0530 From: To: u-boot@lists.denx.de Date: Thu, 10 May 2012 12:55:21 +0530 Message-ID: <1336634721-21719-3-git-send-email-srikanth.reddy@lntinfotech.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1336634721-21719-1-git-send-email-srikanth.reddy@lntinfotech.com> References: <1336634721-21719-1-git-send-email-srikanth.reddy@lntinfotech.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 10 May 2012 11:11:04 +0200 Cc: mohamed.haneef@lntinfotech.com, shrinivas.sahukar@lntinfotech.com, Srikanth Reddy Vintha Subject: [U-Boot] [PATCH 2/2] MSM7x27a: Add support for msm7x27a surf board 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 From: Srikanth Reddy Vintha * support for msm 7x27a surf board Signed-off-by: Srikanth Reddy Vintha --- board/qcom/msm7x27a_surf/Makefile | 56 +++++++++++++ board/qcom/msm7x27a_surf/msm7x27a_surf.c | 126 +++++++++++++++++++++++++++++ board/qcom/msm7x27a_surf/msm7x27a_surf.h | 27 ++++++ boards.cfg | 1 + include/configs/msm7x27a_surf.h | 128 ++++++++++++++++++++++++++++++ 5 files changed, 338 insertions(+), 0 deletions(-) create mode 100644 board/qcom/msm7x27a_surf/Makefile create mode 100644 board/qcom/msm7x27a_surf/msm7x27a_surf.c create mode 100644 board/qcom/msm7x27a_surf/msm7x27a_surf.h create mode 100644 include/configs/msm7x27a_surf.h diff --git a/board/qcom/msm7x27a_surf/Makefile b/board/qcom/msm7x27a_surf/Makefile new file mode 100644 index 0000000..123099d --- /dev/null +++ b/board/qcom/msm7x27a_surf/Makefile @@ -0,0 +1,56 @@ +# +# (C) Copyright 2012 +# Larsen & Toubro Infotech Ltd. +# +# (C) Copyright 2010,2011 +# NVIDIA Corporation +# +# +# 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 + +ifneq ($(OBJTREE),$(SRCTREE)) +$(shell mkdir -p $(obj)../../qcom/msm7x27a_surf/) +endif + +LIB = $(obj)lib$(BOARD).o + +COBJS := $(BOARD).o +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB): $(obj).depend $(OBJS) + $(call cmd_link_o_target, $(OBJS)) + +clean: + rm -f $(OBJS) + +distclean: + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +######################################################################### diff --git a/board/qcom/msm7x27a_surf/msm7x27a_surf.c b/board/qcom/msm7x27a_surf/msm7x27a_surf.c new file mode 100644 index 0000000..9199f48 --- /dev/null +++ b/board/qcom/msm7x27a_surf/msm7x27a_surf.c @@ -0,0 +1,126 @@ +/* + * (C) Copyright 2012 + * Larsen & Toubro Infotech Ltd. + * + * 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 +#include +#include "msm7x27a_surf.h" + +DECLARE_GLOBAL_DATA_PTR; + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f() +{ + uart1_clock_init(); + return 0; +} +#endif +int board_init() +{ + unsigned long new_addr; + unsigned long offset; + offset = gd->relocaddr - CONFIG_SYS_TEXT_BASE; + new_addr = CONFIG_SYS_TEXT_BASE + offset; + set_vector_base(new_addr); + acpu_clock_init(); + bd_t *bd = gd->bd; + bd->bi_arch_number = MACH_TYPE_MSM7X27_SURF; + return 0; +} + +#ifdef CONFIG_QC_MMC + +/* called during the scan of each mmc device */ +int qc_board_mmc_init(struct mmc *mmc) +{ + + struct mmc_priv *sd = (struct mmc_priv *)mmc->priv; + u32 smem_val; + do { + smem_val = 0; + smem_val = readl(MSM_SHARED_BASE + 0x14); + } while (smem_val != 1); + + if (sd->instance == 3 || sd->instance == 4) { + mmc_boot_main(mmc); + return 0; + } else + /* this board does not have an sd/mmc card on this interface. */ + return 1; + } +int board_mmc_init(bd_t *bis) +{ +#ifdef QC_SD + struct mmc *mmc_4; + struct mmc_priv *sdcc_4; + mmc_4 = (struct mmc *) malloc(sizeof(struct mmc)); + if (!mmc_4) + return 1; + sdcc_4 = (struct mmc_priv *) malloc(sizeof(struct mmc_priv)); + if (!sdcc_4) { + free(mmc_4); + return 1; + } + sdcc_4->instance = 4; + sdcc_4->base = MSM_SDC4_BASE; + mmc_4->priv = sdcc_4; + mmc_4->send_cmd = mmc_boot_send_command_map; + mmc_4->set_ios = mmc_boot_set_ios; + mmc_4->init = qc_board_mmc_init; + mmc_4->voltages = MMC_VDD_29_30|MMC_VDD_165_195; + mmc_4->host_caps = MMC_MODE_4BIT|MMC_MODE_HS; + mmc_4->f_min = MMC_CLK_400KHZ; + mmc_4->f_max = MMC_CLK_48MHZ; + sprintf(mmc_4->name, "External_Card"); + mmc_register(mmc_4); +#else + struct mmc *mmc_3; + struct mmc_priv *sdcc_3; + mmc_3 = (struct mmc *) malloc(sizeof(struct mmc)); + if (!mmc_3) + return 1; + sdcc_3 = (struct mmc_priv *) malloc(sizeof(struct mmc_priv)); + if (!sdcc_3) { + free(mmc_3); + return 1; + } + sdcc_3->instance = 3; + sdcc_3->base = MSM_SDC3_BASE; + mmc_3->priv = sdcc_3; + mmc_3->send_cmd = mmc_boot_send_command_map; + mmc_3->set_ios = mmc_boot_set_ios; + mmc_3->init = qc_board_mmc_init; + mmc_3->voltages = MMC_VDD_29_30|MMC_VDD_165_195; + mmc_3->host_caps = MMC_MODE_4BIT|MMC_MODE_HS|MMC_MODE_8BIT| + MMC_MODE_HS_52MHz|MMC_MODE_HC; + mmc_3->f_min = MMC_CLK_400KHZ; + mmc_3->f_max = MMC_CLK_48MHZ; + sprintf(mmc_3->name, "Internal_Card"); + mmc_register(mmc_3); +#endif + return 0; +} +#endif diff --git a/board/qcom/msm7x27a_surf/msm7x27a_surf.h b/board/qcom/msm7x27a_surf/msm7x27a_surf.h new file mode 100644 index 0000000..8bbe614 --- /dev/null +++ b/board/qcom/msm7x27a_surf/msm7x27a_surf.h @@ -0,0 +1,27 @@ +/* + * (C) Copyright 2012 + * Larsen & Toubro Infotech Ltd. + * + * 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 __MSM7X27A_H_ +#define __MSM7X27A_H_ + +extern void set_vector_base(unsigned long); +extern void acpu_clock_init(void); +extern void uart1_clock_init(void); +#endif diff --git a/boards.cfg b/boards.cfg index 6fd8e34..318ba56 100644 --- a/boards.cfg +++ b/boards.cfg @@ -185,6 +185,7 @@ integratorcp_cm946es arm arm946es integrator armltd ca9x4_ct_vxp arm armv7 vexpress armltd am335x_evm arm armv7 am335x ti am33xx highbank arm armv7 highbank - highbank +msm7x27a_surf arm armv7 msm7x27a_surf qcom msm7x27a msm7630_surf arm armv7 msm7630_surf qcom msm7630 efikamx arm armv7 efikamx - mx5 efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKAMX,IMX_CONFIG=board/efikamx/imximage_mx.cfg efikasb arm armv7 efikamx - mx5 efikamx:MACH_TYPE=MACH_TYPE_MX51_EFIKASB,IMX_CONFIG=board/efikamx/imximage_sb.cfg diff --git a/include/configs/msm7x27a_surf.h b/include/configs/msm7x27a_surf.h new file mode 100644 index 0000000..a82ba59 --- /dev/null +++ b/include/configs/msm7x27a_surf.h @@ -0,0 +1,128 @@ +/* + * (C) Copyright 2012 + * Larsen & Toubro Infotech Ltd. + * + * 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 + +#include +#define PLATFORM_MSM7X27A 1 +#define CONFIG_MSM_UART +#define CONFIG_SYS_NO_FLASH +#define CONFIG_L2_OFF +#define CONFIG_SKIP_LOWLEVEL_INIT +/* Environment */ +#define CONFIG_ENV_IS_NOWHERE +#define CONFIG_ENV_SIZE 0x20000 /* Total Size Environment */ +#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_MSM_PCOMM +#define CONFIG_ARCH_CPU_INIT +/* + * Size of malloc() pool + */ +#define CONFIG_SYS_MALLOC_LEN (2 * 1024) /* 2KB */ + +/* + * select serial console configuration + */ +#define CONFIG_CONS_INDEX 1 + +/* allow to overwrite serial and ethaddr */ +#define CONFIG_ENV_OVERWRITE +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ + 115200} + +#include + +/* remove unused commands */ +#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */ +#undef CONFIG_CMD_FPGA /* FPGA configuration support */ +#undef CONFIG_CMD_IMI +#undef CONFIG_CMD_IMLS +#undef CONFIG_CMD_NFS /* NFS support */ +#undef CONFIG_CMD_NET /* network support */ +#undef CONFIG_SYS_MAX_FLASH_SECT +#define CONFIG_EXTRA_ENV_SETTINGS \ + "console=ttyS0,115200n8\0" \ + +#define CONFIG_BOOTDELAY -1 + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_LONGHELP /* undef to save memory */ +#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */ +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define V_PROMPT "(MSM 7x27A) # " +#define CONFIG_SYS_PROMPT V_PROMPT +/* + * Increasing the size of the IO buffer as default nfsargs size is more + * than 256 and so it is not possible to edit it + */ +#define CONFIG_SYS_CBSIZE (256 * 2) /* Console I/O Buffer Size */ +/* Print Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ + sizeof(CONFIG_SYS_PROMPT) + 16) +#define CONFIG_SYS_MAXARGS 16 /* max number of command args */ +/* Boot Argument Buffer Size */ +#define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE) + +#define CONFIG_SYS_HZ 1000 +#define CONFIG_SYS_LOAD_ADDR 0x00208000 +#define CONFIG_SYS_MEMTEST_START 0x08008000 +#define CONFIG_SYS_MEMTEST_END 0x08008001 + +#define CONFIG_DOS_PARTITION +#define CONFIG_MMC +#define CONFIG_CMD_MMC + +#define CONFIG_GENERIC_MMC +#define CONFIG_QC_MMC +/*--------------------------------------------------------------------- + * IRQ Settings + */ + +#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */ +#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */ + +/*----------------------------------------------------------------------- + * Physical Memory Map + */ + +#if 0 +#define CONFIG_BOOTDELAY 0 +#define CONFIG_BOOTCOMMAND "mmc part" +#endif +#define CONFIG_NR_DRAM_BANKS 1 + +#define PHYS_SDRAM_1 0x00000000 +#define PHYS_SDRAM_1_SIZE (1*1024*1024) /* 512M */ + +#define CONFIG_SYS_TEXT_BASE 0x00000000 +#define CONFIG_SYS_INIT_RAM_ADDR 0x00000000 +#define CONFIG_SYS_INIT_RAM_SIZE 0x00100000 + + +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ + CONFIG_SYS_INIT_RAM_SIZE - \ + GENERATED_GBL_DATA_SIZE) + +#endif