public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: socfpga: Enabling MTD default partitions
@ 2015-12-21 13:23 Chin Liang See
  2015-12-21 14:24 ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Chin Liang See @ 2015-12-21 13:23 UTC (permalink / raw)
  To: u-boot

Enabling MTD default partitions if its not defined in board
configuration file. The layout as below
> 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

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>
---
 include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 699e78a..36fc9f0 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -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 */
-- 
1.7.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enabling MTD default partitions
  2015-12-21 13:23 [U-Boot] [PATCH] arm: socfpga: Enabling MTD default partitions Chin Liang See
@ 2015-12-21 14:24 ` Marek Vasut
  2015-12-21 14:39   ` Chin Liang See
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2015-12-21 14:24 UTC (permalink / raw)
  To: u-boot

On Monday, December 21, 2015 at 02:23:54 PM, Chin Liang See wrote:
> Enabling MTD default partitions if its not defined in board
> configuration file. The layout as below
> 
> > u-boot partition for storing SPL image

But there's also U-Boot image here

> > 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.

> > 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
> 
> 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>
> ---
>  include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
>  1 files changed, 23 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h index 699e78a..36fc9f0 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -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)

This should be &&, right ?

> +#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)

> +				"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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] arm: socfpga: Enabling MTD default partitions
  2015-12-21 14:24 ` Marek Vasut
@ 2015-12-21 14:39   ` Chin Liang See
  0 siblings, 0 replies; 3+ messages in thread
From: Chin Liang See @ 2015-12-21 14:39 UTC (permalink / raw)
  To: u-boot

On Mon, 2015-12-21 at 15:24 +0100, Marek Vasut wrote:
> On Monday, December 21, 2015 at 02:23:54 PM, Chin Liang See wrote:
> > Enabling MTD default partitions if its not defined in board
> > configuration file. The layout as below
> > 
> > > u-boot partition for storing SPL image
> 
> But there's also U-Boot image here
> 
> > > 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.

> 
> > > 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
> > 
> > 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>
> > ---
> >  include/configs/socfpga_common.h |   23 +++++++++++++++++++++++
> >  1 files changed, 23 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/configs/socfpga_common.h
> > b/include/configs/socfpga_common.h index 699e78a..36fc9f0 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -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)
> 
> This should be &&, right ?

Yup, will fix that.

> 
> > +#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

> 
> > +				"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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-21 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-21 13:23 [U-Boot] [PATCH] arm: socfpga: Enabling MTD default partitions Chin Liang See
2015-12-21 14:24 ` Marek Vasut
2015-12-21 14:39   ` Chin Liang See

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox