]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: Added support to save env to spi through Kconfig
authorVipul Kumar <vipul.kumar@xilinx.com>
Tue, 17 Jul 2018 13:30:34 +0000 (19:00 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Jul 2018 08:49:56 +0000 (10:49 +0200)
This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.

Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
configs/bitmain_antminer_s9_defconfig
env/Kconfig
include/configs/bitmain_antminer_s9.h
include/configs/xilinx_zynqmp.h
include/configs/zynq-common.h

index 40bce4e3748202bcef110c6069a323b0976400b6..f59c767242f163e3af1c0a11d2ff9bedff4fd3e1 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_SYS_BOARD="antminer_s9"
 CONFIG_SYS_CONFIG_NAME="bitmain_antminer_s9"
 CONFIG_ARCH_ZYNQ=y
 CONFIG_SYS_TEXT_BASE=0x4000000
+CONFIG_ENV_OFFSET=0x300000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BASE=0xe0001000
 CONFIG_DEBUG_UART_CLOCK=50000000
index 8618376f252f68cbe30726b60dc64141d3521573..b37dcd78eb75176a0847bf4a90cd5fb68a3fda8a 100644 (file)
@@ -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
index 226750215e757742171a083fcf206ff1a2b67fcd..a9f45f19295a7828c946f319fda19c182d7daa24 100644 (file)
@@ -9,9 +9,6 @@
 #define CONFIG_SYS_SDRAM_BASE  0x00000000
 #define CONFIG_SYS_SDRAM_SIZE  0x40000000
 
-#define CONFIG_ENV_SIZE                0x20000
-#define CONFIG_ENV_OFFSET      0x300000
-
 #define CONFIG_BOOTP_SERVERIP
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
index ebc6c6f3e0209acd6b3d4d9d00eb2d01091c2501..ef242c7962538417f3ab0442fde07516614e7675 100644 (file)
@@ -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
index a6f2aceea1def75f60e32637874bf9d3bbc0bd09..c41dc2c9070e55de099ca2aa867cdfde5e32cd10 100644 (file)
 # 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