[U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND

Gupta, Pekon pekon at ti.com
Mon Sep 16 11:51:46 CEST 2013


> On Tue, Aug 06, 2013 at 01:45:08PM +0530, Pekon Gupta wrote:
> 
> > ti814x_evm has on-board socket for using Micron (MT29Fxx) family of
> > NAND devices to GPMC interface. This patch
> > - adds NAND related pin-mux configuration for same
> > - adds #defines for NAND partitions to TI814x configs
> > - enables support for NAND in TI814x configs
[snip]
> 
> > @@ -186,6 +193,14 @@
> >  #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS      0x200 /* 256 KB */
> >  #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION    1
> >  #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME        "u-boot.img"
> > +
> > +#ifdef CONFIG_SPL_OS_BOOT
> > +/* nand */
> > +#define CONFIG_CMD_SPL_NAND_OFS			0x000000 /*
> end of u-boot */
> > +#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS		0x280000
> > +#define CONFIG_CMD_SPL_WRITE_SIZE		0x1000
> > +#endif
> 
> Since you aren't adding the SD/MMC defines as well, nor setting
> SPL_OS_BOOT, lets drop these.
> 
Sorry but dint get your feedback.
Following are used in SPL boot for loading env and kernel in falcon mode.
Referring: $UBOOT/common/spl/spl_nand.c
- CONFIG_SYS_NAND_SPL_KERNEL_OFFS
- CONFIG_CMD_SPL_WRITE_SIZE 
- CONFIG_CMD_SPL_NAND_OFS
May be I put them in wrong place in include/configs/ti814x.h but these
are required for NAND SPL boot. Please confirm ?

> > @@ -242,5 +283,32 @@
> >  #define CONFIG_PHY_ADDR			1
> >  #define CONFIG_PHY_ET1011C
> >  #define CONFIG_PHY_ET1011C_TX_CLK_FIX
> > +#define CONFIG_NAND
> > +/* NAND support */
> > +#ifdef CONFIG_NAND
> > +#define CONFIG_MTD_NAND_OMAP_BCH
> > +#define CONFIG_CMD_NAND
> > +#define CONFIG_CMD_MTDPARTS
> > +#define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
> > +#define MTDPARTS_DEFAULT		"mtdparts=omap2-
> nand.0:128k(SPL)," \
> > +					"128k(u-boot-spl)," \
> > +					"2M(u-boot-main)," \
> > +					"128k(u-boot-env),4M(kernel),-
> (rootfs)"
> 
> Lets get the partition tables right, we've still got 4 locations where
> ROM checks for something, so lets use those for SPL, then U-Boot, then
> U-Boot Env (redundant as well, please), and a block saved off for device
> tree/SPL OS "args" support, then kernel, rootfs.
> 
I think TI814x ROM use different NAND layout than AM33xx devices.
I used following NAND layout given in link below as reference:
http://processors.wiki.ti.com/index.php/TI81XX_PSP_UBOOT_User_Guide#EVM_Switch_Settings
These devices belong to omap3 family, but now are merged with am33xx.

> > +#define CONFIG_NAND_OMAP_GPMC
> > +#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
> > +#define NAND_BASE			(0x08000000)
> 
> Don't need NAND_BASE.
Ok thanks.

- Also removing GPMC_NAND_ECC_LP_x16_LAYOUT  as predefined
  nand_ecclayouts in omap_gpmc.h are not used anymore.
- Trying to remove dependency on CONFIG_NAND_OMAP_GPMC as
  except legacy devices all new platform support ELM based ECC schemes.

> 
> > +#define CONFIG_SYS_NAND_BASE	(0x08000000)	/* physical
> address */
> > +		/* to access nand at> */
> > +		/* CS0 */
> > +#define CONFIG_SYS_MAX_NAND_DEVICE	1	
> > +/* Max  number of NAND	   devices */
> > +#define CONFIG_SYS_NAND_BOOT
> > +#if !defined(CONFIG_SPI_BOOT)
> > +#undef CONFIG_ENV_IS_NOWHERE
> > +#define CONFIG_ENV_IS_IN_NAND
> > +#define CONFIG_ENV_OFFSET		0x260000 /* environment
> starts here */
> > +#define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
> > +#endif
> > +#endif
> 
> And we don't support SPI boot or anything here, so lets just always do
> env on NAND until we have support for other things as well.  Thanks!
> 
Ok. yes I'll remove them..

with regards, pekon


More information about the U-Boot mailing list