From 55702fe275b9570418fd71f09c0cab08c02860d1 Mon Sep 17 00:00:00 2001 From: Chin Liang See Date: Mon, 21 Dec 2015 23:01:51 +0800 Subject: [PATCH] arm: socfpga: Enabling MTD default partitions Enabling MTD default partitions if its not defined in board configuration file. The layout as below device nor0 , # 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 Cc: Dinh Nguyen Cc: Dinh Nguyen Cc: Pavel Machek Cc: Marek Vasut Cc: Stefan Roese --- include/configs/socfpga_common.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index 275aa6de43..6655152960 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -196,7 +196,7 @@ unsigned int cm_get_l4_sp_clk_hz(void); #define CONFIG_CMD_MTDPARTS #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS -#define MTDIDS_DEFAULT "nor0=ff705000.spi" +#define MTDIDS_DEFAULT "nor0=ff705000.spi.0" #endif /* QSPI reference clock */ #ifndef __ASSEMBLY__ @@ -276,6 +276,29 @@ unsigned int cm_get_qspi_controller_clk_hz(void); #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ #endif +/* + * mtd partitioning for serial NOR flash + * + * device nor0 , # 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 + * + */ +#if defined(CONFIG_CMD_SF) && !defined(MTDPARTS_DEFAULT) +#define MTDPARTS_DEFAULT "mtdparts=ff705000.spi.0:"\ + "1m(u-boot)," \ + "256k(env1)," \ + "256k(env2)," \ + "14848k(boot)," \ + "16m(rootfs)," \ + "-@1536k(UBI)\0" +#endif + /* * SPL *