Skip to contentSkip to conversation

env: Added support to save env to spi through Kconfig

PATCH New Vipul Kumar 1 participant 1 message Jul 17, 2018 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 env: Added support to save env to spi through Kconfig

This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.

---
Changes in v2:
- Changed if condition of ENV_SIZE for Zynqmp
- Changed if condition for ENV_SECT_SIZE

---
 env/Kconfig                     | 28 ++++++++++++++++++++++++++++
 include/configs/xilinx_zynqmp.h |  3 ---
 include/configs/zynq-common.h   | 13 -------------
 3 files changed, 28 insertions(+), 16 deletions(-)
env/Kconfig +28 -0
index 8618376..b37dcd7 100644
@@ -480,6 +480,34 @@ config ENV_SIZE
 
 endif
 
+if ARCH_ZYNQMP || ARCH_ZYNQ
+
+config ENV_OFFSET
+	hex "Environment Offset"
+	depends on !ENV_IS_NOWHERE
+	default 0x1E00000 if ARCH_ZYNQMP
+	default 0xE0000 if ARCH_ZYNQ
+	help
+	  Offset from the start of the device (or partition)
+
+config ENV_SIZE
+	hex "Environment Size"
+	default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
+	default 0x8000 if ARCH_ZYNQMP
+	default 0x20000 if ARCH_ZYNQ
+	help
+	  Size of the environment storage area.
+
+config ENV_SECT_SIZE
+	hex "Environment Sector-Size"
+	depends on !ENV_IS_NOWHERE
+	default 0x40000 if ARCH_ZYNQMP
+	default 0x20000 if ARCH_ZYNQ
+	help
+	  Size of the sector containing the environment.
+
+endif
+
 config USE_DEFAULT_ENV_FILE
 	bool "Create default environment from file"
 	help
include/configs/xilinx_zynqmp.h +0 -3
index ebc6c6f..ef242c7 100644
@@ -99,9 +99,6 @@
 # define PARTS_DEFAULT
 #endif
 
-/* Do not preserve environment */
-#define CONFIG_ENV_SIZE			0x8000
-
 /* Monitor Command Prompt */
 /* Console I/O Buffer Size */
 #define CONFIG_SYS_CBSIZE		2048
include/configs/zynq-common.h +0 -13
index a6f2ace..c41dc2c 100644
@@ -121,22 +121,9 @@
 # define CONFIG_SYS_EEPROM_SIZE			1024 /* Bytes */
 #endif
 
-/* Total Size of Environment Sector */
-#ifndef CONFIG_ENV_SIZE
-# define CONFIG_ENV_SIZE			(128 << 10)
-#endif
-
 /* Allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
-/* Environment */
-#ifndef CONFIG_ENV_IS_NOWHERE
-# define CONFIG_ENV_SECT_SIZE		CONFIG_ENV_SIZE
-# ifndef CONFIG_ENV_OFFSET
-#  define CONFIG_ENV_OFFSET		0xE0000
-# endif
-#endif
-
 /* enable preboot to be loaded before CONFIG_BOOTDELAY */
 #define CONFIG_PREBOOT
 
Signature · 1 line
2.7.4