Commit fea9543f1bd1d068a372ef378f624941c25989a8

Authored by pekon gupta
Committed by Tom Rini
1 parent 83e359adf9

board/ti/am335x: update configs for parallel NAND

This patch
- consolidate CONFIG_SYS_NAND_xx and CONFIG_SPL_NAND_xx from various
  configuration files into single file.
- update MTD Partition table to match AM335x_EVM DT in linux-kernel
- segregate CONFIGs based on different boot modes (like SPL and U-Boot)

Signed-off-by: Pekon Gupta <pekon@ti.com>

Showing 1 changed file with 29 additions and 24 deletions Side-by-side Diff

include/configs/am335x_evm.h
... ... @@ -61,7 +61,7 @@
61 61 "${optargs} " \
62 62 "root=${nandroot} " \
63 63 "rootfstype=${nandrootfstype}\0" \
64   - "nandroot=ubi0:rootfs rw ubi.mtd=7,2048,2048\0" \" \
  64 + "nandroot=ubi0:rootfs rw ubi.mtd=9,2048,2048\0" \" \
65 65 "nandrootfstype=ubifs rootwait=1\0" \
66 66 "nandboot=echo Booting from nand ...; " \
67 67 "run nandargs; " \
68 68  
69 69  
... ... @@ -224,16 +224,19 @@
224 224 #define CONFIG_SPL_MUSB_NEW_SUPPORT
225 225  
226 226 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
  227 +#endif
227 228  
228 229 #ifdef CONFIG_NAND
229   -#define CONFIG_NAND_OMAP_GPMC
230   -#define CONFIG_NAND_OMAP_ELM
  230 +/* NAND: device related configs */
231 231 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
232 232 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
233 233 CONFIG_SYS_NAND_PAGE_SIZE)
234 234 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
235 235 #define CONFIG_SYS_NAND_OOBSIZE 64
236 236 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  237 +/* NAND: driver related configs */
  238 +#define CONFIG_NAND_OMAP_GPMC
  239 +#define CONFIG_NAND_OMAP_ELM
237 240 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
238 241 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
239 242 10, 11, 12, 13, 14, 15, 16, 17, \
240 243  
... ... @@ -247,15 +250,34 @@
247 250 #define CONFIG_SYS_NAND_ECCBYTES 14
248 251 #define CONFIG_SYS_NAND_ONFI_DETECTION
249 252 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
250   -#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
251   -#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  253 +#define MTDIDS_DEFAULT "nand0=nand.0"
  254 +#define MTDPARTS_DEFAULT "mtdparts=nand.0:" \
  255 + "128k(NAND.SPL)," \
  256 + "128k(NAND.SPL.backup1)," \
  257 + "128k(NAND.SPL.backup2)," \
  258 + "128k(NAND.SPL.backup3)," \
  259 + "256k(NAND.u-boot-spl-os)," \
  260 + "1m(NAND.u-boot)," \
  261 + "128k(NAND.u-boot-env)," \
  262 + "128k(NAND.u-boot-env.backup1)," \
  263 + "8m(NAND.kernel)," \
  264 + "-(NAND.rootfs)"
  265 +#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
  266 +#undef CONFIG_ENV_IS_NOWHERE
  267 +#define CONFIG_ENV_IS_IN_NAND
  268 +#define CONFIG_ENV_OFFSET 0x001c0000
  269 +#define CONFIG_ENV_OFFSET_REDUND 0x001e0000
  270 +#define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  271 +/* NAND: SPL related configs */
  272 +#ifdef CONFIG_SPL_NAND_SUPPORT
  273 +#define CONFIG_SPL_NAND_AM33XX_BCH
  274 +#endif
252 275 #ifdef CONFIG_SPL_OS_BOOT
253 276 #define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */
254 277 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
255 278 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
256 279 #endif
257   -#endif
258   -#endif
  280 +#endif /* !CONFIG_NAND */
259 281  
260 282 /*
261 283 * For NOR boot, we must set this to the start of where NOR is mapped
... ... @@ -412,23 +434,6 @@
412 434 #define CONFIG_PHY_GIGE
413 435 #define CONFIG_PHYLIB
414 436 #define CONFIG_PHY_SMSC
415   -
416   -/* NAND support */
417   -#ifdef CONFIG_NAND
418   -#define CONFIG_CMD_NAND
419   -#if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
420   -#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
421   -#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
422   - "128k(SPL.backup1)," \
423   - "128k(SPL.backup2)," \
424   - "128k(SPL.backup3),1792k(u-boot)," \
425   - "128k(u-boot-spl-os)," \
426   - "128k(u-boot-env),5m(kernel),-(rootfs)"
427   -#define CONFIG_ENV_IS_IN_NAND
428   -#define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */
429   -#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
430   -#endif
431   -#endif
432 437  
433 438 /*
434 439 * NOR Size = 16 MiB