[U-Boot] [PATCH] ARM DaVinci:Adding DM365 Support

Patch adds support for DaVinci DM365. It does not have the DM9000 like the DM355 but has capability for 4 BIT ECC correction just like DM355. This patch lacks 2 features
1) No 4 BIT ECC correction. We will add support for 4 BIT ECC correction to the NAND driver(davinci_nand.c) soon so that other device like the DM355 can also use this feature. Other TI SOCs like DA830(Primus) not yet part of the U-Boot GIT can also use this once support is added. Some core NAND driver APIs were changed and are being used by TI in our internal releases but those patches were not accepted when posted to the MTD list. So this support will have to wait for some time.
2) I have managed to get EMAC working in my branch but i see that there are patches where the location of the EMAC driver has changed along with a few other changes. The EMAC on all TI SOCs like DM644x, DM6467, DM365 and DA830 is simlar but not the same. So i need to come up with a patch which will enable EMAC to work on all TI SOCs.
Patches for the above features mentioned will be added soon. Patch for 4 BIT ECC correction and EMAC should not take much time to submit but the feature where we change the NAND read APIs to work along with the EMIF 2.3 IP present in latest DaVinci SOCs will take some time.
Signed-off-by: Sandeep Paulraj s-paulraj@ti.com --- MAKEALL | 1 + Makefile | 3 + board/davinci/dm365_evm/Makefile | 52 ++++++++++ board/davinci/dm365_evm/board_init.S | 29 ++++++ board/davinci/dm365_evm/config.mk | 39 ++++++++ board/davinci/dm365_evm/dm365_evm.c | 97 +++++++++++++++++++ board/davinci/dm365_evm/u-boot.lds | 52 ++++++++++ cpu/arm926ejs/davinci/Makefile | 1 + cpu/arm926ejs/davinci/dm365.c | 39 ++++++++ include/asm-arm/arch-davinci/hardware.h | 3 + include/configs/davinci_dm365_evm.h | 155 +++++++++++++++++++++++++++++++ 11 files changed, 471 insertions(+), 0 deletions(-) create mode 100644 board/davinci/dm365_evm/Makefile create mode 100644 board/davinci/dm365_evm/board_init.S create mode 100644 board/davinci/dm365_evm/config.mk create mode 100755 board/davinci/dm365_evm/dm365_evm.c create mode 100644 board/davinci/dm365_evm/u-boot.lds create mode 100644 cpu/arm926ejs/davinci/dm365.c create mode 100644 include/configs/davinci_dm365_evm.h
diff --git a/MAKEALL b/MAKEALL index c65f418..31cbaef 100755 --- a/MAKEALL +++ b/MAKEALL @@ -529,6 +529,7 @@ LIST_ARM9=" \ davinci_sonata \ davinci_dm355evm \ davinci_dm357_evm \ + davinci_dm365_evm \ "
######################################################################### diff --git a/Makefile b/Makefile index fb0ce64..6a8ffa0 100644 --- a/Makefile +++ b/Makefile @@ -2796,6 +2796,9 @@ davinci_dm355evm_config : unconfig davinci_dm357_evm_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs dm357_evm davinci davinci
+davinci_dm365_evm_config : unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs dm365_evm davinci davinci + lpd7a400_config \ lpd7a404_config: unconfig @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x diff --git a/board/davinci/dm365_evm/Makefile b/board/davinci/dm365_evm/Makefile new file mode 100644 index 0000000..a0ed353 --- /dev/null +++ b/board/davinci/dm365_evm/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# Copyright (C) 2007 Sergey Kubushyn ksi@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 := dm365_evm.o +SOBJS := board_init.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) + +clean: + rm -f $(SOBJS) $(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/dm365_evm/board_init.S b/board/davinci/dm365_evm/board_init.S new file mode 100644 index 0000000..22d8adc --- /dev/null +++ b/board/davinci/dm365_evm/board_init.S @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2007 Sergey Kubushyn ksi@koi8.net + * + * Board-specific low level initialization code. Called at the very end + * of cpu/arm926ejs/davinci/lowlevel_init.S. Just returns if there is no + * initialization required. + * + * 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 <config.h> + +.globl dv_board_init +dv_board_init: + + mov pc, lr diff --git a/board/davinci/dm365_evm/config.mk b/board/davinci/dm365_evm/config.mk new file mode 100644 index 0000000..aa89d0e --- /dev/null +++ b/board/davinci/dm365_evm/config.mk @@ -0,0 +1,39 @@ +# +# (C) Copyright 2002 +# Gary Jennejohn, DENX Software Engineering, gj@denx.de +# David Mueller, ELSOFT AG, d.mueller@elsoft.ch +# +# (C) Copyright 2003 +# Texas Instruments, <www.ti.com> +# Swaminathan swami.iyer@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@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/dm365_evm/dm365_evm.c b/board/davinci/dm365_evm/dm365_evm.c new file mode 100755 index 0000000..24b40d0 --- /dev/null +++ b/board/davinci/dm365_evm/dm365_evm.c @@ -0,0 +1,97 @@ +/* + * + * 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 <asm/arch/i2c_defs.h> + +/******************************************* + Routine: board_init + Description: Board Initialization routine +*******************************************/ +int board_init(void) +{ + DECLARE_GLOBAL_DATA_PTR; + + /* arch number of DaVinci DM365 */ + gd->bd->bi_arch_number = 1939; + + /* adress of boot parameters */ + gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR; + + /* Set the Bus Priority Register to appropriate value */ + REG(VBPR) = 0x20; + + timer_init(); + + return 0; +} + + +/****************************** + Routine: misc_init_r + Description: Misc. init +******************************/ +int misc_init_r(void) +{ + int i; + u_int8_t tmp[20], buf[10]; + + /* Set Ethernet MAC address from EEPROM */ + if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x7f00, + CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buf, 6)) { + printf("\nEEPROM @ 0x%02x read FAILED!!!\n", + CONFIG_SYS_I2C_EEPROM_ADDR); + } else { + tmp[0] = 0xff; + for (i = 0; i < 6; i++) + tmp[0] &= buf[i]; + + if ((tmp[0] != 0xff) && (getenv("ethaddr") == NULL)) { + sprintf((char *)&tmp[0], + "%02x:%02x:%02x:%02x:%02x:%02x", buf[0], + buf[1], buf[2], buf[3], buf[4], buf[5]); + setenv("ethaddr", (char *)&tmp[0]); + } + } + + if (!eth_hw_init()) + printf("ethernet init failed!\n"); + + return 0; +} + +/****************************** + Routine: dram_init + Description: Memory Info +******************************/ +int dram_init(void) +{ + DECLARE_GLOBAL_DATA_PTR; + + gd->bd->bi_dram[0].start = PHYS_SDRAM_1; + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + + return 0; +} + diff --git a/board/davinci/dm365_evm/u-boot.lds b/board/davinci/dm365_evm/u-boot.lds new file mode 100644 index 0000000..4d50f2c --- /dev/null +++ b/board/davinci/dm365_evm/u-boot.lds @@ -0,0 +1,52 @@ +/* + * (C) Copyright 2002 + * Gary Jennejohn, DENX Software Engineering, gj@denx.de + * + * 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 + */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + . = 0x00000000; + . = ALIGN(4); + .text : + { + cpu/arm926ejs/start.o (.text) + *(.text) + } + . = ALIGN(4); + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } + . = ALIGN(4); + .data : { *(.data) } + . = ALIGN(4); + .got : { *(.got) } + + . = .; + __u_boot_cmd_start = .; + .u_boot_cmd : { *(.u_boot_cmd) } + __u_boot_cmd_end = .; + + . = ALIGN(4); + __bss_start = .; + .bss (NOLOAD) : { *(.bss) . = ALIGN(4); } + _end = .; +} diff --git a/cpu/arm926ejs/davinci/Makefile b/cpu/arm926ejs/davinci/Makefile index dee5be4..96e495a 100644 --- a/cpu/arm926ejs/davinci/Makefile +++ b/cpu/arm926ejs/davinci/Makefile @@ -30,6 +30,7 @@ LIB = $(obj)lib$(SOC).a COBJS-y += timer.o psc.o COBJS-$(CONFIG_SOC_DM355) += dm355.o COBJS-$(CONFIG_SOC_DM644X) += dm644x.o +COBJS-$(CONFIG_SOC_DM365) += dm365.o COBJS-$(CONFIG_DRIVER_TI_EMAC) += ether.o lxt972.o dp83848.o
SOBJS = reset.o diff --git a/cpu/arm926ejs/davinci/dm365.c b/cpu/arm926ejs/davinci/dm365.c new file mode 100644 index 0000000..01efb34 --- /dev/null +++ b/cpu/arm926ejs/davinci/dm365.c @@ -0,0 +1,39 @@ +/* + * TI DM365 SOC specific code + * + * Copyright (C) 2009 Texas Instruments + * + * 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 <asm/arch/hardware.h> + + +void davinci_enable_uart0(void) +{ + lpsc_on(DAVINCI_LPSC_UART0); +} + + +#ifdef CONFIG_DRIVER_DAVINCI_I2C +void davinci_enable_i2c(void) +{ + lpsc_on(DAVINCI_LPSC_I2C); +} +#endif diff --git a/include/asm-arm/arch-davinci/hardware.h b/include/asm-arm/arch-davinci/hardware.h index a28cfb4..d38ab72 100644 --- a/include/asm-arm/arch-davinci/hardware.h +++ b/include/asm-arm/arch-davinci/hardware.h @@ -99,6 +99,9 @@ typedef volatile unsigned int * dv_reg_p; #define DAVINCI_ASYNC_EMIF_CNTRL_BASE 0x01e10000 #define DAVINCI_MMC_SD0_BASE 0x01e11000
+#elif defined(CONFIG_SOC_DM365) +#define DAVINCI_ASYNC_EMIF_CNTRL_BASE 0x01d10000 + #endif
/* Power and Sleep Controller (PSC) Domains */ diff --git a/include/configs/davinci_dm365_evm.h b/include/configs/davinci_dm365_evm.h new file mode 100644 index 0000000..a3a5016 --- /dev/null +++ b/include/configs/davinci_dm365_evm.h @@ -0,0 +1,155 @@ +/* + * (C) Copyright 2009 + * Texas Instruments Inc. + * Configuation settings for the TI Davinci DM365 EVM board. + * + * 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 +#include <asm/sizes.h> + +/*=======*/ +/* Board */ +/*=======*/ +#define CFG_DM365_EVM +#define CONFIG_SYS_USE_NAND +#define CONFIG_SOC_DM365 +/*===================*/ +/* SoC Configuration */ +/*===================*/ +#define CONFIG_ARM926EJS /* arm926ejs CPU core */ +#define CONFIG_SYS_CLK_FREQ 297000000 /* Arm Clock frequency */ +#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */ +#define CONFIG_SYS_HZ_CLOCK 24000000 +#define CONFIG_SYS_HZ 1000 +/*====================================================*/ +/* EEPROM definitions for the DM365 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 (0x40000 + 128*1024) +#define CONFIG_SYS_GBL_DATA_SIZE 128 +#define CONFIG_SYS_MEMTEST_START 0x82000000 +#define CONFIG_SYS_MEMTEST_END 0x90000000 +#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ +#define CONFIG_STACKSIZE (256*1024) /* regular stack */ +#define PHYS_SDRAM_1 0x80000000 /* DDR Start */ +#define PHYS_SDRAM_1_SIZE 0x8000000 /* DDR size 128MB */ +/*====================*/ +/* Serial Driver info */ +/*====================*/ +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM1 0x01c20000 /* Base address of UART0 */ +#define CONFIG_SYS_NS16550_CLK 24000000 +#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 100000 +#define CONFIG_SYS_I2C_SLAVE 10 +/*==================================*/ +/* Network & Ethernet Configuration */ +/*==================================*/ +#define CONFIG_DRIVER_TI_EMAC +#define CONFIG_MII +#define CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_DNS2 +#define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_NET_RETRY_COUNT 10 +/*=====================*/ +/* Flash & Environment */ +/*=====================*/ +#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 */ +#define CONFIG_ENV_SECT_SIZE 0x40000 /* Env sector Size */ +#define CONFIG_ENV_SIZE SZ_256K +#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 0x02000000 +#define CONFIG_SYS_NAND_HW_ECC +#define CONFIG_SYS_MAX_NAND_DEVICE 2 +#define CONFIG_ENV_OFFSET 0x3C0000 +#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \ + CONFIG_SYS_NAND_BASE + 0x4000} +#define DEF_BOOTM "" +/*==============================*/ +/* U-Boot general configuration */ +/*==============================*/ +#undef CONFIG_USE_IRQ /* No IRQ/FIQ in U-Boot */ +#define CONFIG_MISC_INIT_R +#define CONFIG_BOOTDELAY 4 +#define CONFIG_BOOTFILE "uImage" /* Boot file name */ +#define CONFIG_SYS_PROMPT "DM365 EVM > " +#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 LINUX_BOOT_PARAM_ADDR 0x80000100 +#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 +/*=======================*/ +/* KGDB support (if any) */ +/*=======================*/ +#ifdef CONFIG_CMD_KGDB +#define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */ +#define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */ +#endif +#endif /* __CONFIG_H */

On 12:19 Wed 29 Apr , s-paulraj@ti.com wrote:
Patch adds support for DaVinci DM365. It does not have the DM9000 like the DM355 but has capability for 4 BIT ECC correction just like DM355. This patch lacks 2 features
No 4 BIT ECC correction. We will add support for 4 BIT ECC correction to the NAND driver(davinci_nand.c) soon so that other device like the DM355 can also use this feature. Other TI SOCs like DA830(Primus) not yet part of the U-Boot GIT can also use this once support is added. Some core NAND driver APIs were changed and are being used by TI in our internal releases but those patches were not accepted when posted to the MTD list. So this support will have to wait for some time.
I have managed to get EMAC working in my branch but i see that there are patches where the location of the EMAC driver has changed along with a few other changes. The EMAC on all TI SOCs like DM644x, DM6467, DM365 and DA830 is simlar but not the same. So i need to come up with a patch which will enable EMAC to work on all TI SOCs.
Patches for the above features mentioned will be added soon. Patch for 4 BIT ECC correction and EMAC should not take much time to submit but the feature where we change the NAND read APIs to work along with the EMIF 2.3 IP present in latest DaVinci SOCs will take some time.
I'm not sure you really want all this comment will be in the final commit message
Signed-off-by: Sandeep Paulraj s-paulraj@ti.com
MAKEALL | 1 + Makefile | 3 + board/davinci/dm365_evm/Makefile | 52 ++++++++++ board/davinci/dm365_evm/board_init.S | 29 ++++++ board/davinci/dm365_evm/config.mk | 39 ++++++++ board/davinci/dm365_evm/dm365_evm.c | 97 +++++++++++++++++++ board/davinci/dm365_evm/u-boot.lds | 52 ++++++++++ cpu/arm926ejs/davinci/Makefile | 1 + cpu/arm926ejs/davinci/dm365.c | 39 ++++++++ include/asm-arm/arch-davinci/hardware.h | 3 + include/configs/davinci_dm365_evm.h | 155 +++++++++++++++++++++++++++++++ 11 files changed, 471 insertions(+), 0 deletions(-) create mode 100644 board/davinci/dm365_evm/Makefile create mode 100644 board/davinci/dm365_evm/board_init.S create mode 100644 board/davinci/dm365_evm/config.mk create mode 100755 board/davinci/dm365_evm/dm365_evm.c create mode 100644 board/davinci/dm365_evm/u-boot.lds create mode 100644 cpu/arm926ejs/davinci/dm365.c create mode 100644 include/configs/davinci_dm365_evm.h
diff --git a/MAKEALL b/MAKEALL index c65f418..31cbaef 100755 --- a/MAKEALL +++ b/MAKEALL @@ -529,6 +529,7 @@ LIST_ARM9=" \ davinci_sonata \ davinci_dm355evm \ davinci_dm357_evm \
- davinci_dm365_evm \
"
######################################################################### diff --git a/Makefile b/Makefile index fb0ce64..6a8ffa0 100644 --- a/Makefile +++ b/Makefile @@ -2796,6 +2796,9 @@ davinci_dm355evm_config : unconfig davinci_dm357_evm_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs dm357_evm davinci davinci
+davinci_dm365_evm_config : unconfig
- @$(MKCONFIG) $(@:_config=) arm arm926ejs dm365_evm davinci davinci
lpd7a400_config \ lpd7a404_config: unconfig @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x diff --git a/board/davinci/dm365_evm/Makefile b/board/davinci/dm365_evm/Makefile new file mode 100644 index 0000000..a0ed353 --- /dev/null +++ b/board/davinci/dm365_evm/Makefile @@ -0,0 +1,52 @@ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# Copyright (C) 2007 Sergey Kubushyn ksi@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 := dm365_evm.o +SOBJS := board_init.o
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS))
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+clean:
- rm -f $(SOBJS) $(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/dm365_evm/board_init.S b/board/davinci/dm365_evm/board_init.S new file mode 100644 index 0000000..22d8adc --- /dev/null +++ b/board/davinci/dm365_evm/board_init.S @@ -0,0 +1,29 @@ +/*
- Copyright (C) 2007 Sergey Kubushyn ksi@koi8.net
- Board-specific low level initialization code. Called at the very end
- of cpu/arm926ejs/davinci/lowlevel_init.S. Just returns if there is no
- initialization required.
- 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 <config.h>
+.globl dv_board_init +dv_board_init:
- mov pc, lr
diff --git a/board/davinci/dm365_evm/config.mk b/board/davinci/dm365_evm/config.mk new file mode 100644 index 0000000..aa89d0e --- /dev/null +++ b/board/davinci/dm365_evm/config.mk @@ -0,0 +1,39 @@ +# +# (C) Copyright 2002 +# Gary Jennejohn, DENX Software Engineering, gj@denx.de +# David Mueller, ELSOFT AG, d.mueller@elsoft.ch +# +# (C) Copyright 2003 +# Texas Instruments, <www.ti.com> +# Swaminathan swami.iyer@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@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/dm365_evm/dm365_evm.c b/board/davinci/dm365_evm/dm365_evm.c new file mode 100755 index 0000000..24b40d0 --- /dev/null +++ b/board/davinci/dm365_evm/dm365_evm.c @@ -0,0 +1,97 @@ +/*
- 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 <asm/arch/i2c_defs.h>
+/*******************************************
- Routine: board_init
- Description: Board Initialization routine
+*******************************************/ +int board_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
- /* arch number of DaVinci DM365 */
- gd->bd->bi_arch_number = 1939;
please use match type
- /* adress of boot parameters */
- gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
please use RAM_BASE + 0x100 style as the other arm boards
- /* Set the Bus Priority Register to appropriate value */
- REG(VBPR) = 0x20;
- timer_init();
no need please remove
- return 0;
+}
+/******************************
- Routine: misc_init_r
- Description: Misc. init
+******************************/ +int misc_init_r(void) +{
- int i;
- u_int8_t tmp[20], buf[10];
- /* Set Ethernet MAC address from EEPROM */
- if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x7f00,
CONFIG_SYS_I2C_EEPROM_ADDR_LEN, buf, 6)) {
printf("\nEEPROM @ 0x%02x read FAILED!!!\n",
CONFIG_SYS_I2C_EEPROM_ADDR);
- } else {
tmp[0] = 0xff;
for (i = 0; i < 6; i++)
tmp[0] &= buf[i];
if ((tmp[0] != 0xff) && (getenv("ethaddr") == NULL)) {
sprintf((char *)&tmp[0],
"%02x:%02x:%02x:%02x:%02x:%02x", buf[0],
buf[1], buf[2], buf[3], buf[4], buf[5]);
setenv("ethaddr", (char *)&tmp[0]);
}
- }
Mike up the ethaddr api please took a look doc/README.enetaddr
- if (!eth_hw_init())
printf("ethernet init failed!\n");
if it's board specific please implement board_eth_init otherwise cpu_eth_init and please take a look on the last ben patches about it
- return 0;
+}
+/******************************
- Routine: dram_init
- Description: Memory Info
+******************************/ +int dram_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
- gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
- return 0;
+}
diff --git a/board/davinci/dm365_evm/u-boot.lds b/board/davinci/dm365_evm/u-boot.lds new file mode 100644 index 0000000..4d50f2c --- /dev/null +++ b/board/davinci/dm365_evm/u-boot.lds
as mention on other patch the davinci seems to use all the same lds please unify it
@@ -0,0 +1,52 @@ +/*
- (C) Copyright 2002
- Gary Jennejohn, DENX Software Engineering, gj@denx.de
- 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
+#ifndef __CONFIG_H +#define __CONFIG_H +#include <asm/sizes.h>
+/*=======*/ +/* Board */ +/*=======*/
please use this multiline comment style /* * */
+#define CFG_DM365_EVM +#define CONFIG_SYS_USE_NAND +#define CONFIG_SOC_DM365 +/*===================*/ +/* SoC Configuration */ +/*===================*/ +#define CONFIG_ARM926EJS /* arm926ejs CPU core */ +#define CONFIG_SYS_CLK_FREQ 297000000 /* Arm Clock frequency */ +#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */ +#define CONFIG_SYS_HZ_CLOCK 24000000 +#define CONFIG_SYS_HZ 1000 +/*====================================================*/ +/* EEPROM definitions for the DM365 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 (0x40000 + 128*1024) +#define CONFIG_SYS_GBL_DATA_SIZE 128 +#define CONFIG_SYS_MEMTEST_START 0x82000000 +#define CONFIG_SYS_MEMTEST_END 0x90000000 +#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ +#define CONFIG_STACKSIZE (256*1024) /* regular stack */
please add a space before and after '*'
+#define PHYS_SDRAM_1 0x80000000 /* DDR Start */ +#define PHYS_SDRAM_1_SIZE 0x8000000 /* DDR size 128MB */ +/*====================*/ +/* Serial Driver info */ +/*====================*/ +#define CONFIG_SYS_NS16550 +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE -4 +#define CONFIG_SYS_NS16550_COM1 0x01c20000 /* Base address of UART0 */ +#define CONFIG_SYS_NS16550_CLK 24000000
CONFIG_SYS_HZ_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 100000 +#define CONFIG_SYS_I2C_SLAVE 10 +/*==================================*/ +/* Network & Ethernet Configuration */ +/*==================================*/ +#define CONFIG_DRIVER_TI_EMAC
please take a look on ben patch
+#define CONFIG_MII +#define CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_DNS2 +#define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_NET_RETRY_COUNT 10 +/*=====================*/ +/* Flash & Environment */ +/*=====================*/ +#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 */ +#define CONFIG_ENV_SECT_SIZE 0x40000 /* Env sector Size */ +#define CONFIG_ENV_SIZE SZ_256K +#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 0x02000000 +#define CONFIG_SYS_NAND_HW_ECC +#define CONFIG_SYS_MAX_NAND_DEVICE 2 +#define CONFIG_ENV_OFFSET 0x3C0000 +#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
^^^^^^ whitespace please fix
CONFIG_SYS_NAND_BASE + 0x4000}
+#define DEF_BOOTM ""
???
+/*==============================*/ +/* U-Boot general configuration */ +/*==============================*/
Best Regards, J.

