This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1705, U-boot and NAND

Other Parts Discussed in Thread: AM1705

Hello. I am use custom board based on AM1705. When i compiling U-boot with defination CONFIG_USE_ NAND (da830_evm.h), then U-boot loading but don't launching (not answer when i hit enter in HyperTerminal). When compiling u-boot with undef   CONFIG_USE_ NAND, then U-boot launching and work. When i defintation CONFIG_USE_SPIFLASH, U-boot work too. What i can doing for work with NAND from U-boot (write, erase etc.)?

I am using DaVinci SDK 3.20....14, AISGen GUI and UartBoot Host. In AISGen boot mode select as UART2, configuration for console on UART2 too.

  • Pavel,

    You may need to remove support for NOR flash when trying to add support for NAND.  I would expect this would require undef'ing or commenting part of the config header file, but I don't have it in front of me, so I'm not sure.  Also, as you are moving to a custom platform, do not be surprised to discover that u-boot will have to be customized to get it to work correctly (though the fact that the SPI version works may mean that changes will be minimal).

    This link refers to CONFIG_SYS_USE_NAND in the config file.  Is that the #define you are changing?

    Regards, Daniel

  •  

    Daniel Allred said:

    You may need to remove support for NOR flash when trying to add support for NAND.  I would expect this would require undef'ing or commenting part of the config header file, but I don't have it in front of me, so I'm not sure.

    Ii'm did this. My variant of configuration file in link below. In default variant NOR flash and NAND didnt using, using only SPI Flash.

    /*
     * Copyright (C) 2008 Texas Instruments, Inc <www.ti.com>
     *
     * Based on davinci_dvevm.h. Original Copyrights follow:
     *
     * Copyright (C) 2007 Sergey Kubushyn <ksi@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
    
    /*
     * Board
     */
    /* default version
    #define	CONFIG_USE_SPIFLASH 
    #undef	CONFIG_USE_NAND
    */
    #undef	CONFIG_USE_SPIFLASH 
    #define	CONFIG_USE_NAND
    #undef CONFIG_USE_NOR
    /*
     * SoC Configuration
     */
    #define CONFIG_MACH_DAVINCI_DA830_EVM
    #define CONFIG_ARM926EJS		/* arm926ejs CPU core */
    #define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
    #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
    #define CONFIG_SYS_OSCIN_FREQ		24000000
    #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
    #define CONFIG_SYS_HZ_CLOCK		clk_get(DAVINCI_AUXCLK_CLKID)
    #define CONFIG_SYS_HZ			1000
    #define CONFIG_SKIP_LOWLEVEL_INIT
    #define CONFIG_SKIP_RELOCATE_UBOOT	/* to a proper address, init done */
    
    /*
     * Memory Info
     */
    #define CONFIG_SYS_MALLOC_LEN	(0x10000 + 1*1024*1024) /* malloc() len */
    #define CONFIG_SYS_GBL_DATA_SIZE	128 /* reserved for initial data */
    #define PHYS_SDRAM_1		DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
    #define PHYS_SDRAM_1_SIZE	(64 << 20) /* SDRAM size 64MB */
    #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1 + 0x2000000 /* memtest start addr */
    #define CONFIG_SYS_MEMTEST_END 	(PHYS_SDRAM_1 + 0x2000000 + 32*1024*1024) /* 32MB test */
    #define CONFIG_NR_DRAM_BANKS	1 /* we have 1 bank of DRAM */
    #define CONFIG_STACKSIZE	(256*1024) /* regular stack */
    
    /*
     * Serial Driver info
     */
    #define CONFIG_SYS_NS16550
    #define CONFIG_SYS_NS16550_SERIAL
    #define CONFIG_SYS_NS16550_REG_SIZE	-4	/* NS16550 register size */
    #define CONFIG_SYS_NS16550_COM3	DAVINCI_UART2_BASE /* Base address of UART2 */
    #define CONFIG_SYS_NS16550_CLK	clk_get(DAVINCI_UART2_CLKID)
    #define CONFIG_CONS_INDEX	3		/* use UART2 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		25000 /* 100Kbps won't work, H/W bug */
    #define CONFIG_SYS_I2C_SLAVE		10 /* Bogus, master-only in U-Boot */
    
    /*
     * I2C EEPROM definitions for catalyst 24W256 EEPROM chip
     */
    #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
    
    /*
     * Network & Ethernet Configuration
     */
    #define	CONFIG_DRIVER_TI_EMAC
    #ifdef CONFIG_DRIVER_TI_EMAC
    #define CONFIG_MII
    #define CONFIG_DRIVER_TI_EMAC_USE_RMII
    #define CONFIG_BOOTP_DEFAULT
    #define CONFIG_BOOTP_DNS
    #define CONFIG_BOOTP_DNS2
    #define CONFIG_BOOTP_SEND_HOSTNAME
    #define CONFIG_NET_RETRY_COUNT	10
    #define CONFIG_NET_MULTI
    #endif
    
    /*
     * Flash & Environment
     */
    #ifdef CONFIG_USE_NAND
    #undef CONFIG_ENV_IS_IN_FLASH
    #define CONFIG_NAND_DAVINCI
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
    #define CONFIG_ENV_OFFSET		0x0 /* Block 0--not used by bootcode */
    #define CONFIG_ENV_SIZE			(128 << 10)
    #define	CONFIG_SYS_NAND_USE_FLASH_BBT
    #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
    #define	CONFIG_SYS_NAND_PAGE_2K
    #define CONFIG_SYS_NAND_CS		2
    #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
    #define CONFIG_SYS_CLE_MASK		0x10
    #define CONFIG_SYS_ALE_MASK		0x8
    #undef CONFIG_SYS_NAND_HW_ECC
    #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
    #define NAND_MAX_CHIPS			1
    #define DEF_BOOTM			""
    #endif
    
    #ifdef CONFIG_USE_NOR
    #define CONFIG_ENV_IS_IN_FLASH
    #undef CONFIG_SYS_NO_FLASH
    #define CONFIG_SYS_FLASH_CFI_DRIVER
    #define CONFIG_SYS_FLASH_CFI
    #define CONFIG_SYS_MAX_FLASH_BANKS	1 /* max number of flash banks */
    #define CONFIG_SYS_FLASH_SECT_SZ	(64 << 10) /* 64KB */
    #define CONFIG_ENV_OFFSET		(CONFIG_SYS_FLASH_SECT_SZ*3)
    #define CONFIG_SYS_FLASH_BASE		DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
    #define PHYS_FLASH_SIZE			(32 << 20) /* Flash size 32MB */
    #define CONFIG_SYS_MAX_FLASH_SECT (PHYS_FLASH_SIZE/CONFIG_SYS_FLASH_SECT_SZ)
    #define CONFIG_ENV_SECT_SIZE		CONFIG_SYS_FLASH_SECT_SZ
    #define CONFIG_SYS_FLASH_SPL_ACCESS
    #endif
    
    #ifdef CONFIG_USE_SPIFLASH
    #undef CONFIG_ENV_IS_IN_FLASH
    #undef CONFIG_ENV_IS_IN_NAND
    #define CONFIG_ENV_IS_IN_SPI_FLASH
    #define CONFIG_ENV_SIZE			(16 << 10)
    #define CONFIG_ENV_OFFSET		(256 << 10)
    #define CONFIG_ENV_SECT_SIZE		4096
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_SPI
    #define CONFIG_SPI_FLASH
    #define CONFIG_SPI_FLASH_WINBOND
    #define CONFIG_DAVINCI_SPI
    #define CONFIG_SYS_SPI_BASE		DAVINCI_SPI0_BASE
    #define CONFIG_SYS_SPI_CLK		clk_get(DAVINCI_SPI0_CLKID)
    #define CONFIG_SF_DEFAULT_SPEED		30000000
    #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
    #endif
    
    /*
     * USB configuration
     */
    #undef CONFIG_USB_DA8XX	/* Platform hookup to MUSB controller */
    #undef CONFIG_MUSB_HCD
    
    /*
     * 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	"U-Boot > " /* Command Prompt */
    #define CONFIG_SYS_CBSIZE	1024 /* Console I/O Buffer Size	*/
    #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
    #define CONFIG_SYS_MAXARGS	16 /* max number of command args */
    #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE /* Boot Args Buffer Size */
    #define CONFIG_SYS_LOAD_ADDR	(PHYS_SDRAM_1 + 0x700000)
    #define CONFIG_VERSION_VARIABLE
    #define CONFIG_AUTO_COMPLETE	/* Won't work with hush so far, may be later */
    #define CONFIG_SYS_HUSH_PARSER
    #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
    #define CONFIG_CMDLINE_EDITING
    #define CONFIG_SYS_LONGHELP
    #define CONFIG_CRC32_VERIFY
    #define CONFIG_MX_CYCLIC
    
    /*
     * Linux Information
     */
    #define LINUX_BOOT_PARAM_ADDR	(PHYS_SDRAM_1 + 0x100)
    #define CONFIG_CMDLINE_TAG
    #define CONFIG_SETUP_MEMORY_TAGS
    #define CONFIG_BOOTARGS		"mem=32M console=ttyS2,115200n8 root=/dev/mmcblk0p1 rw rootwait ip=off"
    #define CONFIG_BOOTCOMMAND	""
    #define CONFIG_BOOTDELAY	3
    
    /*
     * U-Boot commands
     */
    #include <config_cmd_default.h>
    #define CONFIG_CMD_ENV
    #define CONFIG_CMD_ASKENV
    #define CONFIG_CMD_DHCP
    #define CONFIG_CMD_DIAG
    #define CONFIG_CMD_MII
    #define CONFIG_CMD_PING
    #define CONFIG_CMD_SAVES
    #define CONFIG_CMD_MEMORY
    #undef CONFIG_CMD_FPGA
    #undef CONFIG_CMD_SETGETDCR
    #undef CONFIG_CMD_EEPROM
    
    #ifndef CONFIG_DRIVER_TI_EMAC
    #undef CONFIG_CMD_NET
    #undef CONFIG_CMD_DHCP
    #undef CONFIG_CMD_MII
    #undef CONFIG_CMD_PING
    #endif
    
    #ifdef CONFIG_USE_NAND
    #undef CONFIG_CMD_FLASH
    #undef CONFIG_CMD_IMLS
    #define CONFIG_CMD_NAND
    #endif
    
    #ifdef CONFIG_USE_SPIFLASH
    #undef CONFIG_CMD_IMLS
    #undef CONFIG_CMD_FLASH
    #define CONFIG_CMD_SPI
    #define CONFIG_CMD_SF
    #define CONFIG_CMD_SAVEENV
    #endif
    
    #if !defined(CONFIG_USE_NAND) && \
    	!defined(CONFIG_USE_NOR) && \
    	!defined(CONFIG_USE_SPIFLASH)
    #define CONFIG_ENV_IS_NOWHERE
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_SIZE		(16 << 10)
    #undef CONFIG_CMD_IMLS
    #undef CONFIG_CMD_FLASH
    #undef CONFIG_CMD_ENV
    #endif
    
    #ifdef CONFIG_USB_DA8XX
    
    #ifdef CONFIG_MUSB_HCD		/* include support for usb host */
    #define CONFIG_CMD_USB		/* include support for usb cmd */
    
    #define CONFIG_USB_STORAGE	/* MSC class support */
    #define CONFIG_CMD_STORAGE	/* inclue support for usb-storage cmd */
    #define CONFIG_CMD_FAT		/* inclue support for FAT/storage */
    #define CONFIG_DOS_PARTITION	/* inclue support for FAT/storage */
    
    #ifdef CONFIG_USB_KEYBOARD	/* HID class support */
    #define CONFIG_SYS_USB_EVENT_POLL
    #define CONFIG_PREBOOT "usb start"
    #endif /* CONFIG_USB_KEYBOARD */
    
    #endif /* CONFIG_MUSB_HCD */
    
    #ifdef CONFIG_MUSB_UDC
    /* USB device configuration */
    #define CONFIG_USB_DEVICE		1
    #define CONFIG_USB_TTY			1
    #define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
    /* Change these to suit your needs */
    #define CONFIG_USBD_VENDORID		0x0451
    #define CONFIG_USBD_PRODUCTID		0x5678
    #define CONFIG_USBD_MANUFACTURER	"Texas Instruments"
    #define CONFIG_USBD_PRODUCT_NAME	"DA830EVM"
    #endif /* CONFIG_MUSB_UDC */
    
    #endif /* CONFIG_USB_DA8XX */
    #endif /* __CONFIG_H */
    

     

    Daniel Allred said:

    This link refers to CONFIG_SYS_USE_NAND in the config file.  Is that the #define you are changing?

    Yes, that is.  I'm tried differing variants: CONFIG_SYS_USE_NAND (old version) and CONFIG_USE_NAND (because in conf. file checked exactly second variant). I'm found conf. file for HawkBoard, where use #define  CONFIG_SYS_USE_NAND 1. I'm tried this variant too.

    /*
     * Copyright (C) 2008 Texas Instruments, Inc <www.ti.com>
     * 
     * Based on davinci_dvevm.h. Original Copyrights follow:
     *
     * Copyright (C) 2007 Sergey Kubushyn <ksi@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>
    
    /*=======*/
    /* Board */
    /*=======*/
    #define	CONFIG_SYS_USE_NAND	1
    #undef	CONFIG_SYS_USE_NOR 
    #undef	CONFIG_USE_SPIFLASH
    
    /*===================*/
    /* SoC Configuration */
    /*===================*/
    #define CONFIG_ARM926EJS	
    /* Arm Clock */
    #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
    #define CFG_OSCIN_FREQ			24000000
    /* timer to be used */
    #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE	
    /* Timer Input clock freq */
    #define CONFIG_SYS_HZ_CLOCK		clk_get(DAVINCI_AUXCLK_CLKID)
    #define CONFIG_SYS_HZ			1000
    /* U-Boot is _always_ loaded by a bootloader... */
    #undef CONFIG_SKIP_LOWLEVEL_INIT
    /*... to a proper address, init done */
    #define CONFIG_SKIP_RELOCATE_UBOOT
    
    /*=============*/
    /* Memory Info */
    /*=============*/
    /* malloc() len */
    #define CONFIG_SYS_MALLOC_LEN		(1 * 1024 * 1024)
    /* reserved for initial data */
    #define CONFIG_SYS_GBL_DATA_SIZE	128
    /* DDR Start */
    #define PHYS_SDRAM_1			DAVINCI_DDR_EMIF_DATA_BASE
    /* SDRAM size 64MB */
    #define PHYS_SDRAM_1_SIZE		0x08000000
    /* memtest start address */
    #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
    /* 16MB RAM test */
    #define CONFIG_SYS_MEMTEST_END		(PHYS_SDRAM_1 + 16*1024*1024)
    /* we have 1 bank of DRAM */
    #define CONFIG_NR_DRAM_BANKS		1
    /* regular stack */
    #define CONFIG_STACKSIZE		(256*1024)	
    
    /*====================*/
    /* Serial Driver info */
    /*====================*/
    #define CONFIG_SYS_NS16550
    #define CONFIG_SYS_NS16550_SERIAL
    #define CONFIG_SYS_NS16550_REG_SIZE	4		
    /* use first UART for console */
    #define CONFIG_CONS_INDEX		1
    /* Base address of console UART */
    #define CONFIG_SYS_NS16550_COM1		DAVINCI_UART2_BASE	
    /* Input clock to NS16550 */
    #define CONFIG_SYS_NS16550_CLK		clk_get(DAVINCI_UART2_CLKID)
    /* Default baud rate */
    #define CONFIG_BAUDRATE			115200
    #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
    
    
    /*==================================*/
    /* SPI Flash Configuration	    */
    /*==================================*/
    #define CONFIG_SPI
    #define CONFIG_SPI_FLASH
    #define CONFIG_SPI_FLASH_STMICRO
    #define CONFIG_DAVINCI_SPI
    #define CFG_SPI_BASE			DAVINCI_SPI1_BASE
    #define CFG_SPI_CLK			clk_get(DAVINCI_SPI1_CLKID)
    #define CONFIG_SF_DEFAULT_SPEED		50000000
    
    /*==================================*/
    /* Network & Ethernet Configuration */
    /*==================================*/
    #define CONFIG_DRIVER_TI_EMAC
    #undef CONFIG_DRIVER_TI_EMAC_USE_RMII
    #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
    #undef CONFIG_ENV_IS_IN_FLASH
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_IS_IN_NAND
    #define CONFIG_ENV_SIZE			SZ_128K
    #define CONFIG_NAND_CS			2
    #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
    #define CONFIG_CLE_MASK			0x10
    #define CONFIG_ALE_MASK			0x8
    #undef CONFIG_SYS_NAND_HW_ECC
    #define CONFIG_SYS_NAND_4BIT_HW_ECC
    #define CONFIG_SYS_NAND_USE_FLASH_BBT
    #define CFG_DAVINCI_STD_NAND_LAYOUT
    /* Max number of NAND devices */
    #define CONFIG_SYS_MAX_NAND_DEVICE	1
    #define NAND_MAX_CHIPS			1
    /* Block 0--not used by bootcode */
    #define CONFIG_ENV_OFFSET		0x0	
    #endif
    
    #ifdef CONFIG_SYS_USE_NOR
    #define CONFIG_ENV_IS_IN_FLASH
    #undef CONFIG_SYS_NO_FLASH
    #define CONFIG_FLASH_CFI_DRIVER
    #define CONFIG_SYS_FLASH_CFI
    #define CONFIG_SYS_MAX_FLASH_BANKS	1
    #define CONFIG_SYS_FLASH_SECT_SZ	0x20000	
    #define CONFIG_ENV_OFFSET		(CONFIG_SYS_FLASH_SECT_SZ * 2)
    #define CONFIG_SYS_FLASH_BASE		DAVINCI_ASYNC_EMIF_DATA_CE2_BASE 
    #define PHYS_FLASH_SIZE			0x800000	
    #define CONFIG_SYS_MAX_FLASH_SECT	(PHYS_FLASH_SIZE/CONFIG_SYS_FLASH_SECT_SZ)
    #define CONFIG_ENV_SECT_SIZE		CONFIG_SYS_FLASH_SECT_SZ	
    #endif
    
    #ifdef CONFIG_USE_SPIFLASH
    #undef CONFIG_ENV_IS_IN_FLASH
    #undef CONFIG_ENV_IS_IN_NAND
    #define CONFIG_ENV_IS_IN_SPI_FLASH
    #define CONFIG_ENV_SIZE			SZ_64K
    #define CONFIG_ENV_OFFSET		SZ_256K
    #define CONFIG_ENV_SECT_SIZE		SZ_64K
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
    #endif
    
    
    /*==============================*/
    /* USB  configuration           */
    /*==============================*/
    #define CONFIG_MUSB		/* Generic MUSB controller */
    #define CONFIG_USB_DA8XX	/* Platform hookup to MUSB controller */ 
    #define CONFIG_USB_STORAGE	/* MSC class support */
    
    /*==============================*/
    /* U-Boot general configuration */
    /*==============================*/
    /* No IRQ/FIQ in U-Boot */
    #undef 	CONFIG_USE_IRQ
    #define CONFIG_MISC_INIT_R
    #undef CONFIG_BOOTDELAY
    #define CONFIG_BOOTFILE			"uImage"
    /* Monitor Command Prompt */
    #define CONFIG_SYS_PROMPT		"hawkboard.org > "
    /* Console I/O Buffer Size */
    #define CONFIG_SYS_CBSIZE		1024
    /* Print buffer sz */
    #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
    						sizeof(CONFIG_SYS_PROMPT) + 16)
    /* max number of command args */
    #define CONFIG_SYS_MAXARGS		16
    /* Boot Argument Buffer Size */
    #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
    /* default Linux kernel load address */
    #define CONFIG_SYS_LOAD_ADDR		(CONFIG_SYS_MEMTEST_START + 0x700000)
    #define CONFIG_VERSION_VARIABLE
    /* Won't work with hush so far, may be later */
    #define CONFIG_AUTO_COMPLETE
    #define CONFIG_SYS_HUSH_PARSER
    #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
    #define CONFIG_CMDLINE_EDITING
    #define CONFIG_SYS_LONGHELP
    #define CONFIG_CRC32_VERIFY
    #define CONFIG_MX_CYCLIC
    
    /*===================*/
    /* Linux Information */
    /*===================*/
    #define LINUX_BOOT_PARAM_ADDR		(CONFIG_SYS_MEMTEST_START + 0x100)
    #define CONFIG_CMDLINE_TAG
    #define CONFIG_SETUP_MEMORY_TAGS
    #define CONFIG_BOOTCOMMAND		""
    #define CONFIG_BOOTARGS			"mem=128M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=dhcp"
    #define CONFIG_BOOTDELAY		3
    
    /*=================*/
    /* U-Boot commands */
    /*=================*/
    #include <config_cmd_default.h>
    #define CONFIG_CMD_ENV
    #define CONFIG_CMD_ASKENV
    #define CONFIG_CMD_DHCP
    #define CONFIG_CMD_DIAG
    #define CONFIG_CMD_MII
    #define CONFIG_CMD_PING
    #define CONFIG_CMD_SAVES
    #define CONFIG_CMD_MEMORY
    #undef CONFIG_CMD_BDI
    #undef CONFIG_CMD_FPGA
    #undef CONFIG_CMD_SETGETDCR
    #define CONFIG_CMD_EEPROM
    
    #ifdef CONFIG_SYS_USE_NAND
    #undef CONFIG_CMD_FLASH
    #undef CONFIG_CMD_IMLS
    #define CONFIG_CMD_NAND
    #endif
    
    #ifdef CONFIG_USE_SPIFLASH
    #undef CONFIG_CMD_IMLS
    #undef CONFIG_CMD_FLASH
    #define CONFIG_CMD_SF
    #endif
    
    #if !defined(CONFIG_SYS_USE_NAND) && !defined(CONFIG_SYS_USE_NOR) && !defined(CONFIG_USE_SPIFLASH)
    #define CONFIG_ENV_IS_NOWHERE
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_SIZE				SZ_16K
    #undef CONFIG_CMD_IMLS
    #undef CONFIG_CMD_FLASH
    #undef CONFIG_CMD_ENV
    #endif
    
    #ifdef CONFIG_USB_DA8XX
    #define CONFIG_CMD_USB		/* inclue support for usb       */
    #define CONFIG_CMD_STORAGE	/* inclue support for usb       */
    #define CONFIG_CMD_FAT		/* inclue support for FAT/storage*/
    #define CONFIG_DOS_PARTITION	/* inclue support for FAT/storage*/
    #endif
    
    
    #endif /* __CONFIG_H */
    

     

  • I don't see any issues with the configurations, so I would suppose that there is something different with your custom board that has caused the standard u-boot build for NAND to be incompatible.  You are going to have to debug the u-boot code to figure out why it is not starting up as expected.  That could mean stepping through the code using a debug environment like CCS.

    Just to check, you have the NAND connected to the same chip select as the other platforms (CS3)?

    Regards, Daniel

  • Daniel Allred said:

    Just to check, you have the NAND connected to the same chip select as the other platforms (CS3)?

     Problem resolved. In my board NAND connected to the CS2 pin. I'm changed in config file pin to CS2 but forgot changed register to CF2.

    Thank you, Daniel.

  • Pavel,

    Good to hear.  Please note that if you intend to boot directly from the NAND, that the device's ROM is hard-coded to expect the NAND connected to CS3, not CS2 (which is why the other platforms have it connected that way).

    Regards, Daniel

  • New trouble with NAND. U-boot can read ID of NAND (0x75), erase command work without warning and show bad block. Read and write command work without warning or error, saveenv comannd work too. But when i check what was readed from NAND, i saw that all data is 0xFF. Used NAND of Samsung, 32 Mb, 8bit bus, 512 bit per page.

    Whats wrong?

    I change config only in da830evm.h file.

    #ifdef CONFIG_USE_NAND
    #undef CONFIG_ENV_IS_IN_FLASH
    #define CONFIG_NAND_DAVINCI
    #define CONFIG_SYS_NO_FLASH
    #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
    #define CONFIG_ENV_OFFSET		0x0 /* Block 0--not used by bootcode */
    #define CONFIG_ENV_SIZE			(128 << 10)
    #define	CONFIG_SYS_NAND_USE_FLASH_BBT
    #undef CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
    #define	CONFIG_SYS_NAND_PAGE_2K
    #define CONFIG_SYS_NAND_CS		2
    #define CONFIG_SYS_NAND_BASE		DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
    #define CONFIG_SYS_CLE_MASK		0x10
    #define CONFIG_SYS_ALE_MASK		0x8
    #define CONFIG_SYS_NAND_HW_ECC
    #define CONFIG_SYS_MAX_NAND_DEVICE	1 /* Max number of NAND devices */
    #define NAND_MAX_CHIPS			1
    #define DEF_BOOTM			""
    #endif