summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-11-18 20:02:07 -0500
committerTom Rini <trini@konsulko.com>2019-11-20 18:31:24 -0500
commita8992e788aba46f6f129af3111682be86236074f (patch)
treeab5b83a45f55ad016ef020320bb2960cf7337f27 /include
parent3eee45d93681a9c6bb67b73068da4dc179ae4e7f (diff)
env: Remove useless CONFIG_ENV_SIZE_REDUND and fix ENV_IS_REDUND check
We have CONFIG_ENV_SIZE_IS_REDUND but don't really use it. We have one board where we can simply multiple CONFIG_ENV_SIZE by two for the same result. The other place where we could but were not previously using this is for where env_internal.h checks for if we should set ENV_IS_EMBEDDED. This seems like the most likely use, historically, of the variable, but it was not used. Add logic to check for this now. Cc: Wolfgang Denk <wd@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include')
-rw-r--r--include/configs/MPC8308RDB.h1
-rw-r--r--include/configs/MPC8313ERDB_NAND.h1
-rw-r--r--include/configs/MPC8349EMDS.h1
-rw-r--r--include/configs/MPC8349EMDS_SDRAM.h1
-rw-r--r--include/configs/MigoR.h1
-rw-r--r--include/configs/TQM834x.h1
-rw-r--r--include/configs/UCP1020.h2
-rw-r--r--include/configs/am335x_shc.h1
-rw-r--r--include/configs/apf27.h1
-rw-r--r--include/configs/apx4devkit.h1
-rw-r--r--include/configs/armadillo-800eva.h1
-rw-r--r--include/configs/bk4r1.h1
-rw-r--r--include/configs/blanche.h1
-rw-r--r--include/configs/caddy2.h1
-rw-r--r--include/configs/condor.h1
-rw-r--r--include/configs/dh_imx6.h1
-rw-r--r--include/configs/display5.h1
-rw-r--r--include/configs/draco.h1
-rw-r--r--include/configs/eagle.h1
-rw-r--r--include/configs/edb93xx.h1
-rw-r--r--include/configs/etamin.h1
-rw-r--r--include/configs/flea3.h1
-rw-r--r--include/configs/gardena-smart-gateway-mt7688.h1
-rw-r--r--include/configs/gazerbeam.h1
-rw-r--r--include/configs/gw_ventana.h1
-rw-r--r--include/configs/hrcon.h1
-rw-r--r--include/configs/ids8313.h1
-rw-r--r--include/configs/imx27lite-common.h1
-rw-r--r--include/configs/km/km-mpc83xx.h1
-rw-r--r--include/configs/km/km_arm.h1
-rw-r--r--include/configs/kp_imx53.h1
-rw-r--r--include/configs/m53menlo.h1
-rw-r--r--include/configs/mccmon6.h1
-rw-r--r--include/configs/mpc8308_p1m.h1
-rw-r--r--include/configs/mx28evk.h1
-rw-r--r--include/configs/mx35pdk.h1
-rw-r--r--include/configs/novena.h1
-rw-r--r--include/configs/pcm052.h1
-rw-r--r--include/configs/pcm058.h1
-rw-r--r--include/configs/pfla02.h1
-rw-r--r--include/configs/platinum.h1
-rw-r--r--include/configs/rastaban.h1
-rw-r--r--include/configs/rcar-gen2-common.h1
-rw-r--r--include/configs/rcar-gen3-common.h1
-rw-r--r--include/configs/sbc8349.h1
-rw-r--r--include/configs/sh7752evb.h1
-rw-r--r--include/configs/sh7753evb.h1
-rw-r--r--include/configs/sh7757lcr.h1
-rw-r--r--include/configs/sh7763rdp.h1
-rw-r--r--include/configs/sksimx6.h1
-rw-r--r--include/configs/socfpga_vining_fpga.h1
-rw-r--r--include/configs/socrates.h1
-rw-r--r--include/configs/strider.h1
-rw-r--r--include/configs/tam3517-common.h1
-rw-r--r--include/configs/thuban.h1
-rw-r--r--include/configs/titanium.h1
-rw-r--r--include/configs/vcoreiii.h1
-rw-r--r--include/configs/vct.h1
-rw-r--r--include/configs/ve8313.h1
-rw-r--r--include/configs/vining_2000.h1
-rw-r--r--include/configs/vme8349.h1
-rw-r--r--include/configs/woodburn_common.h1
-rw-r--r--include/configs/x600.h1
-rw-r--r--include/env_internal.h7
64 files changed, 5 insertions, 66 deletions
diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index 85d7ff6c52..e4a51d2d27 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -253,7 +253,6 @@
#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
diff --git a/include/configs/MPC8313ERDB_NAND.h b/include/configs/MPC8313ERDB_NAND.h
index 4153d609be..fb09c2630f 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -300,7 +300,6 @@
#define CONFIG_ENV_OFFSET (512 * 1024)
#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_RANGE (CONFIG_ENV_SECT_SIZE * 4)
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 7352e34b9c..10293bd5f1 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -276,7 +276,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/MPC8349EMDS_SDRAM.h b/include/configs/MPC8349EMDS_SDRAM.h
index 2ae1069e4f..0193a6bfb7 100644
--- a/include/configs/MPC8349EMDS_SDRAM.h
+++ b/include/configs/MPC8349EMDS_SDRAM.h
@@ -331,7 +331,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
index 64172f3619..fab355e1f2 100644
--- a/include/configs/MigoR.h
+++ b/include/configs/MigoR.h
@@ -83,7 +83,6 @@
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
/* Offset of env Flash sector relative to CONFIG_SYS_FLASH_BASE */
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
/* Board Clock */
#define CONFIG_SYS_CLK_FREQ 33333333
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
index 9bf5d9d3fd..c8537e0313 100644
--- a/include/configs/TQM834x.h
+++ b/include/configs/TQM834x.h
@@ -191,7 +191,6 @@
#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K (one sector) for env */
#define CONFIG_ENV_SIZE 0x8000 /* 32K max size */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
diff --git a/include/configs/UCP1020.h b/include/configs/UCP1020.h
index 40080f512b..b2778a93c9 100644
--- a/include/configs/UCP1020.h
+++ b/include/configs/UCP1020.h
@@ -388,7 +388,6 @@
#if defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT)
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#endif
#elif defined(CONFIG_RAMBOOT_SDCARD)
@@ -408,7 +407,6 @@
#if defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT)
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#endif
#endif
diff --git a/include/configs/am335x_shc.h b/include/configs/am335x_shc.h
index f4a000f020..b34e48cb45 100644
--- a/include/configs/am335x_shc.h
+++ b/include/configs/am335x_shc.h
@@ -51,7 +51,6 @@
#define CONFIG_HSMMC2_8BIT
#define CONFIG_ENV_OFFSET_REDUND 0x9000 /* 36 kB */
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#ifndef CONFIG_SHC_ICT
/*
diff --git a/include/configs/apf27.h b/include/configs/apf27.h
index 044ce4467e..16a2574063 100644
--- a/include/configs/apf27.h
+++ b/include/configs/apf27.h
@@ -71,7 +71,6 @@
#define CONFIG_ENV_RANGE 0X00080000 /* 512kB */
#define CONFIG_ENV_OFFSET_REDUND \
(CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) /* +512kB */
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE /* 512kB */
#define CONFIG_FIRMWARE_OFFSET 0x00200000
#define CONFIG_FIRMWARE_SIZE 0x00080000 /* 512kB */
#define CONFIG_KERNEL_OFFSET 0x00300000
diff --git a/include/configs/apx4devkit.h b/include/configs/apx4devkit.h
index 09de1c06ef..66b616c80b 100644
--- a/include/configs/apx4devkit.h
+++ b/include/configs/apx4devkit.h
@@ -35,7 +35,6 @@
#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
#define CONFIG_ENV_SIZE (128 * 1024)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_RANGE (384 * 1024)
#define CONFIG_ENV_OFFSET 0x120000
#define CONFIG_ENV_OFFSET_REDUND \
diff --git a/include/configs/armadillo-800eva.h b/include/configs/armadillo-800eva.h
index c3ccceedca..dc611da035 100644
--- a/include/configs/armadillo-800eva.h
+++ b/include/configs/armadillo-800eva.h
@@ -75,7 +75,6 @@
CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
/* SH Ether */
#define CONFIG_SH_ETHER_USE_PORT 0
diff --git a/include/configs/bk4r1.h b/include/configs/bk4r1.h
index 285e28b535..2575a0de3f 100644
--- a/include/configs/bk4r1.h
+++ b/include/configs/bk4r1.h
@@ -263,7 +263,6 @@
#define CONFIG_ENV_SECT_SIZE (SZ_128K)
#define CONFIG_ENV_SIZE (SZ_8K)
#define CONFIG_ENV_OFFSET 0x200000
-#define CONFIG_ENV_SIZE_REDUND (SZ_8K)
#define CONFIG_ENV_OFFSET_REDUND 0x220000
#endif
diff --git a/include/configs/blanche.h b/include/configs/blanche.h
index 8774bde331..7f4a204a39 100644
--- a/include/configs/blanche.h
+++ b/include/configs/blanche.h
@@ -59,7 +59,6 @@
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
#endif
#endif /* __BLANCHE_H */
diff --git a/include/configs/caddy2.h b/include/configs/caddy2.h
index 89deeac4e7..2c4f2c5b73 100644
--- a/include/configs/caddy2.h
+++ b/include/configs/caddy2.h
@@ -205,7 +205,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/condor.h b/include/configs/condor.h
index e3c146e824..c84d127f49 100644
--- a/include/configs/condor.h
+++ b/include/configs/condor.h
@@ -16,7 +16,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Environment compatibility */
-#undef CONFIG_ENV_SIZE_REDUND
#undef CONFIG_ENV_SECT_SIZE
#define CONFIG_ENV_SECT_SIZE (256 * 1024)
#define CONFIG_ENV_OFFSET 0x700000
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index d4bd88f511..66a1b980ee 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -144,7 +144,6 @@
#define CONFIG_ENV_SECT_SIZE (64 * 1024)
#define CONFIG_ENV_OFFSET_REDUND \
(CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#endif
#endif /* __DH_IMX6_CONFIG_H */
diff --git a/include/configs/display5.h b/include/configs/display5.h
index 7b171489e3..b353cffbfc 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -354,7 +354,6 @@
#define CONFIG_ENV_SECT_SIZE (SZ_64K)
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#endif
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
diff --git a/include/configs/draco.h b/include/configs/draco.h
index ffeb3982b5..e566ccef2a 100644
--- a/include/configs/draco.h
+++ b/include/configs/draco.h
@@ -42,7 +42,6 @@
/* Define own nand partitions */
#define CONFIG_ENV_OFFSET_REDUND 0x2E0000
-#define CONFIG_ENV_SIZE_REDUND 0x2000
#define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE)
#ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/eagle.h b/include/configs/eagle.h
index f0e4bcaa29..5f2fe42d2e 100644
--- a/include/configs/eagle.h
+++ b/include/configs/eagle.h
@@ -16,7 +16,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Environment compatibility */
-#undef CONFIG_ENV_SIZE_REDUND
#undef CONFIG_ENV_SECT_SIZE
#define CONFIG_ENV_SECT_SIZE (256 * 1024)
#define CONFIG_ENV_OFFSET 0x700000
diff --git a/include/configs/edb93xx.h b/include/configs/edb93xx.h
index 84cbcdda93..6526a83141 100644
--- a/include/configs/edb93xx.h
+++ b/include/configs/edb93xx.h
@@ -183,7 +183,6 @@
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_USB_OHCI_NEW
#define CONFIG_USB_OHCI_EP93XX
diff --git a/include/configs/etamin.h b/include/configs/etamin.h
index 726f8a500f..8e09f73a88 100644
--- a/include/configs/etamin.h
+++ b/include/configs/etamin.h
@@ -112,7 +112,6 @@
/* Define own nand partitions */
#define CONFIG_ENV_OFFSET_REDUND 0xB80000
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE)
diff --git a/include/configs/flea3.h b/include/configs/flea3.h
index 4cd823fa36..4b8b2dc4ad 100644
--- a/include/configs/flea3.h
+++ b/include/configs/flea3.h
@@ -117,7 +117,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
CONFIG_SYS_MONITOR_LEN)
diff --git a/include/configs/gardena-smart-gateway-mt7688.h b/include/configs/gardena-smart-gateway-mt7688.h
index 94c5b8daf3..cfa7d1c674 100644
--- a/include/configs/gardena-smart-gateway-mt7688.h
+++ b/include/configs/gardena-smart-gateway-mt7688.h
@@ -43,7 +43,6 @@
#define CONFIG_ENV_SECT_SIZE (64 << 10)
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
/*
* Environment is right behind U-Boot in flash. Make sure U-Boot
diff --git a/include/configs/gazerbeam.h b/include/configs/gazerbeam.h
index 0ff48287ac..8c01097245 100644
--- a/include/configs/gazerbeam.h
+++ b/include/configs/gazerbeam.h
@@ -60,7 +60,6 @@
#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_LOADS_ECHO /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index e543061bff..8b0f4d4d90 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -163,7 +163,6 @@
#define CONFIG_ENV_SECT_SIZE (128 * SZ_1K)
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 * SZ_1K))
- #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
#define CONFIG_ENV_OFFSET (512 * SZ_1K)
#define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index 8fb321178f..cd59b840e9 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -357,7 +357,6 @@ void fpga_control_clear(unsigned int bus, int pin);
#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#else
#define CONFIG_ENV_SIZE 0x2000 /* 8KB */
#endif
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index 43cb14c14e..71063653fa 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -227,7 +227,6 @@
+ CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_SIZE 0x20000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#define CONFIG_NETDEV eth1
#define CONFIG_HOSTNAME "ids8313"
diff --git a/include/configs/imx27lite-common.h b/include/configs/imx27lite-common.h
index 730e874c9f..a2d0ade015 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -98,7 +98,6 @@
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
/*
* Ethernet
diff --git a/include/configs/km/km-mpc83xx.h b/include/configs/km/km-mpc83xx.h
index c06143c68b..a9899fe459 100644
--- a/include/configs/km/km-mpc83xx.h
+++ b/include/configs/km/km-mpc83xx.h
@@ -117,7 +117,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else /* CFG_SYS_RAMBOOT */
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 64c968b63b..63fa6675ff 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -155,7 +155,6 @@ int get_scl(void);
#define CONFIG_ENV_SIZE (0x2000 - CONFIG_ENV_OFFSET)
#define CONFIG_I2C_ENV_EEPROM_BUS 5 /* I2C2 (Mux-Port 5) */
#define CONFIG_ENV_OFFSET_REDUND 0x2000 /* no bracets! */
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#endif
#define KM_FLASH_GPIO_PIN 16
diff --git a/include/configs/kp_imx53.h b/include/configs/kp_imx53.h
index ff564b27ec..85224c3f46 100644
--- a/include/configs/kp_imx53.h
+++ b/include/configs/kp_imx53.h
@@ -99,7 +99,6 @@
/* environment organization */
#define CONFIG_ENV_OFFSET (SZ_1M)
#define CONFIG_ENV_SIZE (SZ_8K)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
#define CONFIG_SYS_MMC_ENV_DEV 0
diff --git a/include/configs/m53menlo.h b/include/configs/m53menlo.h
index 113e84456d..701bf2a597 100644
--- a/include/configs/m53menlo.h
+++ b/include/configs/m53menlo.h
@@ -72,7 +72,6 @@
#define CONFIG_MXC_NAND_HWECC
/* Environment is in NAND */
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_OFFSET (8 * CONFIG_ENV_SECT_SIZE) /* 1 MiB */
diff --git a/include/configs/mccmon6.h b/include/configs/mccmon6.h
index c75519c195..50afc7c608 100644
--- a/include/configs/mccmon6.h
+++ b/include/configs/mccmon6.h
@@ -252,6 +252,5 @@
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x40000)
#define CONFIG_ENV_ADDR_REDUND (CONFIG_SYS_FLASH_BASE + 0x60000)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#endif /* __CONFIG_H * */
diff --git a/include/configs/mpc8308_p1m.h b/include/configs/mpc8308_p1m.h
index 3ce4b705b7..5a8546838f 100644
--- a/include/configs/mpc8308_p1m.h
+++ b/include/configs/mpc8308_p1m.h
@@ -232,7 +232,6 @@
#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 2fad2c7a84..7e7637ebec 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -34,7 +34,6 @@
/* Environment is in NAND */
#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
#define CONFIG_ENV_RANGE (512 * 1024)
#define CONFIG_ENV_OFFSET 0x300000
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index e153dfb199..4ec36193c0 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -133,7 +133,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
CONFIG_SYS_MONITOR_LEN)
diff --git a/include/configs/novena.h b/include/configs/novena.h
index cdc437c492..fff2396e98 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -28,7 +28,6 @@
#ifdef CONFIG_CMD_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_OFFSET (512 * 1024)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_OFFSET_REDUND \
(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
#endif
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index fb8f3c8609..b68d205bfb 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -178,7 +178,6 @@
#define CONFIG_ENV_SECT_SIZE (SZ_128K)
#define CONFIG_ENV_SIZE (SZ_8K)
#define CONFIG_ENV_OFFSET 0xA0000
-#define CONFIG_ENV_SIZE_REDUND (SZ_8K)
#define CONFIG_ENV_OFFSET_REDUND 0xC0000
#endif
diff --git a/include/configs/pcm058.h b/include/configs/pcm058.h
index b9f5ad3260..6c4a619433 100644
--- a/include/configs/pcm058.h
+++ b/include/configs/pcm058.h
@@ -78,7 +78,6 @@
#define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#ifdef CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET (0x1E0000)
diff --git a/include/configs/pfla02.h b/include/configs/pfla02.h
index 9a169351a3..a4d0e4898a 100644
--- a/include/configs/pfla02.h
+++ b/include/configs/pfla02.h
@@ -79,7 +79,6 @@
#define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#ifdef CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET (0x1E0000)
diff --git a/include/configs/platinum.h b/include/configs/platinum.h
index 1b57e9931f..58e590a1fd 100644
--- a/include/configs/platinum.h
+++ b/include/configs/platinum.h
@@ -78,7 +78,6 @@
#define CONFIG_ENV_SECT_SIZE (128 << 10)
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#else /* CONFIG_CMD_NAND */
diff --git a/include/configs/rastaban.h b/include/configs/rastaban.h
index c69535aa6d..c34b68a374 100644
--- a/include/configs/rastaban.h
+++ b/include/configs/rastaban.h
@@ -47,7 +47,6 @@
/* Define own nand partitions */
#define CONFIG_ENV_OFFSET_REDUND 0x2E0000
-#define CONFIG_ENV_SIZE_REDUND 0x2000
#define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE)
#ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/rcar-gen2-common.h b/include/configs/rcar-gen2-common.h
index e940a8b70a..3a763336ed 100644
--- a/include/configs/rcar-gen2-common.h
+++ b/include/configs/rcar-gen2-common.h
@@ -43,7 +43,6 @@
#define CONFIG_ENV_SECT_SIZE (256 * 1024)
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_SYS_MONITOR_LEN)
/* SF MTD */
#ifdef CONFIG_SPL_BUILD
diff --git a/include/configs/rcar-gen3-common.h b/include/configs/rcar-gen3-common.h
index 95bd97c0ec..0f7a00f957 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -54,7 +54,6 @@
#define CONFIG_ENV_OVERWRITE
#define CONFIG_ENV_SECT_SIZE (128 * 1024)
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index d2053cc059..01d4802885 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -229,7 +229,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/sh7752evb.h b/include/configs/sh7752evb.h
index cd7f51c7ce..02c5143491 100644
--- a/include/configs/sh7752evb.h
+++ b/include/configs/sh7752evb.h
@@ -67,7 +67,6 @@
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_OVERWRITE 1
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
#define CONFIG_EXTRA_ENV_SETTINGS \
"netboot=bootp; bootm\0"
diff --git a/include/configs/sh7753evb.h b/include/configs/sh7753evb.h
index 6b00bd7d90..ae76254589 100644
--- a/include/configs/sh7753evb.h
+++ b/include/configs/sh7753evb.h
@@ -67,7 +67,6 @@
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_OVERWRITE 1
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
#define CONFIG_EXTRA_ENV_SETTINGS \
"netboot=bootp; bootm\0"
diff --git a/include/configs/sh7757lcr.h b/include/configs/sh7757lcr.h
index f1955a16b9..04b6879644 100644
--- a/include/configs/sh7757lcr.h
+++ b/include/configs/sh7757lcr.h
@@ -79,7 +79,6 @@
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR)
#define CONFIG_ENV_OVERWRITE 1
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
#define CONFIG_EXTRA_ENV_SETTINGS \
"netboot=bootp; bootm\0"
diff --git a/include/configs/sh7763rdp.h b/include/configs/sh7763rdp.h
index 10961b14ba..620cf5af50 100644
--- a/include/configs/sh7763rdp.h
+++ b/include/configs/sh7763rdp.h
@@ -60,7 +60,6 @@
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + (1 * CONFIG_ENV_SECT_SIZE))
/* Offset of env Flash sector relative to CONFIG_SYS_FLASH_BASE */
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_ADDR_REDUND (CONFIG_SYS_FLASH_BASE + (2 * CONFIG_ENV_SECT_SIZE))
/* Clock */
diff --git a/include/configs/sksimx6.h b/include/configs/sksimx6.h
index e1a7d724c1..b2ca7b1a72 100644
--- a/include/configs/sksimx6.h
+++ b/include/configs/sksimx6.h
@@ -58,7 +58,6 @@
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
/* Default environment */
#define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/socfpga_vining_fpga.h b/include/configs/socfpga_vining_fpga.h
index abde883487..5cc12419a6 100644
--- a/include/configs/socfpga_vining_fpga.h
+++ b/include/configs/socfpga_vining_fpga.h
@@ -195,7 +195,6 @@
"fi\0" \
"socfpga_legacy_reset_compat=1\0"
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_SECT_SIZE (64 * 1024)
#define CONFIG_ENV_OFFSET 0x100000
#define CONFIG_ENV_OFFSET_REDUND \
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index a03005902f..f5f3316b90 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -192,7 +192,6 @@
CONFIG_ENV_SECT_SIZE - CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_SIZE 0x4000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR - CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
diff --git a/include/configs/strider.h b/include/configs/strider.h
index e3d64e52aa..d270d8a2dd 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -390,7 +390,6 @@ void fpga_control_clear(unsigned int bus, int pin);
#define CONFIG_ENV_SECT_SIZE 0x10000 /* 64K(one sector) for env */
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#else
#define CONFIG_ENV_SIZE 0x2000 /* 8KB */
#endif
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 121de2bd24..69819da492 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -114,7 +114,6 @@
#define CONFIG_ENV_ADDR 0x180000
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
2 * CONFIG_SYS_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
diff --git a/include/configs/thuban.h b/include/configs/thuban.h
index 569df9e4d8..954b063e29 100644
--- a/include/configs/thuban.h
+++ b/include/configs/thuban.h
@@ -40,7 +40,6 @@
/* Define own nand partitions */
#define CONFIG_ENV_OFFSET_REDUND 0x2E0000
-#define CONFIG_ENV_SIZE_REDUND 0x2000
#define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE)
#ifndef CONFIG_SPL_BUILD
diff --git a/include/configs/titanium.h b/include/configs/titanium.h
index c24d657dba..64ec06da85 100644
--- a/include/configs/titanium.h
+++ b/include/configs/titanium.h
@@ -149,7 +149,6 @@
#define CONFIG_ENV_SECT_SIZE (128 << 10)
#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#else /* CONFIG_CMD_NAND */
diff --git a/include/configs/vcoreiii.h b/include/configs/vcoreiii.h
index 7ed9524359..6ff68cd6a0 100644
--- a/include/configs/vcoreiii.h
+++ b/include/configs/vcoreiii.h
@@ -30,7 +30,6 @@
#define CONFIG_ENV_SIZE (8 * 1024)
#define CONFIG_ENV_SECT_SIZE (256 * 1024)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
#endif
diff --git a/include/configs/vct.h b/include/configs/vct.h
index 571071593a..890f347b43 100644
--- a/include/configs/vct.h
+++ b/include/configs/vct.h
@@ -134,7 +134,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#endif /* CONFIG_ENV_IS_IN_FLASH */
#endif /* CONFIG_VCT_NOR */
diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
index 66f771d818..2608b2b232 100644
--- a/include/configs/ve8313.h
+++ b/include/configs/ve8313.h
@@ -202,7 +202,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND \
(CONFIG_ENV_OFFSET + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
diff --git a/include/configs/vining_2000.h b/include/configs/vining_2000.h
index 33f06c00b1..6672930fb3 100644
--- a/include/configs/vining_2000.h
+++ b/include/configs/vining_2000.h
@@ -88,7 +88,6 @@
#define CONFIG_ENV_OFFSET (8 * SZ_64K)
#define CONFIG_ENV_SIZE SZ_8K
#define CONFIG_ENV_OFFSET_REDUND (9 * SZ_64K)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#ifdef CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC4 eMMC */
diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h
index a4f2af4962..74e8d3925b 100644
--- a/include/configs/vme8349.h
+++ b/include/configs/vme8349.h
@@ -205,7 +205,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
#else
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - 0x1000)
diff --git a/include/configs/woodburn_common.h b/include/configs/woodburn_common.h
index 5ad3dab51c..d7c4a6f1f4 100644
--- a/include/configs/woodburn_common.h
+++ b/include/configs/woodburn_common.h
@@ -124,7 +124,6 @@
/* Address and size of Redundant Environment Sector */
#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
CONFIG_SYS_MONITOR_LEN)
diff --git a/include/configs/x600.h b/include/configs/x600.h
index d4bbdcdb13..f6779213a8 100644
--- a/include/configs/x600.h
+++ b/include/configs/x600.h
@@ -93,7 +93,6 @@
#define CONFIG_ENV_SIZE 0x02000
#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + \
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
/* Miscellaneous configurable options */
#define CONFIG_BOOT_PARAMS_ADDR 0x00000100
diff --git a/include/env_internal.h b/include/env_internal.h
index d520e6a55b..b8158c0e0b 100644
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -50,8 +50,11 @@
# else
# error "Both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE undefined"
# endif
-# if defined(CONFIG_ENV_ADDR_REDUND) && !defined(CONFIG_ENV_SIZE_REDUND)
-# define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+# if defined(CONFIG_ENV_ADDR_REDUND) && \
+ ((CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
+ (CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SIZE) <= \
+ (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
+# define ENV_IS_EMBEDDED
# endif
# if (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) && \
(CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <= \