Hi J-C,
On Wed, Apr 29, 2009 at 10:54 PM, Jean-Christophe PLAGNIOL-VILLARD < plagnioj@jcrosoft.com> wrote: <snip>
+/*==================================*/ +/* Network & Ethernet Configuration */ +/*==================================*/ +#define CONFIG_DRIVER_TI_EMAC
please take a look on ben patch
+#define CONFIG_MII +#define CONFIG_BOOTP_DEFAULT +#define CONFIG_BOOTP_DNS +#define CONFIG_BOOTP_DNS2 +#define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_NET_RETRY_COUNT 10
It has to be this way for now - if he adds CONFIG_NET_MULTI there will be no Ethernet. I think we should take Dave B's advice and use an overall 'next' branch so the ARM and net stuff can be in sync. Maybe Wolfgang will create one if we ask really nicely :)
regards, Ben

On 23:05 Wed 29 Apr , Ben Warren wrote:
Hi J-C,
On Wed, Apr 29, 2009 at 10:54 PM, Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com wrote:
<snip>
> +/*==================================*/ > +/* Network & Ethernet Configuration */ > +/*==================================*/ > +#define CONFIG_DRIVER_TI_EMAC please take a look on ben patch > +#define CONFIG_MII > +#define CONFIG_BOOTP_DEFAULT > +#define CONFIG_BOOTP_DNS > +#define CONFIG_BOOTP_DNS2 > +#define CONFIG_BOOTP_SEND_HOSTNAME > +#define CONFIG_NET_RETRY_COUNT 10
It has to be this way for now - if he adds CONFIG_NET_MULTI there will be no Ethernet.
As I've said in your patch thread I've in mind to appy your patch first
I think we should take Dave B's advice and use an overall 'next' branch so the ARM and net stuff can be in sync. Maybe Wolfgang will create one if we ask really nicely :)
sure
Wolfgang could help us on this?
Best Regards, J.

Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090430061736.GD31304@game.jcrosoft.org you wrote:
I think we should take Dave B's advice and use an overall 'next' branch so the ARM and net stuff can be in sync. Maybe Wolfgang will create one if we ask really nicely :)
sure
Wolfgang could help us on this?
You mean like that:
http://git.denx.de/?p=u-boot.git;a=shortlog;h=refs/heads/next
?
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Sat, May 2, 2009 at 2:46 PM, Wolfgang Denk wd@denx.de wrote:
Dear Jean-Christophe PLAGNIOL-VILLARD,
In message 20090430061736.GD31304@game.jcrosoft.org you wrote:
I think we should take Dave B's advice and use an overall 'next' branch so the ARM and net stuff can be in sync. Maybe
Wolfgang
will create one if we ask really nicely :)
sure
Wolfgang could help us on this?
You mean like that:
http://git.denx.de/?p=u-boot.git;a=shortlog;h=refs/heads/next
?
I'm sorry, I looked before sending this e-mail, but must have been looking in the wrong place. Of course this is exactly what we need and I apologize for the noise.
Best regards,
Wolfgang Denk
regards, Ben
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de It is practically impossible to teach good programming style to stu- dents that have had prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. - Dijkstra

