Skip to contentSkip to conversation

arm: socfpga: cyclone5-socdk: Enabling U-Boot environment in QSPI

PATCH New Chin Liang See 3 participants 9 messages Dec 12, 2015 – Dec 13, 2015

lore
Share & tools
lore
#0 lore raw

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

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_cyclone5_socdk.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/socfpga_cyclone5_socdk.h +6 -0
index 67bb35f..340b2c7 100644
@@ -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
Signature · 1 line
1.9.2.468.g3f0c02a
#1 lore raw

PATCH v2 2/4 arm: socfpga: arria5-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

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_arria5_socdk.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/socfpga_arria5_socdk.h +6 -0
index ebb6ed5..927ade3 100644
@@ -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
Signature · 1 line
1.9.2.468.g3f0c02a
#2 lore raw

PATCH v2 3/4 arm: socfpga: sockit: Enabling U-Boot environment in QSPI

In reply to Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_sockit.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/socfpga_sockit.h +6 -0
index 5bcee05..ad3f275 100644
@@ -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
Signature · 1 line
1.9.2.468.g3f0c02a
#3 lore raw

PATCH v2 4/4 arm: socfpga: socrates: Enabling U-Boot environment in QSPI

In reply to Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_socrates.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/socfpga_socrates.h +6 -0
index 16a2a86..53af058 100644
@@ -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
Signature · 1 line
1.9.2.468.g3f0c02a
#4 lore raw

PATCH v2 4/4 arm: socfpga: socrates: Enabling U-Boot environment in QSPI

Quoted 18 lines · Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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_socrates.h +0 -0
@@ -54,9 +54,15 @@
 
 #endif

include/configs/socfpga_socrates.h line 65

Quoted 10 lines
include/configs/socfpga_socrates.h +6 -0
 
+/* 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

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw

PATCH v2 4/4 arm: socfpga: socrates: Enabling U-Boot environment in QSPI

Quoted 20 lines · Pavel Machek
Quoted 19 lines · Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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_socrates.h +0 -0
@@ -54,9 +54,15 @@
 
 #endif
 
Quoted 16 lines

include/configs/socfpga_socrates.h line 65

Quoted 11 lines
include/configs/socfpga_socrates.h +2 -0
+/* 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 */

include/configs/socfpga_socrates.h +4 -0
+#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

Quoted 2 lines

Thanks,
Pavel

#6 lore raw

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

In reply to Chin Liang See
Quoted 23 lines · Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_cyclone5_socdk.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644

include/configs/socfpga_cyclone5_socdk.h +0 -0
@@ -58,9 +58,15 @@
 

include/configs/socfpga_cyclone5_socdk.h line 68

Quoted 10 lines
include/configs/socfpga_cyclone5_socdk.h +5 -0
 #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

#7 lore raw

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

Quoted 42 lines · Marek Vasut
Quoted 33 lines · Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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

---
Changes for v2
- remove the undef

---
 include/configs/socfpga_cyclone5_socdk.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644

include/configs/socfpga_cyclone5_socdk.h +2 -0
@@ -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 */

include/configs/socfpga_cyclone5_socdk.h line 68

Quoted 3 lines
include/configs/socfpga_cyclone5_socdk.h +3 -0
+#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:

Quoted 3 lines

[PATCH 1/6] arm: socfpga: cyclone5-socdk: Enabling mtd partitioning layout

Oops good catch as I should use 256kB, not 4MB. Let fix that.

Quoted 3 lines

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

Quoted 2 lines

Best regards,
Marek Vasut

#8 lore raw

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

Quoted 53 lines · Chin Liang See
Quoted 49 lines · Marek Vasut
Quoted 40 lines · Chin Liang See

Enabling the support of storing U-Boot environment within serial NOR flash. By default, its still store into SDMMC

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

---
Changes for v2
- remove the undef
---

 include/configs/socfpga_cyclone5_socdk.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/include/configs/socfpga_cyclone5_socdk.h index 67bb35f..340b2c7 100644

include/configs/socfpga_cyclone5_socdk.h +2 -0
@@ -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 */

include/configs/socfpga_cyclone5_socdk.h line 68

Quoted 3 lines
include/configs/socfpga_cyclone5_socdk.h +3 -0
+#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:

Quoted 2 lines

[PATCH 1/6] arm: socfpga: cyclone5-socdk: Enabling mtd partitioning layout

Quoted 7 lines

Oops good catch as I should use 256kB, not 4MB. Let fix that.

Quoted 2 lines

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