[U-Boot] [PATCH v5] ARM DaVinci Adding DM357 Support
s-paulraj at ti.com
s-paulraj at ti.com
Sat May 9 18:43:22 CEST 2009
Patch adds Support for DaVinci DM357.
It boots of a small page NAND on the EVM. It does not have NOR support.
This patch has been tested on the DM357 EVM.
The patch does not have Ethernet Support yet.
Ethernet Support will be added soon
Signed-off-by: Sandeep Paulraj <s-paulraj at ti.com>
---
Makefile | 3 +
board/davinci/dm357_evm/Makefile | 50 +++++++++++
board/davinci/dm357_evm/config.mk | 39 +++++++++
board/davinci/dm357_evm/dm357_evm.c | 69 ++++++++++++++++
include/configs/davinci_dm357_evm.h | 155 +++++++++++++++++++++++++++++++++++
5 files changed, 316 insertions(+), 0 deletions(-)
create mode 100644 board/davinci/dm357_evm/Makefile
create mode 100644 board/davinci/dm357_evm/config.mk
create mode 100644 board/davinci/dm357_evm/dm357_evm.c
create mode 100644 include/configs/davinci_dm357_evm.h
diff --git a/Makefile b/Makefile
index 137c88f..6ee0562 100644
--- a/Makefile
+++ b/Makefile
@@ -2790,6 +2790,9 @@ davinci_sffsdr_config : unconfig
davinci_sonata_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs sonata davinci davinci
+davinci_dm357_evm_config : unconfig
+ @$(MKCONFIG) $(@:_config=) arm arm926ejs dm357_evm davinci davinci
+
lpd7a400_config \
lpd7a404_config: unconfig
@$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
diff --git a/board/davinci/dm357_evm/Makefile b/board/davinci/dm357_evm/Makefile
new file mode 100644
index 0000000..b10da38
--- /dev/null
+++ b/board/davinci/dm357_evm/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn <ksi at koi8.net>
+#
+# 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
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS := dm357_evm.o
+
+SRCS := $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+ rm -f $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/davinci/dm357_evm/config.mk b/board/davinci/dm357_evm/config.mk
new file mode 100644
index 0000000..aa89d0e
--- /dev/null
+++ b/board/davinci/dm357_evm/config.mk
@@ -0,0 +1,39 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <gj at denx.de>
+# David Mueller, ELSOFT AG, <d.mueller at elsoft.ch>
+#
+# (C) Copyright 2003
+# Texas Instruments, <www.ti.com>
+# Swaminathan <swami.iyer at ti.com>
+#
+# Davinci EVM board (ARM925EJS) cpu
+# see http://www.ti.com/ for more information on Texas Instruments
+#
+# Davinci EVM has 1 bank of 256 MB DDR RAM
+# Physical Address:
+# 8000'0000 to 9000'0000
+#
+# Copyright (C) 2007 Sergey Kubushyn <ksi at koi8.net>
+#
+# Visioneering Corp. Sonata board (ARM926EJS) cpu
+#
+# Sonata board has 1 bank of 128 MB DDR RAM
+# Physical Address:
+# 8000'0000 to 8800'0000
+#
+# Razorstream, LLC. SCHMOOGIE board (ARM926EJS) cpu
+#
+# Schmoogie board has 1 bank of 128 MB DDR RAM
+# Physical Address:
+# 8000'0000 to 8800'0000
+#
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+#
+# we load ourself to 8108 '0000
+#
+#
+
+#Provide at least 16MB spacing between us and the Linux Kernel image
+TEXT_BASE = 0x81080000
diff --git a/board/davinci/dm357_evm/dm357_evm.c b/board/davinci/dm357_evm/dm357_evm.c
new file mode 100644
index 0000000..d769b74
--- /dev/null
+++ b/board/davinci/dm357_evm/dm357_evm.c
@@ -0,0 +1,69 @@
+/*
+ *
+ * Copyright (C) 2009 Texas Instruments.
+ *
+ * ----------------------------------------------------------------------------
+ * 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 <i2c.h>
+#include <asm/arch/hardware.h>
+#include "../common/psc.h"
+#include "../common/misc.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+ /* arch number of the board */
+ gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM357_EVM;
+
+ /* address of boot parameters */
+ gd->bd->bi_boot_params = (DAVINCI_DDR_BASE + 0x100);
+
+ davinci_errata_workarounds();
+
+ /* Power on required peripherals */
+ lpsc_on(DAVINCI_LPSC_GPIO);
+ lpsc_on(DAVINCI_LPSC_USB);
+
+ davinci_enable_uart0();
+ davinci_enable_emac();
+ davinci_enable_i2c();
+
+ lpsc_on(DAVINCI_LPSC_TIMER1);
+
+ return 0;
+}
+
+int misc_init_r(void)
+{
+ uint8_t video_mode;
+
+ /* DM357 EVM has a jumper to decide between
+ * NTSC and PAL modes. This jumper is read
+ * and the value stored in videostd
+ * This can then be used in the bootargs to pass
+ * information to the driver
+ */
+ i2c_read(0x39, 0x00, 1, &video_mode, 1);
+
+ setenv("videostd", ((video_mode & 0x80) ? "pal" : "ntsc"));
+
+ return 0;
+}
+
diff --git a/include/configs/davinci_dm357_evm.h b/include/configs/davinci_dm357_evm.h
new file mode 100644
index 0000000..96a7bda
--- /dev/null
+++ b/include/configs/davinci_dm357_evm.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2009 Texas Instruments
+ *
+ * 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>
+
+/*
+ *
+ */
+#define DM357_EVM
+#define CONFIG_SYS_NAND_SMALLPAGE
+#define CONFIG_SYS_USE_NAND
+/*
+ * SoC Configuration
+ */
+#define CONFIG_ARM926EJS /* arm926ejs CPU core */
+#define CONFIG_SYS_CLK_FREQ 270000000
+#define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCK 27000000 /* timer frequency */
+#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM644X
+/*
+ * definitions for EEPROM on DM357 EVM
+ */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 20
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN 0x30000
+#define CONFIG_SYS_GBL_DATA_SIZE 128
+#define CONFIG_SYS_MEMTEST_START DAVINCI_DDR_BASE
+#define CONFIG_SYS_MEMTEST_END (DAVINCI_DDR_BASE + 0x1000000)
+#define CONFIG_NR_DRAM_BANKS 1
+#define CONFIG_STACKSIZE 0x40000
+#define PHYS_SDRAM_1 DAVINCI_DDR_BASE
+#define PHYS_SDRAM_1_SIZE (DAVINCI_DDR_BASE + 0x10000000)
+#define DDR_8BANKS
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE -4
+#define CONFIG_SYS_NS16550_COM1 DAVINCI_UART0_BASE
+#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_HZ_CLOCK
+#define CONFIG_SYS_HZ 1000
+#define CONFIG_SOC_DM644X
+/*
+ * definitions for EEPROM on DM357 EVM
+ */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 6
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 20
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN 0x30000
+#define CONFIG_SYS_GBL_DATA_SIZE 128
+#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE /* Input clock */
+#define CONFIG_CONS_INDEX 1 /* use UART0 for console */
+#define CONFIG_BAUDRATE 115200 /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
+/*
+ * I2C Configuration
+ */
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED 80000
+#define CONFIG_SYS_I2C_SLAVE 10
+/*
+ * Flash & Environment
+ */
+#ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
+#undef CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_ENV_IS_IN_NAND /* U-Boot env in NAND Flash */
+#ifdef CONFIG_SYS_NAND_SMALLPAGE
+#define CONFIG_ENV_SECT_SIZE 512 /* Env sector Size */
+#define CONFIG_ENV_SIZE SZ_16K
+#else
+#define CONFIG_ENV_SECT_SIZE 2048 /* Env sector Size */
+#define CONFIG_ENV_SIZE SZ_128K
+#endif
+#define CONFIG_SKIP_LOWLEVEL_INIT /* U-Boot is loaded by a bootloader */
+#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
+#define CONFIG_SYS_NAND_BASE DAVINCI_ASYNC_EMIF_DATA_CE0_BASE
+#define CONFIG_SYS_NAND_HW_ECC
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_ENV_OFFSET 0x0
+#endif
+/*
+ * U-Boot general configuration
+ */
+#undef CONFIG_USE_IRQ /* No IRQ/FIQ in U-Boot */
+#define CONFIG_MISC_INIT_R
+#undef CONFIG_BOOTDELAY
+#define CONFIG_BOOTFILE "uImage" /* Boot file name */
+#define CONFIG_SYS_PROMPT "DM357 EVM > " /* Command Prompt */
+#define CONFIG_SYS_CBSIZE 1024
+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
+ sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS 16
+#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
+#define CONFIG_SYS_LOAD_ADDR 0x80700000
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_CMDLINE_EDITING
+/*
+ * Linux Information
+ */
+#define CONFIG_CMDLINE_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+/*
+ * U-Boot commands
+ */
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_EEPROM
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_JFFS2
+#endif /* __CONFIG_H */
--
1.6.0.4
More information about the U-Boot
mailing list