[U-Boot] [PATCH v2 1/4] arm: socfpga: cyclone5-socdk: Enabling U-Boot environment in QSPI

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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 --- Changes for v2 - remove the undef --- include/configs/socfpga_cyclone5_socdk.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
/* USB */ #ifdef CONFIG_CMD_USB

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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 --- Changes for v2 - remove the undef --- include/configs/socfpga_arria5_socdk.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h index ebb6ed5..927ade3 100644 --- a/include/configs/socfpga_arria5_socdk.h +++ b/include/configs/socfpga_arria5_socdk.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
/* USB */ #ifdef CONFIG_CMD_USB

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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 --- Changes for v2 - remove the undef --- include/configs/socfpga_sockit.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_sockit.h b/include/configs/socfpga_sockit.h index 5bcee05..ad3f275 100644 --- a/include/configs/socfpga_sockit.h +++ b/include/configs/socfpga_sockit.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
/* USB */ #ifdef CONFIG_CMD_USB

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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 --- Changes for v2 - remove the undef --- include/configs/socfpga_socrates.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_socrates.h b/include/configs/socfpga_socrates.h index 16a2a86..53af058 100644 --- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -54,9 +54,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
/* USB */ #ifdef CONFIG_CMD_USB

On Sat 2015-12-12 08:47:41, Chin Liang See wrote:
Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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
--- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -54,9 +54,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
This configuration is again shared with all the boards that have NOR, right? So time to create include/configs/socfpga_spi_nor.h or something like that?
Thanks, Pavel

On Sat, 2015-12-12 at 23:50 +0100, Pavel Machek wrote:
On Sat 2015-12-12 08:47:41, Chin Liang See wrote:
Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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
--- a/include/configs/socfpga_socrates.h +++ b/include/configs/socfpga_socrates.h @@ -54,9 +54,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000 +#endif
This configuration is again shared with all the boards that have NOR, right? So time to create include/configs/socfpga_spi_nor.h or something like that?
I can consolidate too into socfpga_common.h
Thanks Chin Liang
Thanks, Pavel

On Saturday, December 12, 2015 at 01:47:38 AM, Chin Liang See wrote:
Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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
Changes for v2
- remove the undef
include/configs/socfpga_cyclone5_socdk.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000
The offset of the env is therefore 4 MiB, right ? This does not match with the other patch:
[PATCH 1/6] arm: socfpga: cyclone5-socdk: Enabling mtd partitioning layout
Please be more careful next time. Also, it might make sense to enable redundant environment in QSPI NOR.
Best regards, Marek Vasut

On Sat, 2015-12-12 at 04:23 +0100, Marek Vasut wrote:
On Saturday, December 12, 2015 at 01:47:38 AM, Chin Liang See wrote:
Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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
Changes for v2
- remove the undef
include/configs/socfpga_cyclone5_socdk.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */ #define CONFIG_ENV_IS_IN_MMC +#ifdef CONFIG_ENV_IS_IN_MMC #define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0 */ #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000
The offset of the env is therefore 4 MiB, right ? This does not match with the other patch:
[PATCH 1/6] arm: socfpga: cyclone5-socdk: Enabling mtd partitioning layout
Oops good catch as I should use 256kB, not 4MB. Let fix that.
Please be more careful next time. Also, it might make sense to enable redundant environment in QSPI NOR.
Yah, I plan to put the environment to be larger so this is possible in the future.
Thanks Chin Liang
Best regards, Marek Vasut

On Saturday, December 12, 2015 at 07:17:13 AM, Chin Liang See wrote:
On Sat, 2015-12-12 at 04:23 +0100, Marek Vasut wrote:
On Saturday, December 12, 2015 at 01:47:38 AM, Chin Liang See wrote:
Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC
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
Changes for v2
- remove the undef
include/configs/socfpga_cyclone5_socdk.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644 --- a/include/configs/socfpga_cyclone5_socdk.h +++ b/include/configs/socfpga_cyclone5_socdk.h @@ -58,9 +58,15 @@
#endif
+/* U-Boot environment */
#define CONFIG_ENV_IS_IN_MMC
+#ifdef CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0 /* device 0
*/
#define CONFIG_ENV_OFFSET 512 /* just after
the MBR */ +#elif CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_ENV_SECT_SIZE (64 * 1024) +#define CONFIG_ENV_OFFSET 0x400000
The offset of the env is therefore 4 MiB, right ? This does not match with the other patch:
[PATCH 1/6] arm: socfpga: cyclone5-socdk: Enabling mtd partitioning layout
Oops good catch as I should use 256kB, not 4MB. Let fix that.
Please be more careful next time. Also, it might make sense to enable redundant environment in QSPI NOR.
Yah, I plan to put the environment to be larger so this is possible in the future.
I think 2x 64k env partition is enough.
Best regards, Marek Vasut
participants (3)
-
Chin Liang See
-
Marek Vasut
-
Pavel Machek