Skip to contentSkip to conversation

ti814x_evm: enable support for NAND

PATCH New Gupta 2 participants 2 messages Sep 16, 2013 – Sep 19, 2013

lore
Share & tools
lore

Gupta

#0 lore raw

PATCH 2/2 ti814x_evm: enable support for NAND

Quoted 7 lines · Pekon Gupta
Quoted 6 lines

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]

Quoted 10 lines

Review line 199

Quoted 9 lines
(quoted diff) +4 -0
@@ -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 */

Quoted 7 lines

Review line 202

Quoted 3 lines
(quoted diff) +3 -0
+#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 ?

Quoted 18 lines

Review line 293

Quoted 12 lines
(quoted diff) +8 -0
@@ -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)," \

Review line 296

Quoted 3 lines
(quoted diff) +3 -0
+					"128k(u-boot-spl)," \
+					"2M(u-boot-main)," \
+					"128k(u-boot-env),4M(kernel),-

(rootfs)"

Quoted 5 lines

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.

Quoted 5 lines

Review line 299

Quoted 3 lines
(quoted diff) +3 -0
+#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.

Quoted 13 lines

Review line 300

Quoted 2 lines
(quoted diff) +1 -0
+#define CONFIG_SYS_NAND_BASE	(0x08000000)	/* physical

address */

Review line 309

Quoted 9 lines
(quoted diff) +9 -0
+		/* 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 */

Quoted 7 lines

Review line 312

Quoted 3 lines
(quoted diff) +3 -0
+#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

#1 lore raw

PATCH 2/2 ti814x_evm: enable support for NAND

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 25 lines · Pekon
Quoted 7 lines · Pekon Gupta
Quoted 6 lines

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]

Quoted 10 lines

Review line 199

Quoted 9 lines
(quoted diff) +4 -0
@@ -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 */

Quoted 7 lines

Review line 202

Quoted 3 lines
(quoted diff) +3 -0
+#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.

Quoted 8 lines

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 ?

They are required for falcon mode yes, but only for falcon mode. And you don't set CONFIG_SPL_OS_BOOT to turn it on :)

Quoted 23 lines
Quoted 18 lines

Review line 293

Quoted 12 lines
(quoted diff) +8 -0
@@ -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)," \

Review line 296

Quoted 3 lines
(quoted diff) +3 -0
+					"128k(u-boot-spl)," \
+					"2M(u-boot-main)," \
+					"128k(u-boot-env),4M(kernel),-

(rootfs)"

Quoted 5 lines

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.

Quoted 4 lines

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.

Yeah. OMAP3 and AM33xx (and am43xx) share the same redundancy locations. The PSP layout here is sub-optimal is all.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSOz3pAAoJENk4IS6UOR1W5HoP/j+oIaehk8WgJ0NJUQhg2u5Q TSCiITuEhr8pmGXjnrxYhsHloq2icK4iCdZ45tLNQbDkmFZne7q+5uChOHSZZiwI DGGundQKkf84ECUq2jGXMtIVKQr0Ba8yb25l3rTqy+hfaqbfcg8ZNXxCQ4wKkCqj 4Z8n0gJodzxncPG48gCW1kbzyqg2ZnEwqgLuDuqu6DAhYOEu/lpouakGVRLOpe9r mRdSfu+edUf44zbQ6PEmHD67u1jCNwvc7RQ3Gk9cHM9Ma+9OsN8LULD5FvRovFmO KYYDW/v2tC23LBAjzMnfBzCMpo7Wd6FJVT7JMkT3SKWVdDkDRIG+PDUcZoMS0XcE UMbMnf2VHjFs9ccAL0dKZs4DrR0ECzoubCK+KdtecMFplOo/JDD03O6uMTMv+t32 uwa9UcJYK3w9pPVnng/zAvKTU4lmMkIh2sIM9kquJwoT2aJ3NFa0jjHZLkDNw7BD rie3ZQ5kH91ZMdvDuExkNnSt0pDuM95/ro4OeakRuWdKCure9Kszd+Nattrnc6wU 5gmWQ1rBELgg1ATSmWJEnyo7cORnCKSztyUZG/GTxlkKE+ScU/7wsm/ClAtDN7Of NZwDowfdU5TFdU1vFSk9aP2ShSldzG51GUm4IcwmXP98R0DDtVMiTC+CMxpgLRDh dmTwOEoBt8Vr4w7lPgDi
=IPQo
-----END PGP SIGNATURE-----