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

Patch adds support for DaVinci DM357. This SOC is very similar to the DM644x. The DM357 EVM has 2 NANDs, one small page NAND and another large page NAND. But the device can only boot of the small page NAND. It does not have NOR support. This patch has been tested on the DM357 EVM.
Signed-off-by: Sandeep Paulraj s-paulraj@ti.com --- Makefile | 3 + include/configs/davinci_dm357_evm.h | 159 +++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 0 deletions(-) create mode 100644 include/configs/davinci_dm357_evm.h
diff --git a/Makefile b/Makefile index c52894c..81d6759 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 dvevm davinci davinci + lpd7a400_config \ lpd7a404_config: unconfig @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x diff --git a/include/configs/davinci_dm357_evm.h b/include/configs/davinci_dm357_evm.h new file mode 100644 index 0000000..f129b67 --- /dev/null +++ b/include/configs/davinci_dm357_evm.h @@ -0,0 +1,159 @@ +/* + * 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> + +/*=======*/ +/* Board */ +/*=======*/ +#define DV_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 /* Arm Clock frequency */ +#define CONFIG_SYS_TIMERBASE 0x01c21400 /* use timer 0 */ +#define CONFIG_SYS_HZ_CLOCK 27000000 +#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 (0x10000 + 128*1024) +#define CONFIG_SYS_GBL_DATA_SIZE 128 +#define CONFIG_SYS_MEMTEST_START 0x80000000 /* memtest start */ +#define CONFIG_SYS_MEMTEST_END 0x81000000 /* 16MB RAM test */ +#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 0x10000000 /* DDR size 256MB */ +#define DDR_8BANKS /* 8-bank DDR2 (256MB) */ +/*====================*/ +/* 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 27000000 /* 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 +/*==================================*/ +/* 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 */ +/*=====================*/ +#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 0x02000000 +#define CONFIG_SYS_NAND_HW_ECC +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_MASK_CLE 0x10 +#define CONFIG_MASK_ALE 0x08 +#define CONFIG_ENV_OFFSET 0x0 +#define DEF_BOOTM "" +#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 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 Tuesday 28 April 2009, s-paulraj@ti.com wrote:
Patch adds support for DaVinci DM357. This SOC is very similar to the DM644x. The DM357 EVM has 2 NANDs, one small page NAND and another large page NAND. But the device can only boot of the small page NAND. It does not have NOR support. This patch has been tested on the DM357 EVM.
So this initial U-Boot support only supports the smaller of the two NAND chips, and access to the second one is only after booting to the operating system?
I'd have liked to see the NAND driver updates needed to support the chipselect of the second NAND chip, and use it with HW ECC.
- Dave

Dave, We can add such support/enhancements later. The patch as such will work for sure. In our LSPs we can use only one NAND at a time. We do not at this point of time have support even in the kernel where both NANDs can be used at the same time. Its only either of the 2.
Thanks, Sandeep
-----Original Message----- From: David Brownell [mailto:david-b@pacbell.net] Sent: Tuesday, April 28, 2009 5:57 PM To: Paulraj, Sandeep; u-boot@lists.denx.de Cc: davinci-linux-open-source@linux.davincidsp.com Subject: Re: [PATCH] ARM DaVinci: Adding DM357 Support
On Tuesday 28 April 2009, s-paulraj@ti.com wrote:
Patch adds support for DaVinci DM357. This SOC is very similar to the
DM644x.
The DM357 EVM has 2 NANDs, one small page NAND and another large page
NAND.
But the device can only boot of the small page NAND. It does not have
NOR
support. This patch has been tested on the DM357 EVM.
So this initial U-Boot support only supports the smaller of the two NAND chips, and access to the second one is only after booting to the operating system?
I'd have liked to see the NAND driver updates needed to support the chipselect of the second NAND chip, and use it with HW ECC.
- Dave

On Tuesday 28 April 2009, Paulraj, Sandeep wrote:
Dave, We can add such support/enhancements later. The patch as such will work for sure.
OK, I can understand that. This board seems to have the most complex NAND config of the DaVinci EVMs.
In our LSPs we can use only one NAND at a time. We do not at this point of time have support even in the kernel where both NANDs can be used at the same time. Its only either of the 2.
And for that matter, even the DaVinci GIT tree doesn't yet support this board ... much less mainline Linux!
I believe the current NAND driver (in 2.6.30-rc) should handle this fine, though.
- Dave
Thanks, Sandeep
-----Original Message----- From: David Brownell [mailto:david-b@pacbell.net] Sent: Tuesday, April 28, 2009 5:57 PM To: Paulraj, Sandeep; u-boot@lists.denx.de Cc: davinci-linux-open-source@linux.davincidsp.com Subject: Re: [PATCH] ARM DaVinci: Adding DM357 Support
...
So this initial U-Boot support only supports the smaller of the two NAND chips, and access to the second one is only after booting to the operating system?
I'd have liked to see the NAND driver updates needed to support the chipselect of the second NAND chip, and use it with HW ECC.
- Dave

On Tuesday 28 April 2009, s-paulraj@ti.com wrote:
Makefile | 3 + include/configs/davinci_dm357_evm.h | 159 +++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 0 deletions(-)
I believe that will be insufficient with the current U-Boot arm-next branch. Won't you also be needing a cpu/arm926ejs/davinci/dm357.c file to handle the various ways it differs from a dm6446 chip?

Dave, What I have done is sufficient. A 'dm357.c' file will not be required as the dm644x.c file will take care of everything. AS long as your patches ensure that dm644x works, the DM357 will work. This is because DM357 is very similar to the DM644x. If you want me to put a dm357 file then I will have to make an exact copy of the Dm6446 file. Similarly if you want me to keep a Dm357 folder in the board/davinci folder I will copy everything from the dvevm folder.
Thanks, Sandeep
-----Original Message----- From: David Brownell [mailto:david-b@pacbell.net] Sent: Tuesday, April 28, 2009 6:00 PM To: Paulraj, Sandeep; u-boot@lists.denx.de Cc: davinci-linux-open-source@linux.davincidsp.com Subject: Re: [PATCH] ARM DaVinci: Adding DM357 Support
On Tuesday 28 April 2009, s-paulraj@ti.com wrote:
Makefile | 3 + include/configs/davinci_dm357_evm.h | 159
+++++++++++++++++++++++++++++++++++
2 files changed, 162 insertions(+), 0 deletions(-)
I believe that will be insufficient with the current U-Boot arm-next branch. Won't you also be needing a cpu/arm926ejs/davinci/dm357.c file to handle the various ways it differs from a dm6446 chip?
participants (3)
-
David Brownell
-
Paulraj, Sandeep
-
s-paulraj@ti.com