Patchwork [U-Boot,28/34] zynq-common: Define flash env. partition

login
register
mail settings
Submitter Jagannadha Sutradharudu Teki
Date Nov. 5, 2013, 5:46 p.m.
Message ID <c0a39917-8cbc-419e-897f-ab447e012661@CH1EHSMHS022.ehs.local>
Download mbox | patch
Permalink /patch/288611/
State Accepted
Delegated to: Michal Simek
Headers show

Comments

Jagannadha Sutradharudu Teki - Nov. 5, 2013, 5:46 p.m.
Last 128Kb sector of 1Mb flash is defined as u-boot
environment partition.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
---
 include/configs/zynq-common.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Patch

diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index f571349..aed9f1f 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -154,7 +154,21 @@ 
 #define CONFIG_ENV_SIZE			(128 << 10)
 
 /* Environment */
-#define CONFIG_ENV_IS_NOWHERE
+#ifndef CONFIG_ENV_IS_NOWHERE
+# ifndef CONFIG_SYS_NO_FLASH
+#  define CONFIG_ENV_IS_IN_FLASH
+# elif defined(CONFIG_ZYNQ_QSPI)
+#  define CONFIG_ENV_IS_IN_SPI_FLASH
+# elif defined(CONFIG_NAND_ZYNQ)
+#  define CONFIG_ENV_IS_IN_NAND
+# elif defined(CONFIG_SYS_NO_FLASH)
+#  define CONFIG_ENV_IS_NOWHERE
+# endif
+
+# define CONFIG_ENV_SECT_SIZE		CONFIG_ENV_SIZE
+# define CONFIG_ENV_OFFSET		0xE0000
+# define CONFIG_CMD_SAVEENV
+#endif
 
 /* Default environment */
 #define CONFIG_EXTRA_ENV_SETTINGS	\