[U-Boot] [PATCH v5 3/3] TI: TNETV107X EVM initial support

Tom Rix tom at bumblecow.com
Tue Apr 27 16:39:21 CEST 2010


Cyril Chemparathy wrote:
> TNETV107X is a Texas Instruments SoC based on an ARM1176 core, and with a
> bunch on on-chip integrated peripherals.  This patch adds support for the
> TNETV107X EVM board.
> 
> Signed-off-by: Cyril Chemparathy <cyril at ti.com>
> ---
> v5: rebased on master in u-boot-arm.git (unchanged)
> v4: rebased on next in u-boot-arm.git (unchanged)
> v3: Added NAND MTDID comment in board config
> v2: Added maintainers entry
> v2: Fixed sort order in main makefile
> v2: Remove board specific linker script
> v2: Style fixes - multiline comments
> v2: Replaced clk_get() with clk_get_rate()
> 
>  MAINTAINERS                       |    4 +
>  MAKEALL                           |    1 +
>  Makefile                          |    3 +
>  board/ti/tnetv107xevm/Makefile    |   49 +++++++++
>  board/ti/tnetv107xevm/config.mk   |   20 ++++
>  board/ti/tnetv107xevm/sdb_board.c |   66 +++++++++++
>  include/configs/tnetv107x_evm.h   |  214 +++++++++++++++++++++++++++++++++++++
>  7 files changed, 357 insertions(+), 0 deletions(-)
>  create mode 100644 board/ti/tnetv107xevm/Makefile
>  create mode 100644 board/ti/tnetv107xevm/config.mk
>  create mode 100644 board/ti/tnetv107xevm/sdb_board.c
>  create mode 100644 include/configs/tnetv107x_evm.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0e759c9..44369fe 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -62,6 +62,10 @@ Oliver Brown <obrown at adventnetworks.com>
>  
>  	gw8260		MPC8260
>  
> +Cyril Chemparathy <cyril at ti.com>
> +
> +	tnetv107x_evm	tnetv107x
> +
>  Conn Clark <clark at esteem.com>
>  
>  	ESTEEM192E	MPC8xx
> diff --git a/MAKEALL b/MAKEALL
> index b15d407..e10fead 100755
> --- a/MAKEALL
> +++ b/MAKEALL
> @@ -625,6 +625,7 @@ LIST_ARM11="			\
>  	mx31pdk_nand		\
>  	qong			\
>  	smdk6400		\
> +	tnetv107x_evm		\
>  "
>  
>  #########################################################################
> diff --git a/Makefile b/Makefile
> index 8b4e0b9..92aa3be 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3319,6 +3319,9 @@ smdk6400_config	:	unconfig
>  	fi
>  	@echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
>  
> +tnetv107x_evm_config: unconfig
> +	@$(MKCONFIG) $(@:_config=) arm arm1176 tnetv107xevm ti tnetv107x
> +
>  #========================================================================
>  # i386
>  #========================================================================
> diff --git a/board/ti/tnetv107xevm/Makefile b/board/ti/tnetv107xevm/Makefile
> new file mode 100644
> index 0000000..2446c2a
> --- /dev/null
> +++ b/board/ti/tnetv107xevm/Makefile
> @@ -0,0 +1,49 @@
> +#
> +# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB	= $(obj)lib$(BOARD).a
> +
> +COBJS		+= sdb_board.o
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +.PHONY: all
> +
> +all: $(LIB)
> +
> +$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
> +	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak *~ .depend
> +
> +#########################################################################
> +# This is for $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/ti/tnetv107xevm/config.mk b/board/ti/tnetv107xevm/config.mk
> new file mode 100644
> index 0000000..d24d49a
> --- /dev/null
> +++ b/board/ti/tnetv107xevm/config.mk
> @@ -0,0 +1,20 @@
> +#
> +# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> +#
> +
> +TEXT_BASE = 0x83FC0000
> diff --git a/board/ti/tnetv107xevm/sdb_board.c b/board/ti/tnetv107xevm/sdb_board.c
> new file mode 100644
> index 0000000..fa7b49c
> --- /dev/null
> +++ b/board/ti/tnetv107xevm/sdb_board.c
> @@ -0,0 +1,66 @@
> +/*
> + * TNETV107X-EVM: Board initialization
> + *
> + * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#include <common.h>
> +#include <miiphy.h>
> +#include <linux/mtd/nand.h>
> +#include <asm/arch/hardware.h>
> +#include <asm/arch/clock.h>
> +#include <asm/io.h>
> +#include <asm/mach-types.h>
> +#include <asm/arch/nand_defs.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int board_init(void)
> +{
> +#ifndef CONFIG_USE_IRQ
> +	__raw_writel(0, INTC_GLB_EN);		/* Global disable       */
> +	__raw_writel(0, INTC_HINT_EN);		/* Disable host ints    */
> +	__raw_writel(0, INTC_EN_CLR0 + 0);	/* Clear enable         */
> +	__raw_writel(0, INTC_EN_CLR0 + 4);	/* Clear enable         */
> +	__raw_writel(0, INTC_EN_CLR0 + 8);	/* Clear enable         */
> +#endif
> +
> +	gd->bd->bi_arch_number = MACH_TYPE_TNETV107X;
> +	gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
> +
> +	clk_enable(TNETV107X_LPSC_WDT_ARM);
> +
> +	return 0;
> +}
> +
> +int dram_init(void)
> +{
> +	gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
> +	gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_NAND_DAVINCI
> +int board_nand_init(struct nand_chip *nand)
> +{
> +	davinci_nand_init(nand);
> +
> +	return 0;
> +}
> +#endif
> diff --git a/include/configs/tnetv107x_evm.h b/include/configs/tnetv107x_evm.h
> new file mode 100644
> index 0000000..812ffb7
> --- /dev/null
> +++ b/include/configs/tnetv107x_evm.h
> @@ -0,0 +1,214 @@
> +/*
> + * Copyright (C) 2008 Texas Instruments, Inc <www.ti.com>
> + *
> + * Based on davinci_dvevm.h. Original Copyrights follow:
> + *
> + * Copyright (C) 2007 Sergey Kubushyn <ksi at koi8.net>
> + *
> + * 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>
> +#include <asm/arch/hardware.h>
> +#include <asm/arch/clock.h>
> +
> +/* Architecture, CPU, etc */
> +#define CONFIG_ARM1176
> +#define CONFIG_TNETV107X
> +#define CONFIG_TNETV107X_EVM
> +#define CONFIG_ARCH_CPU_INIT
> +#define CONFIG_SYS_UBOOT_BASE		TEXT_BASE
> +#define CONFIG_DISABLE_TCM
> +#define CONFIG_PERIPORT_REMAP
> +#define CONFIG_PERIPORT_BASE		0x2000000
> +#define CONFIG_PERIPORT_SIZE		0x10
> +#define CONFIG_SYS_MON_DEBUG
> +#define CONFIG_SYS_INT_OSC_FREQ		24000000
> +#define CONFIG_SYS_CLK_FREQ		clk_get_rate(TNETV107X_LPSC_ARM)
> +
> +/* PLL Configuration */
> +#define CONFIG_PLL_SYS_CONFIG			0
> +#define CONFIG_PLL_SYS_INT_OSC			1
> +#define CONFIG_PLL_SYS_EXT_FREQ		 25000000
> +#define CONFIG_PLL_TDM_CONFIG			0
> +#define CONFIG_PLL_TDM_INT_OSC			1
> +#define CONFIG_PLL_TDM_EXT_FREQ		 19200000
> +#define CONFIG_PLL_ETH_CONFIG			1
> +#define CONFIG_PLL_ETH_INT_OSC			1
> +#define CONFIG_PLL_ETH_EXT_FREQ		 25000000
> +#define CONFIG_PLL_ETH_PLL_FREQ		500000000
> +#define CONFIG_PLL_ETH_5_CLK		  5000000
> +#define CONFIG_PLL_ETH_50_CLK		 50000000
> +#define CONFIG_PLL_ETH_125_CLK		125000000
> +#define CONFIG_PLL_ETH_250_CLK		250000000
> +#define CONFIG_PLL_ETH_25_CLK		 25000000
> +
> +/* Async EMIF Configuration */
> +#define ASYNC_EMIF_MODE_NOR		0
> +#define ASYNC_EMIF_MODE_NAND		1
> +#define ASYNC_EMIF_MODE_ONENAND		2
> +
> +#define ASYNC_EMIF_CS0_SELECT_STROBE	0
> +#define ASYNC_EMIF_CS0_EXTEND_WAIT	0
> +#define ASYNC_EMIF_CS0_WR_SETUP		5	/* cycles   */
> +#define ASYNC_EMIF_CS0_WR_STROBE	5	/* cycles   */
> +#define ASYNC_EMIF_CS0_WR_HOLD		2	/* cycles   */
> +#define ASYNC_EMIF_CS0_RD_SETUP		5	/* cycles   */
> +#define ASYNC_EMIF_CS0_RD_STROBE	5	/* cycles   */
> +#define ASYNC_EMIF_CS0_RD_HOLD		2	/* cycles   */
> +#define ASYNC_EMIF_CS0_TURN_AROUND	5	/* cycles   */
> +#define ASYNC_EMIF_CS0_WIDTH		ASYNC_EMIF_8
> +
> +#define ASYNC_EMIF_CS1_SELECT_STROBE	0
> +#define ASYNC_EMIF_CS1_EXTEND_WAIT	0
> +#define ASYNC_EMIF_CS1_WR_SETUP		2	/* cycles   */
> +#define ASYNC_EMIF_CS1_WR_STROBE	27	/* cycles   */
> +#define ASYNC_EMIF_CS1_WR_HOLD		4	/* cycles   */
> +#define ASYNC_EMIF_CS1_RD_SETUP		2	/* cycles   */
> +#define ASYNC_EMIF_CS1_RD_STROBE	27	/* cycles   */
> +#define ASYNC_EMIF_CS1_RD_HOLD		4	/* cycles   */
> +#define ASYNC_EMIF_CS1_TURN_AROUND	2	/* cycles   */
> +#define ASYNC_EMIF_CS1_WIDTH		ASYNC_EMIF_PRESERVE
> +
> +#define ASYNC_EMIF_CS2_SELECT_STROBE	0
> +#define ASYNC_EMIF_CS2_EXTEND_WAIT	0
> +#define ASYNC_EMIF_CS2_WR_SETUP		2	/* cycles   */
> +#define ASYNC_EMIF_CS2_WR_STROBE	27	/* cycles   */
> +#define ASYNC_EMIF_CS2_WR_HOLD		4	/* cycles   */
> +#define ASYNC_EMIF_CS2_RD_SETUP		2	/* cycles   */
> +#define ASYNC_EMIF_CS2_RD_STROBE	27	/* cycles   */
> +#define ASYNC_EMIF_CS2_RD_HOLD		4	/* cycles   */
> +#define ASYNC_EMIF_CS2_TURN_AROUND	2	/* cycles   */
> +#define ASYNC_EMIF_CS2_WIDTH		ASYNC_EMIF_PRESERVE
> +
> +#define ASYNC_EMIF_CS3_SELECT_STROBE	0
> +#define ASYNC_EMIF_CS3_EXTEND_WAIT	0
> +#define ASYNC_EMIF_CS3_WR_SETUP		1	/* cycles   */
> +#define ASYNC_EMIF_CS3_WR_STROBE	90	/* cycles   */
> +#define ASYNC_EMIF_CS3_WR_HOLD		3	/* cycles   */
> +#define ASYNC_EMIF_CS3_RD_SETUP		1	/* cycles   */
> +#define ASYNC_EMIF_CS3_RD_STROBE	26	/* cycles   */
> +#define ASYNC_EMIF_CS3_RD_HOLD		3	/* cycles   */
> +#define ASYNC_EMIF_CS3_TURN_AROUND	1	/* cycles   */
> +#define ASYNC_EMIF_CS3_WIDTH		ASYNC_EMIF_8

Is there a better place to put these #defines?
Maybe the board initialization *.c file ?

Fine otherwise
Tom


More information about the U-Boot mailing list