Commit 55702fe275b9570418fd71f09c0cab08c02860d1

Authored by Chin Liang See
Committed by Marek Vasut
1 parent 520b9e0956

arm: socfpga: Enabling MTD default partitions

Enabling MTD default partitions if its not defined in board
configuration file. The layout as below
 device nor0 <ff705000.spi.0>, # parts = 6
 #: name                size            offset          mask_flags
 0: u-boot              0x00100000      0x00000000      0
 1: env1                0x00040000      0x00100000      0
 2: env2                0x00040000      0x00140000      0
 3: UBI                 0x03e80000      0x00180000      0
 4: boot                0x00e80000      0x00180000      0
 5: rootfs              0x01000000      0x01000000      0

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: Pavel Machek <pavel@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Stefan Roese <sr@denx.de>

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

include/configs/socfpga_common.h
... ... @@ -196,7 +196,7 @@
196 196 #define CONFIG_CMD_MTDPARTS
197 197 #define CONFIG_MTD_DEVICE
198 198 #define CONFIG_MTD_PARTITIONS
199   -#define MTDIDS_DEFAULT "nor0=ff705000.spi"
  199 +#define MTDIDS_DEFAULT "nor0=ff705000.spi.0"
200 200 #endif
201 201 /* QSPI reference clock */
202 202 #ifndef __ASSEMBLY__
... ... @@ -274,6 +274,29 @@
274 274 #if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
275 275 #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */
276 276 #define CONFIG_ENV_OFFSET 512 /* just after the MBR */
  277 +#endif
  278 +
  279 +/*
  280 + * mtd partitioning for serial NOR flash
  281 + *
  282 + * device nor0 <ff705000.spi.0>, # parts = 6
  283 + * #: name size offset mask_flags
  284 + * 0: u-boot 0x00100000 0x00000000 0
  285 + * 1: env1 0x00040000 0x00100000 0
  286 + * 2: env2 0x00040000 0x00140000 0
  287 + * 3: UBI 0x03e80000 0x00180000 0
  288 + * 4: boot 0x00e80000 0x00180000 0
  289 + * 5: rootfs 0x01000000 0x01000000 0
  290 + *
  291 + */
  292 +#if defined(CONFIG_CMD_SF) && !defined(MTDPARTS_DEFAULT)
  293 +#define MTDPARTS_DEFAULT "mtdparts=ff705000.spi.0:"\
  294 + "1m(u-boot)," \
  295 + "256k(env1)," \
  296 + "256k(env2)," \
  297 + "14848k(boot)," \
  298 + "16m(rootfs)," \
  299 + "-@1536k(UBI)\0"
277 300 #endif
278 301  
279 302 /*