Patchwork [U-Boot,3/5] MSM 7x27a: Add support for qualcomm msm7x27a surf board

login
register
mail settings
Submitter srikanth.reddy@lntinfotech.com
Date Aug. 13, 2012, 8:13 a.m.
Message ID <1344845609-11068-4-git-send-email-srikanth.reddy@lntinfotech.com>
Download mbox | patch
Permalink /patch/176873/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

srikanth.reddy@lntinfotech.com - Aug. 13, 2012, 8:13 a.m.
Signed-off-by: Srikanth Reddy Vintha <srikanth.reddy@lntinfotech.com>
---
 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

Patch

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. <www.lntinfotech.com>
+#
+#  (C) Copyright 2010,2011
+#  NVIDIA Corporation <www.nvidia.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 $(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. <www.lntinfotech.com>
+ *
+ * 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 <asm/arch/iomap.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <asm/arch/mmc.h>
+#include <linux/string.h>
+#include <asm/mach-types.h>
+#include <asm/arch/proc_comm.h>
+#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. <www.lntinfotech.com>
+ *
+ * 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. <www.lntinfotech.com>
+ *
+ * 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 <asm/sizes.h>
+#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 <config_cmd_default.h>
+
+/* 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