ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig

Join the party of some ARM boards and drop more
items from include/configs/xxx.h.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/configs/emsdp_defconfig b/configs/emsdp_defconfig
index 273334b..64281d0 100644
--- a/configs/emsdp_defconfig
+++ b/configs/emsdp_defconfig
@@ -3,6 +3,7 @@
 CONFIG_CPU_ARCEM6=y
 CONFIG_TARGET_EMSDP=y
 CONFIG_SYS_TEXT_BASE=0x00000000
+CONFIG_ENV_SIZE=0x1000
 CONFIG_SYS_CLK_FREQ=40000000
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
 CONFIG_VERSION_VARIABLE=y
diff --git a/configs/iot_devkit_defconfig b/configs/iot_devkit_defconfig
index 1b6dd9e..24bbe3f 100644
--- a/configs/iot_devkit_defconfig
+++ b/configs/iot_devkit_defconfig
@@ -5,6 +5,7 @@
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_TARGET_IOT_DEVKIT=y
 CONFIG_SYS_TEXT_BASE=0x00000000
+CONFIG_ENV_SIZE=0x1000
 CONFIG_SYS_CLK_FREQ=16000000
 CONFIG_LOCALVERSION="-iotdk-1.0"
 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index f30053d..e3837d9 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
 CONFIG_SYS_TEXT_BASE=0x84000000
+CONFIG_ENV_SIZE=0x800
 CONFIG_SYS_CLK_FREQ=500000000
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
diff --git a/env/Kconfig b/env/Kconfig
index 9011109..c22cbbd 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -431,7 +431,7 @@
 	  It's a string of the EXT4 file name. This file use to store the
 	  environment (explicit path to the file)
 
-if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
+if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARC
 
 config ENV_OFFSET
 	hex "Environment Offset"
@@ -441,6 +441,7 @@
 	default 0x88000 if ARCH_SUNXI
 	default 0xE0000 if ARCH_ZYNQ
 	default 0x1E00000 if ARCH_ZYNQMP
+	default 0 if ARC
 	help
 	  Offset from the start of the device (or partition)
 
@@ -449,6 +450,7 @@
 	default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
 	default 0x20000 if ARCH_SUNXI || ARCH_ZYNQ
 	default 0x8000 if ARCH_ROCKCHIP || ARCH_ZYNQMP || ARCH_VERSAL
+	default 0x4000 if ARC
 	help
 	  Size of the environment storage area
 
diff --git a/include/configs/axs10x.h b/include/configs/axs10x.h
index 1224815..e128d1c 100644
--- a/include/configs/axs10x.h
+++ b/include/configs/axs10x.h
@@ -62,7 +62,6 @@
 /*
  * Environment settings
  */
-#define CONFIG_ENV_SIZE			SZ_16K
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"upgrade=if mmc rescan && " \
 		"fatload mmc 0:1 ${loadaddr} u-boot-update.img && " \
diff --git a/include/configs/emsdp.h b/include/configs/emsdp.h
index e6b2469..a872d48 100644
--- a/include/configs/emsdp.h
+++ b/include/configs/emsdp.h
@@ -21,7 +21,6 @@
 /*
  * Environment
  */
-#define CONFIG_ENV_SIZE			SZ_4K
 #define CONFIG_BOOTFILE			"app.bin"
 #define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
 
diff --git a/include/configs/hsdk.h b/include/configs/hsdk.h
index 92cf3a1..9af1d12 100644
--- a/include/configs/hsdk.h
+++ b/include/configs/hsdk.h
@@ -57,8 +57,6 @@
 /*
  * Environment settings
  */
-#define CONFIG_ENV_SIZE			SZ_16K
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"upgrade=if mmc rescan && " \
 		"fatload mmc 0:1 ${loadaddr} u-boot-update.scr && " \
diff --git a/include/configs/iot_devkit.h b/include/configs/iot_devkit.h
index cd1309d..1ba69d9 100644
--- a/include/configs/iot_devkit.h
+++ b/include/configs/iot_devkit.h
@@ -74,7 +74,6 @@
 /*
  * Environment
  */
-#define CONFIG_ENV_SIZE			SZ_4K
 #define CONFIG_BOOTFILE			"app.bin"
 #define CONFIG_LOADADDR			CONFIG_SYS_LOAD_ADDR
 
diff --git a/include/configs/nsim.h b/include/configs/nsim.h
index c3f34a9..61217bb 100644
--- a/include/configs/nsim.h
+++ b/include/configs/nsim.h
@@ -25,12 +25,6 @@
 #define CONFIG_SYS_LOAD_ADDR		0x82000000
 
 /*
- * Environment settings
- */
-#define CONFIG_ENV_SIZE			SZ_512
-#define CONFIG_ENV_OFFSET		0
-
-/*
  * Environment configuration
  */
 #define CONFIG_BOOTFILE			"uImage"
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 96e5b63..a761c37 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -53,12 +53,6 @@
  */
 
 /*
- * Environment settings
- */
-#define CONFIG_ENV_SIZE			SZ_2K
-#define CONFIG_ENV_OFFSET		0
-
-/*
  * Environment configuration
  */
 #define CONFIG_BOOTFILE			"uImage"