Skip to contentSkip to conversation

arm: socfpga: Enabling MTD default partitions

PATCH New Chin Liang See 2 participants 3 messages Dec 21, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Enabling MTD default partitions

Enabling MTD default partitions if its not defined in board configuration file. The layout as below

Quoted 5 lines

u-boot partition for storing SPL image
env partition for storing U-Boot environment
UBI partition for storing kernel image and filesystem boot partition for backward compatibility / raw binary rootfs partition for storing filesystem in case boot partition used

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
include/configs/socfpga_common.h +23 -0
index 699e78a..36fc9f0 100644
@@ -271,6 +271,29 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
 #define CONFIG_ENV_SIZE			4096
 
+/*
+ * mtd partitioning for serial NOR flash
+ *
+ * device nor0 <ff705000.spi>, # 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:"\
+				"1m(u-boot),"		\
+				"256k(env1),"		\
+				"256k(env2),"		\
+				"14848k(boot),"		\
+				"16m(rootfs),"		\
+				"- at 1536k(UBI)\0"
+#endif
+
 /* Environment for SDMMC boot */
 #if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
 #define CONFIG_SYS_MMC_ENV_DEV		0	/* device 0 */
Signature · 1 line
1.7.7.4
#1 lore raw

PATCH 1/1 arm: socfpga: Enabling MTD default partitions

Quoted 4 lines · Chin Liang See

Enabling MTD default partitions if its not defined in board configuration file. The layout as below

Quoted 1 line

u-boot partition for storing SPL image

But there's also U-Boot image here

Quoted 1 line
Quoted 1 line

env partition for storing U-Boot environment

There are two partitions for the environment ... I think you can just point to the layout below and dont need to list it in the commit message.

Quoted 26 lines
Quoted 3 lines

UBI partition for storing kernel image and filesystem boot partition for backward compatibility / raw binary rootfs partition for storing filesystem in case boot partition used

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/include/configs/socfpga_common.h index 699e78a..36fc9f0 100644

include/configs/socfpga_common.h +4 -0
@@ -271,6 +271,29 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
 #define CONFIG_ENV_SIZE			4096
 
+/*
+ * mtd partitioning for serial NOR flash
+ *
+ * device nor0 <ff705000.spi>, # parts = 6

include/configs/socfpga_common.h unsigned int cm_get_qspi_controller_clk_hz(void); · line 287

Quoted 10 lines
include/configs/socfpga_common.h +10 -0
+ * #: 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)

This should be &&, right ?

include/configs/socfpga_common.h unsigned int cm_get_qspi_controller_clk_hz(void); · line 288

Quoted 1 line
include/configs/socfpga_common.h +1 -0
+#define MTDPARTS_DEFAULT	"mtdparts=ff705000.spi:"\

Make this ff705000.spi.0 please , otherwise it'd be impossible to support multiple SPI NORs on a single QSPI controller (the mtdparts would get bound to all of them)

include/configs/socfpga_common.h unsigned int cm_get_qspi_controller_clk_hz(void); · line 299

Quoted 11 lines
include/configs/socfpga_common.h +8 -0
+				"1m(u-boot),"		\
+				"256k(env1),"		\
+				"256k(env2),"		\
+				"14848k(boot),"		\
+				"16m(rootfs),"		\
+				"- at 1536k(UBI)\0"
+#endif
+
 /* Environment for SDMMC boot */
 #if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
 #define CONFIG_SYS_MMC_ENV_DEV		0	/* device 0 */

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 arm: socfpga: Enabling MTD default partitions

Quoted 6 lines · Marek Vasut
Quoted 4 lines · Chin Liang See

Enabling MTD default partitions if its not defined in board configuration file. The layout as below

Quoted 1 line

u-boot partition for storing SPL image

Quoted 7 lines

But there's also U-Boot image here

Quoted 1 line
Quoted 1 line

env partition for storing U-Boot environment

There are two partitions for the environment ... I think you can just point
to the layout below and dont need to list it in the commit message.

Yah, let me know that as its much easier to read.

Quoted 34 lines
Quoted 34 lines
Quoted 5 lines

UBI partition for storing kernel image and filesystem boot partition for backward compatibility / raw binary rootfs partition for storing filesystem in case boot partition used

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
---
 include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/include/configs/socfpga_common.h index 699e78a..36fc9f0 100644

include/configs/socfpga_common.h +8 -0
@@ -271,6 +271,29 @@ unsigned int
 cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
 #define CONFIG_ENV_SIZE			4096
 
+/*
+ * mtd partitioning for serial NOR flash
+ *
+ * device nor0 <ff705000.spi>, # parts = 6
+ * #: name                size            offset         
 mask_flags
+ * 0: u-boot              0x00100000      0x00000000      0
+ * 1: env1                0x00040000      0x00100000      0
+ * 2: env2                0x00040000      0x00140000      0
Quoted 8 lines

include/configs/socfpga_common.h unsigned int cm_get_qspi_controller_clk_hz(void); · line 287

Quoted 6 lines
include/configs/socfpga_common.h +6 -0
+ * 3: UBI                 0x03e80000      0x00180000      0
+ * 4: boot                0x00e80000      0x00180000      0
+ * 5: rootfs              0x01000000      0x01000000      0
+ *
+ */
+#if defined(CONFIG_CMD_SF) || !defined(MTDPARTS_DEFAULT)

This should be &&, right ?

Yup, will fix that.

Quoted 8 lines

include/configs/socfpga_common.h unsigned int cm_get_qspi_controller_clk_hz(void); · line 288

Quoted 2 lines
include/configs/socfpga_common.h +1 -0
+#define MTDPARTS_DEFAULT	"mtdparts=ff705000.spi:"\

Make this ff705000.spi.0 please , otherwise it'd be impossible to support
multiple SPI NORs on a single QSPI controller (the mtdparts would get bound
to all of them)

Good suggestion, let me update this too

Thanks
Chin Liang

Quoted 16 lines
Quoted 10 lines
include/configs/socfpga_common.h +8 -0
+				"1m(u-boot),"		\
+				"256k(env1),"		\
+				"256k(env2),"		\
+				"14848k(boot),"		\
+				"16m(rootfs),"		\
+				"- at 1536k(UBI)\0"
+#endif
+
 /* Environment for SDMMC boot */
Quoted 3 lines

#if defined(CONFIG_ENV_IS_IN_MMC) && !defined(CONFIG_ENV_OFFSET)
#define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0
*/

Best regards,
Marek Vasut