Commit dbba3daf9e4aac9cc9c8fcfdc886393c940fe764

Authored by Ash Charles
Committed by Tom Rini
1 parent 0b3fde1136

OMAP3: overo: add command support for mtd and ubi

The NAND linux partition format default was changed from jffs2 to ubi in
254973e6df0e48f1a72b67905185c774dcd9f394 but the corresponding commands were
not enabled.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Tested-by: Ash Charles <ash@gumstix.com>

Showing 1 changed file with 37 additions and 3 deletions Side-by-side Diff

include/configs/omap3_overo.h
... ... @@ -43,10 +43,12 @@
43 43 /*
44 44 * Size of malloc() pool
45 45 */
46   -#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
47   - /* Sector */
48   -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
  46 +#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB sector */
49 47  
  48 +/* Shift 128 << 15 provides 4 MiB heap to support UBI commands.
  49 + * Shift 128 << 10 provides 128 KiB heap for limited-memory devices. */
  50 +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 15))
  51 +
50 52 /*
51 53 * Hardware drivers
52 54 */
... ... @@ -97,6 +99,37 @@
97 99 #undef CONFIG_CMD_NFS /* NFS support */
98 100 #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
99 101  
  102 +#ifdef CONFIG_CMD_NAND
  103 +
  104 +#define CONFIG_CMD_MTDPARTS /* MTD partition support */
  105 +#define CONFIG_CMD_UBI /* UBI-formated MTD partition support */
  106 +#define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
  107 +
  108 +#define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
  109 +#define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
  110 +
  111 +#define CONFIG_MTD_DEVICE /* required by CONFIG_CMD_MTDPARTS */
  112 +#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
  113 +
  114 +/* NAND block size is 128 KiB. Synchronize these values with
  115 + * overo_nand_partitions in mach-omap2/board-overo.c in Linux:
  116 + * xloader 4 * NAND_BLOCK_SIZE = 512 KiB
  117 + * uboot 14 * NAND_BLOCK_SIZE = 1792 KiB
  118 + * uboot environtment 2 * NAND_BLOCK_SIZE = 256 KiB
  119 + * linux 32 * NAND_BLOCK_SIE = 4 MiB
  120 + * rootfs remainder
  121 + */
  122 +#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  123 +#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \
  124 + "512k(xloader)," \
  125 + "1792k(u-boot)," \
  126 + "256k(environ)," \
  127 + "4m(linux)," \
  128 + "-(rootfs)"
  129 +#else /* CONFIG_CMD_NAND */
  130 +#define MTDPARTS_DEFAULT
  131 +#endif /* CONFIG_CMD_NAND */
  132 +
100 133 #define CONFIG_SYS_NO_FLASH
101 134 #define CONFIG_SYS_I2C
102 135 #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
... ... @@ -145,6 +178,7 @@
145 178 "mmcrootfstype=ext3 rootwait\0" \
146 179 "nandroot=ubi0:rootfs ubi.mtd=4\0" \
147 180 "nandrootfstype=ubifs\0" \
  181 + "mtdparts=" MTDPARTS_DEFAULT "\0" \
148 182 "mmcargs=setenv bootargs console=${console} " \
149 183 "${optargs} " \
150 184 "mpurate=${mpurate} " \