[U-Boot] [PATCH v1 2/2] ti814x_evm: enable support for NAND
Tom Rini
trini at ti.com
Wed Aug 28 17:03:06 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]
> @@ -56,6 +55,7 @@
> "fdtfile=\0" \
> "console=ttyO0,115200n8\0" \
> "optargs=\0" \
> + "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
> "mmcdev=0\0" \
> "mmcroot=/dev/mmcblk0p2 ro\0" \
> "mmcrootfstype=ext4 rootwait\0" \
> @@ -134,6 +134,13 @@
> #define CONFIG_DOS_PARTITION
> #define CONFIG_CMD_FAT
> #define CONFIG_CMD_EXT2
> +#define CONFIG_DFU_NAND
> +#define DFU_ALT_INFO_NAND \
> + "u-boot-spl part 0 1;" \
> + "u-boot-main part 0 2;" \
> + "env variables part 0 3;" \
> + "kernel part 0 4;" \
> + "rootfs part 0 5"
You're not bringing in USB here, so drop these.
> @@ -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.
> @@ -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.
> +#define CONFIG_NAND_OMAP_GPMC
> +#define GPMC_NAND_ECC_LP_x16_LAYOUT 1
> +#define NAND_BASE (0x08000000)
Don't need NAND_BASE.
> +#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!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130828/74818dd9/attachment.pgp>
More information about the U-Boot
mailing list