Dear Ben Warren,
In message f8328f7c0905021949w5e8a050cg98e34ab05b43659b@mail.gmail.com you wrote:
Wolfgang could help us on this?
You mean like that:
http://git.denx.de/?p=u-boot.git;a=shortlog;h=refs/heads/next
?
I'm sorry, I looked before sending this e-mail, but must have been looking in the wrong place. Of course this is exactly what we need and I apologize for the noise.
You have not been looking at the wrong place. I created the branch upon your request. Maybe my words to inform you about this were ill chosen. Sorry.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Sun, May 3, 2009 at 1:52 PM, Wolfgang Denk wd@denx.de wrote:
Dear Ben Warren,
In message f8328f7c0905021949w5e8a050cg98e34ab05b43659b@mail.gmail.com you wrote:
Wolfgang could help us on this?
You mean like that:
http://git.denx.de/?p=u-boot.git;a=shortlog;h=refs/heads/next
?
I'm sorry, I looked before sending this e-mail, but must have been
looking
in the wrong place. Of course this is exactly what we need and I
apologize
for the noise.
You have not been looking at the wrong place. I created the branch upon your request. Maybe my words to inform you about this were ill chosen. Sorry.
No worries. Thanks for doing this!
Best regards,
Wolfgang Denk
regards, Ben
participants (4)
-
Ben Warren
-
Jean-Christophe PLAGNIOL-VILLARD
-
s-paulraj@ti.com
-
Wolfgang Denk