Skip to contentSkip to conversation

miscellaneous ubispl and ubi improvements

PATCH Superseded Markus Klotzbuecher 4 participants 24 messages May 15, 2019 – Jan 29, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover miscellaneous ubispl and ubi improvements

From: Markus Klotzbuecher <[email protected]>

This series contains a couple of UBI and UBI SPL improvements, notably a ubispl extension to allow loading volumes by name. The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates of U-Boot on UBI. To do that we configured the SPL to always load the same volume name (e.g. "u-boot"), and the software updater always installs into the secondary volume "u-boot_r". After a successful upgrade, these two volume names are switched.

This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching.

We have tested both with and without fastmap enabled and both paths seems to work reliably.

As per Heikos request, this v2 adds two patches that migrate the omap2plus and at91 CONFIG_ENV_* to defconfigs and likewise for the two boards using ubispl. The first migration was supported by an extension to the moveconfig script (patch 1) to expand simple expressions. Both migrations were tested to be binary equal before and after the change.

Changes v2:
- Add a patch (1) for moveconfig to expand simple expressions
- Add patch (3) to move at91 and omap2plus CONFIG_ENV_ to defconfigs
- Add patch (7) to migrate boards using ubispl to KConfig
- Add missing commit messages
- Indicate version of kernel code which was used in ubispl

Hamish Guthrie (2):
env: ubi: support configurable VID offset
ubispl: add support for loading volumes by name

Markus Klotzbuecher (7):
moveconfig: expand simple expressions
env: ubi: KConfig: add CONFIG_ENV_UBI_VOLUME_REDUND at91, omap2plus: configs: migrate CONFIG_ENV_ to defconfigs
ubi: fix UBI_SILENCE_MSG
ubispl: migrate configuration to Kconfig
configs: migrate ubispl boards to KConfig
ubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSG

 common/spl/Kconfig                            |  98 ++++++++
 common/spl/spl_ubi.c                          |   7 +
 configs/am335x_guardian_defconfig             |   2 +
 configs/am335x_igep003x_defconfig             |  16 ++
 configs/am335x_pdu001_defconfig               |   1 +
 configs/am335x_shc_defconfig                  |   2 +
 configs/am335x_shc_ict_defconfig              |   2 +
 configs/am335x_shc_netboot_defconfig          |   2 +
 configs/am335x_shc_sdboot_defconfig           |   2 +
 configs/am335x_sl50_defconfig                 |   1 +
 configs/am43xx_evm_defconfig                  |   1 +
 configs/am43xx_evm_qspiboot_defconfig         |   3 +
 configs/am43xx_evm_rtconly_defconfig          |   1 +
 configs/am43xx_evm_usbhost_boot_defconfig     |   1 +
 configs/am43xx_hs_evm_defconfig               |   1 +
 configs/at91rm9200ek_defconfig                |   3 +
 configs/at91rm9200ek_ram_defconfig            |   3 +
 configs/at91sam9260ek_dataflash_cs0_defconfig |   3 +
 configs/at91sam9260ek_dataflash_cs1_defconfig |   3 +
 configs/at91sam9261ek_dataflash_cs0_defconfig |   3 +
 configs/at91sam9261ek_dataflash_cs3_defconfig |   3 +
 configs/at91sam9263ek_dataflash_cs0_defconfig |   3 +
 configs/at91sam9263ek_dataflash_defconfig     |   3 +
 configs/at91sam9263ek_norflash_boot_defconfig |   3 +
 configs/at91sam9263ek_norflash_defconfig      |   3 +
 configs/at91sam9g10ek_dataflash_cs0_defconfig |   3 +
 configs/at91sam9g10ek_dataflash_cs3_defconfig |   3 +
 configs/at91sam9g20ek_2mmc_defconfig          |   2 +
 configs/at91sam9g20ek_dataflash_cs0_defconfig |   3 +
 configs/at91sam9g20ek_dataflash_cs1_defconfig |   3 +
 configs/at91sam9m10g45ek_mmc_defconfig        |   1 +
 configs/at91sam9n12ek_mmc_defconfig           |   1 +
 configs/at91sam9n12ek_spiflash_defconfig      |   3 +
 configs/at91sam9rlek_dataflash_defconfig      |   3 +
 configs/at91sam9rlek_mmc_defconfig            |   1 +
 configs/at91sam9x5ek_dataflash_defconfig      |   3 +
 configs/at91sam9x5ek_mmc_defconfig            |   1 +
 configs/at91sam9x5ek_spiflash_defconfig       |   3 +
 configs/at91sam9xeek_dataflash_cs0_defconfig  |   3 +
 configs/at91sam9xeek_dataflash_cs1_defconfig  |   3 +
 configs/axm_defconfig                         |   1 +
 configs/brppt1_mmc_defconfig                  |   2 +
 configs/brppt1_nand_defconfig                 |   2 +
 configs/brppt1_spi_defconfig                  |   3 +
 configs/brxre1_defconfig                      |   2 +
 configs/chiliboard_defconfig                  |   2 +
 configs/cm_t335_defconfig                     |   2 +
 configs/cm_t35_defconfig                      |   1 +
 configs/cm_t43_defconfig                      |   3 +
 configs/cm_t54_defconfig                      |   2 +
 configs/corvus_defconfig                      |   1 +
 configs/draco_defconfig                       |   1 +
 configs/eco5pk_defconfig                      |   1 +
 configs/etamin_defconfig                      |   2 +
 configs/ethernut5_defconfig                   |   3 +
 .../gardena-smart-gateway-at91sam_defconfig   |   4 +
 configs/gurnard_defconfig                     |   2 +
 configs/igep00x0_defconfig                    |  17 ++
 configs/mcx_defconfig                         |   1 +
 configs/meesc_dataflash_defconfig             |   3 +
 configs/meesc_defconfig                       |   1 +
 configs/mt_ventoux_defconfig                  |   1 +
 configs/omap3_overo_defconfig                 |   1 +
 configs/omap4_sdp4430_defconfig               |   1 +
 configs/pengwyn_defconfig                     |   1 +
 configs/picosam9g45_defconfig                 |   1 +
 configs/pm9261_defconfig                      |   3 +
 configs/pm9263_defconfig                      |   3 +
 configs/pxm2_defconfig                        |   1 +
 configs/rastaban_defconfig                    |   1 +
 configs/rut_defconfig                         |   1 +
 configs/sama5d27_som1_ek_mmc1_defconfig       |   1 +
 configs/sama5d27_som1_ek_mmc_defconfig        |   1 +
 configs/sama5d2_icp_mmc_defconfig             |   1 +
 configs/sama5d2_ptc_ek_mmc_defconfig          |   1 +
 configs/sama5d2_xplained_emmc_defconfig       |   1 +
 configs/sama5d2_xplained_mmc_defconfig        |   1 +
 configs/sama5d2_xplained_spiflash_defconfig   |   3 +
 configs/sama5d36ek_cmp_mmc_defconfig          |   1 +
 configs/sama5d36ek_cmp_spiflash_defconfig     |   3 +
 configs/sama5d3_xplained_mmc_defconfig        |   1 +
 configs/sama5d3xek_mmc_defconfig              |   1 +
 configs/sama5d3xek_spiflash_defconfig         |   3 +
 configs/sama5d4_xplained_mmc_defconfig        |   1 +
 configs/sama5d4_xplained_spiflash_defconfig   |   3 +
 configs/sama5d4ek_mmc_defconfig               |   1 +
 configs/sama5d4ek_spiflash_defconfig          |   3 +
 configs/smartweb_defconfig                    |   1 +
 configs/snapper9260_defconfig                 |   2 +
 configs/snapper9g20_defconfig                 |   2 +
 configs/taurus_defconfig                      |   1 +
 configs/thuban_defconfig                      |   1 +
 configs/ti816x_evm_defconfig                  |   2 +
 configs/tricorder_defconfig                   |   2 +
 configs/tricorder_flash_defconfig             |   1 +
 configs/twister_defconfig                     |   1 +
 configs/usb_a9263_dataflash_defconfig         |   3 +
 configs/vinco_defconfig                       |   3 +
 configs/wb45n_defconfig                       |   1 +
 configs/wb50n_defconfig                       |   1 +
 drivers/mtd/ubi/Kconfig                       |   2 +-
 drivers/mtd/ubi/io.c                          |   2 +
 drivers/mtd/ubispl/ubispl.c                   | 215 +++++++++++++++++-
 drivers/mtd/ubispl/ubispl.h                   |   9 +-
 env/Kconfig                                   |  24 +-
 env/ubi.c                                     |  17 +-
 include/configs/am335x_evm.h                  |   3 -
 include/configs/am335x_igep003x.h             |  23 --
 include/configs/am335x_sl50.h                 |   3 -
 include/configs/am3517_crane.h                |   2 -
 include/configs/am3517_evm.h                  |   2 -
 include/configs/am43xx_evm.h                  |   5 -
 include/configs/am57xx_evm.h                  |   2 -
 include/configs/at91-sama5_common.h           |   5 -
 include/configs/at91rm9200ek.h                |   2 +-
 include/configs/baltos.h                      |   3 -
 include/configs/bav335x.h                     |   3 -
 include/configs/brppt1.h                      |   5 -
 include/configs/chiliboard.h                  |   4 -
 include/configs/cm_t335.h                     |   2 -
 include/configs/cm_t35.h                      |   2 -
 include/configs/cm_t3517.h                    |   2 -
 include/configs/cm_t43.h                      |   5 -
 include/configs/corvus.h                      |   2 -
 include/configs/devkit8000.h                  |   6 -
 include/configs/dra7xx_evm.h                  |   2 -
 include/configs/ethernut5.h                   |   2 -
 .../configs/gardena-smart-gateway-at91sam.h   |   6 -
 include/configs/kc1.h                         |   2 -
 include/configs/mcx.h                         |   1 -
 include/configs/nokia_rx51.h                  |   1 -
 include/configs/omap3_beagle.h                |   4 -
 include/configs/omap3_cairo.h                 |   4 -
 include/configs/omap3_evm.h                   |   3 -
 include/configs/omap3_igep00x0.h              |  20 --
 include/configs/omap3_logic.h                 |   3 -
 include/configs/omap3_overo.h                 |   1 -
 include/configs/omap3_pandora.h               |   3 -
 include/configs/omap3_zoom1.h                 |   3 -
 include/configs/omap5_uevm.h                  |   2 -
 include/configs/pcm051.h                      |   1 -
 include/configs/pepper.h                      |   2 -
 include/configs/siemens-am33x-common.h        |   2 -
 include/configs/smartweb.h                    |   2 -
 include/configs/snapper9260.h                 |   2 -
 include/configs/snapper9g45.h                 |   2 -
 include/configs/sniper.h                      |   2 -
 include/configs/tam3517-common.h              |   1 -
 include/configs/tao3530.h                     |   2 -
 include/configs/taurus.h                      |   2 -
 include/configs/ti814x_evm.h                  |   1 -
 include/configs/ti_omap4_common.h             |   5 -
 include/configs/tricorder.h                   |   2 -
 include/configs/usb_a9263.h                   |   3 -
 include/configs/wb50n.h                       |   2 -
 include/ubispl.h                              |   6 +
 scripts/config_whitelist.txt                  |  13 --
 tools/moveconfig.py                           |  41 ++++
 158 files changed, 628 insertions(+), 193 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/9 moveconfig: expand simple expressions

From: Markus Klotzbuecher <[email protected]>

Add support for expanding simple expressions and sizes such as "(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious" moves, such as

'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Cc Masahiro Yamada <[email protected]>
Cc Heiko Schocher <[email protected]>

---
Changes for v2: new patch

 tools/moveconfig.py | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
tools/moveconfig.py +41 -0
index 1a214c5605..0bbc7c1991 100755
@@ -354,6 +354,26 @@ CONFIG_DATABASE = 'moveconfig.db'
 
 CONFIG_LEN = len('CONFIG_')
 
+SIZES = {
+    "SZ_1":    0x00000001, "SZ_2":    0x00000002,
+    "SZ_4":    0x00000004, "SZ_8":    0x00000008,
+    "SZ_16":   0x00000010, "SZ_32":   0x00000020,
+    "SZ_64":   0x00000040, "SZ_128":  0x00000080,
+    "SZ_256":  0x00000100, "SZ_512":  0x00000200,
+    "SZ_1K":   0x00000400, "SZ_2K":   0x00000800,
+    "SZ_4K":   0x00001000, "SZ_8K":   0x00002000,
+    "SZ_16K":  0x00004000, "SZ_32K":  0x00008000,
+    "SZ_64K":  0x00010000, "SZ_128K": 0x00020000,
+    "SZ_256K": 0x00040000, "SZ_512K": 0x00080000,
+    "SZ_1M":   0x00100000, "SZ_2M":   0x00200000,
+    "SZ_4M":   0x00400000, "SZ_8M":   0x00800000,
+    "SZ_16M":  0x01000000, "SZ_32M":  0x02000000,
+    "SZ_64M":  0x04000000, "SZ_128M": 0x08000000,
+    "SZ_256M": 0x10000000, "SZ_512M": 0x20000000,
+    "SZ_1G":   0x40000000, "SZ_2G":   0x80000000,
+    "SZ_4G":  0x100000000
+}
+
 ### helper functions ###
 def get_devnull():
     """Get the file object of '/dev/null' device."""
@@ -777,6 +797,25 @@ def cleanup_readme(configs, options):
     with open('README', 'w') as f:
         f.write(''.join(newlines))
 
+def try_expand(line):
+    """If value looks like an expression, try expanding it
+    Otherwise just return the existing value
+    """
+    if line.find('=') == -1:
+        return line
+
+    try:
+        cfg, val = re.split("=", line)
+        val= val.strip('\"')
+        if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
+            newval = hex(eval(val, SIZES))
+            print "\tExpanded expression %s to %s" % (val, newval)
+            return cfg+'='+newval
+    except:
+        print "\tFailed to expand expression in %s" % line
+
+    return line
+
 
 ### classes ###
 class Progress:
@@ -891,6 +930,8 @@ class KconfigParser:
         else:
             new_val = not_set
 
+        new_val = try_expand(new_val)
+
         for line in dotconfig_lines:
             line = line.rstrip()
             if line.startswith(config + '=') or line == not_set:
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 1/9 moveconfig: expand simple expressions

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 12 lines

From: Markus Klotzbuecher <[email protected]>

Add support for expanding simple expressions and sizes such as "(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious" moves, such as

'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Quoted 8 lines
Cc Masahiro Yamada <[email protected]>
Cc Heiko Schocher <[email protected]>

---
Changes for v2: new patch

  tools/moveconfig.py | 41 +++++++++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#3 lore raw

PATCH v2 1/9 moveconfig: expand simple expressions

In reply to Markus Klotzbuecher
Quoted 58 lines · Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Add support for expanding simple expressions and sizes such as "(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious" moves, such as

'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Cc Masahiro Yamada <[email protected]>
Cc Heiko Schocher <[email protected]>

---
Changes for v2: new patch

  tools/moveconfig.py | 41 +++++++++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)
tools/moveconfig.py +22 -0
index 1a214c5605..0bbc7c1991 100755
@@ -354,6 +354,26 @@ CONFIG_DATABASE = 'moveconfig.db'
 
  CONFIG_LEN = len('CONFIG_')
 
+SIZES = {
+    "SZ_1":    0x00000001, "SZ_2":    0x00000002,
+    "SZ_4":    0x00000004, "SZ_8":    0x00000008,
+    "SZ_16":   0x00000010, "SZ_32":   0x00000020,
+    "SZ_64":   0x00000040, "SZ_128":  0x00000080,
+    "SZ_256":  0x00000100, "SZ_512":  0x00000200,
+    "SZ_1K":   0x00000400, "SZ_2K":   0x00000800,
+    "SZ_4K":   0x00001000, "SZ_8K":   0x00002000,
+    "SZ_16K":  0x00004000, "SZ_32K":  0x00008000,
+    "SZ_64K":  0x00010000, "SZ_128K": 0x00020000,
+    "SZ_256K": 0x00040000, "SZ_512K": 0x00080000,
+    "SZ_1M":   0x00100000, "SZ_2M":   0x00200000,
+    "SZ_4M":   0x00400000, "SZ_8M":   0x00800000,
+    "SZ_16M":  0x01000000, "SZ_32M":  0x02000000,
+    "SZ_64M":  0x04000000, "SZ_128M": 0x08000000,
+    "SZ_256M": 0x10000000, "SZ_512M": 0x20000000,
+    "SZ_1G":   0x40000000, "SZ_2G":   0x80000000,
+    "SZ_4G":  0x100000000
+}
+
  ### helper functions ###
  def get_devnull():
      """Get the file object of '/dev/null' device."""
@@ -777,6 +797,25 @@ def cleanup_readme(configs, options):
      with open('README', 'w') as f:
          f.write(''.join(newlines))
 
+def try_expand(line):
+    """If value looks like an expression, try expanding it

tools/moveconfig.py def cleanup_readme(configs, options): · line 811

Quoted 10 lines
tools/moveconfig.py +10 -0
+    Otherwise just return the existing value
+    """
+    if line.find('=') == -1:
+        return line
+
+    try:
+        cfg, val = re.split("=", line)
+        val= val.strip('\"')
+        if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
+            newval = hex(eval(val, SIZES))

The if clause evaluates to true for values like:

     val = "os.execl('/sbin/fdisk')"

As eval() can be used to execute arbitrary commands this patch should be corrected.

Best regards

Heinrich

Quoted 20 lines
tools/moveconfig.py +9 -0
+            print "\tExpanded expression %s to %s" % (val, newval)
+            return cfg+'='+newval
+    except:
+        print "\tFailed to expand expression in %s" % line
+
+    return line
+
 
  ### classes ###
  class Progress:
@@ -891,6 +930,8 @@ class KconfigParser:
          else:
              new_val = not_set
 
+        new_val = try_expand(new_val)
+
          for line in dotconfig_lines:
              line = line.rstrip()
              if line.startswith(config + '=') or line == not_set:
#4 lore raw

PATCH v2 1/9 moveconfig: expand simple expressions

Hi Heinrich

Quoted 72 lines · Heinrich Schuchardt
Quoted 58 lines · Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Add support for expanding simple expressions and sizes such as "(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious" moves, such as

'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Cc Masahiro Yamada <[email protected]>
Cc Heiko Schocher <[email protected]>

---
Changes for v2: new patch

  tools/moveconfig.py | 41 +++++++++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)
tools/moveconfig.py +22 -0
index 1a214c5605..0bbc7c1991 100755
@@ -354,6 +354,26 @@ CONFIG_DATABASE = 'moveconfig.db'
 
  CONFIG_LEN = len('CONFIG_')
 
+SIZES = {
+    "SZ_1":    0x00000001, "SZ_2":    0x00000002,
+    "SZ_4":    0x00000004, "SZ_8":    0x00000008,
+    "SZ_16":   0x00000010, "SZ_32":   0x00000020,
+    "SZ_64":   0x00000040, "SZ_128":  0x00000080,
+    "SZ_256":  0x00000100, "SZ_512":  0x00000200,
+    "SZ_1K":   0x00000400, "SZ_2K":   0x00000800,
+    "SZ_4K":   0x00001000, "SZ_8K":   0x00002000,
+    "SZ_16K":  0x00004000, "SZ_32K":  0x00008000,
+    "SZ_64K":  0x00010000, "SZ_128K": 0x00020000,
+    "SZ_256K": 0x00040000, "SZ_512K": 0x00080000,
+    "SZ_1M":   0x00100000, "SZ_2M":   0x00200000,
+    "SZ_4M":   0x00400000, "SZ_8M":   0x00800000,
+    "SZ_16M":  0x01000000, "SZ_32M":  0x02000000,
+    "SZ_64M":  0x04000000, "SZ_128M": 0x08000000,
+    "SZ_256M": 0x10000000, "SZ_512M": 0x20000000,
+    "SZ_1G":   0x40000000, "SZ_2G":   0x80000000,
+    "SZ_4G":  0x100000000
+}
+
  ### helper functions ###
  def get_devnull():
      """Get the file object of '/dev/null' device."""
@@ -777,6 +797,25 @@ def cleanup_readme(configs, options):
      with open('README', 'w') as f:
          f.write(''.join(newlines))
 
+def try_expand(line):
+    """If value looks like an expression, try expanding it

tools/moveconfig.py def cleanup_readme(configs, options): · line 811

Quoted 10 lines
tools/moveconfig.py +10 -0
+    Otherwise just return the existing value
+    """
+    if line.find('=') == -1:
+        return line
+
+    try:
+        cfg, val = re.split("=", line)
+        val= val.strip('\"')
+        if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
+            newval = hex(eval(val, SIZES))

The if clause evaluates to true for values like:

Quoted 4 lines
   val = "os.execl('/sbin/fdisk')"

As eval() can be used to execute arbitrary commands this patch should be corrected.

Fair point. I took a quick look at python sandboxing, and apparently it's difficult to be done in a secure way (see pysandbox). As introducing a CONFIG with something like the above clearly has malicious intent, just preventing "accidential" execution will not be sufficient. Perhaps we can use ast.literal_eval instead. I'll take a closer look.

Best regards
Markus

Signature · 4 lines
Markus Klotzbuecher
Freelancer Embedded, Distributed & Real-time Systems
Am See 28, 78465 Konstanz, Germany
www.mkio.de
#5 lore raw

PATCH v2 1/9 moveconfig: expand simple expressions

Quoted 80 lines · Markus Klotzbuecher

Hi Heinrich

Quoted 72 lines · Heinrich Schuchardt
Quoted 58 lines · Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Add support for expanding simple expressions and sizes such as "(4 * 1024)", "(512 << 10)" or "(SZ_256K)".

This can help to significantly reduce the number of "suspicious" moves, such as

   'CONFIG_ENV_SIZE="(64 << 10)"' was removed by savedefconfig.

If the expansion fails, it falls back to the original string.

Cc Masahiro Yamada <[email protected]>
Cc Heiko Schocher <[email protected]>

---
Changes for v2: new patch

   tools/moveconfig.py | 41 +++++++++++++++++++++++++++++++++++++++++
   1 file changed, 41 insertions(+)
tools/moveconfig.py +22 -0
index 1a214c5605..0bbc7c1991 100755
@@ -354,6 +354,26 @@ CONFIG_DATABASE = 'moveconfig.db'
 
   CONFIG_LEN = len('CONFIG_')
 
+SIZES = {
+    "SZ_1":    0x00000001, "SZ_2":    0x00000002,
+    "SZ_4":    0x00000004, "SZ_8":    0x00000008,
+    "SZ_16":   0x00000010, "SZ_32":   0x00000020,
+    "SZ_64":   0x00000040, "SZ_128":  0x00000080,
+    "SZ_256":  0x00000100, "SZ_512":  0x00000200,
+    "SZ_1K":   0x00000400, "SZ_2K":   0x00000800,
+    "SZ_4K":   0x00001000, "SZ_8K":   0x00002000,
+    "SZ_16K":  0x00004000, "SZ_32K":  0x00008000,
+    "SZ_64K":  0x00010000, "SZ_128K": 0x00020000,
+    "SZ_256K": 0x00040000, "SZ_512K": 0x00080000,
+    "SZ_1M":   0x00100000, "SZ_2M":   0x00200000,
+    "SZ_4M":   0x00400000, "SZ_8M":   0x00800000,
+    "SZ_16M":  0x01000000, "SZ_32M":  0x02000000,
+    "SZ_64M":  0x04000000, "SZ_128M": 0x08000000,
+    "SZ_256M": 0x10000000, "SZ_512M": 0x20000000,
+    "SZ_1G":   0x40000000, "SZ_2G":   0x80000000,
+    "SZ_4G":  0x100000000
+}
+
   ### helper functions ###
   def get_devnull():
       """Get the file object of '/dev/null' device."""
@@ -777,6 +797,25 @@ def cleanup_readme(configs, options):
       with open('README', 'w') as f:
           f.write(''.join(newlines))
 
+def try_expand(line):
+    """If value looks like an expression, try expanding it

tools/moveconfig.py def cleanup_readme(configs, options): · line 811

Quoted 10 lines
tools/moveconfig.py +10 -0
+    Otherwise just return the existing value
+    """
+    if line.find('=') == -1:
+        return line
+
+    try:
+        cfg, val = re.split("=", line)
+        val= val.strip('\"')
+        if re.search("[*+-/]|<<|SZ_+|\(([^\)]+)\)", val):
+            newval = hex(eval(val, SIZES))

The if clause evaluates to true for values like:

Quoted 4 lines
    val = "os.execl('/sbin/fdisk')"

As eval() can be used to execute arbitrary commands this patch should be corrected.

Quoted 6 lines

Fair point. I took a quick look at python sandboxing, and apparently it's difficult to be done in a secure way (see pysandbox). As introducing a CONFIG with something like the above clearly has malicious intent, just preventing "accidential" execution will not be sufficient. Perhaps we can use ast.literal_eval instead. I'll take a closer look.

Except for the strings starting with SZ_ that you defined we would not expect any letters in the term to evaluate. This could be checked using a suitable regular expression.

Best regards

Heinrich

#6 lore raw

PATCH v2 2/9 env: ubi: KConfig: add CONFIG_ENV_UBI_VOLUME_REDUND

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Introduce the KConfig option CONFIG_ENV_UBI_VOLUME_REDUND for defining the name of the UBI volume used to store the redundant environment.

---
Changes for v2:
- Extend commit message

 env/Kconfig                  | 6 ++++++
 scripts/config_whitelist.txt | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)
env/Kconfig +6 -0
index 70858d3b40..9ae6b19ec5 100644
@@ -513,6 +513,12 @@ config ENV_UBI_VOLUME
 	help
 	  Name of the volume that you want to store the environment in.
 
+config ENV_UBI_VOLUME_REDUND
+	string "UBI redundant volume name"
+	depends on ENV_IS_IN_UBI
+	help
+	  Name of the redundant volume that you want to store the environment in.
+
 endif
 
 config USE_DEFAULT_ENV_FILE
scripts/config_whitelist.txt +0 -1
index b16bc6ae34..af7eb73e4a 100644
@@ -493,7 +493,6 @@ CONFIG_ENV_SROM_BANK
 CONFIG_ENV_TOTAL_SIZE
 CONFIG_ENV_UBIFS_OPTION
 CONFIG_ENV_UBI_MTD
-CONFIG_ENV_UBI_VOLUME_REDUND
 CONFIG_ENV_VERSION
 CONFIG_EP9302
 CONFIG_EP9307
Signature · 1 line
2.20.1
#7 lore raw

PATCH v2 2/9 env: ubi: KConfig: add CONFIG_ENV_UBI_VOLUME_REDUND

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 8 lines

From: Markus Klotzbuecher <[email protected]>

Introduce the KConfig option CONFIG_ENV_UBI_VOLUME_REDUND for defining the name of the UBI volume used to store the redundant environment.

Quoted 7 lines

---
Changes for v2:
- Extend commit message

  env/Kconfig                  | 6 ++++++
  scripts/config_whitelist.txt | 1 -
  2 files changed, 6 insertions(+), 1 deletion(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#8 lore raw

PATCH v2 3/9 at91, omap2plus: configs: migrate CONFIG_ENV_ to defconfigs

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Enable the extended ENV options for AT91 and OMAP2PLUS in order to be able to use CONFIG_ENV_UBI_* on these architectures.

As this change also makes the configs ENV_SIZE, ENV_SECT_SIZE, ENV_OFFSET visible to AT91 and OMAP2PLUS, migrate users of these to KConfig.

This migration was run using an extended moveconfig.py which evaluates expressions such as "(512 << 10)". See patch ("moveconfig: expand simple expressions").

All modified boards were built with SOURCE_DATE_EPOCH=0 before and after the change and successfully confirmed that the identical binary is generated (the only exception was igep00x0, which does not define CONFIG_ENV_IS_IN_UBI in the original board header. Once that is defined, the test passes too).

Cc Heiko Schocher <[email protected]>
Cc Eugen Hristev <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v2: new patch

 configs/am335x_guardian_defconfig               |  2 ++
 configs/am335x_igep003x_defconfig               |  4 ++++
 configs/am335x_pdu001_defconfig                 |  1 +
 configs/am335x_shc_defconfig                    |  2 ++
 configs/am335x_shc_ict_defconfig                |  2 ++
 configs/am335x_shc_netboot_defconfig            |  2 ++
 configs/am335x_shc_sdboot_defconfig             |  2 ++
 configs/am335x_sl50_defconfig                   |  1 +
 configs/am43xx_evm_defconfig                    |  1 +
 configs/am43xx_evm_qspiboot_defconfig           |  3 +++
 configs/am43xx_evm_rtconly_defconfig            |  1 +
 configs/am43xx_evm_usbhost_boot_defconfig       |  1 +
 configs/am43xx_hs_evm_defconfig                 |  1 +
 configs/at91rm9200ek_defconfig                  |  3 +++
 configs/at91rm9200ek_ram_defconfig              |  3 +++
 configs/at91sam9260ek_dataflash_cs0_defconfig   |  3 +++
 configs/at91sam9260ek_dataflash_cs1_defconfig   |  3 +++
 configs/at91sam9261ek_dataflash_cs0_defconfig   |  3 +++
 configs/at91sam9261ek_dataflash_cs3_defconfig   |  3 +++
 configs/at91sam9263ek_dataflash_cs0_defconfig   |  3 +++
 configs/at91sam9263ek_dataflash_defconfig       |  3 +++
 configs/at91sam9263ek_norflash_boot_defconfig   |  3 +++
 configs/at91sam9263ek_norflash_defconfig        |  3 +++
 configs/at91sam9g10ek_dataflash_cs0_defconfig   |  3 +++
 configs/at91sam9g10ek_dataflash_cs3_defconfig   |  3 +++
 configs/at91sam9g20ek_2mmc_defconfig            |  2 ++
 configs/at91sam9g20ek_dataflash_cs0_defconfig   |  3 +++
 configs/at91sam9g20ek_dataflash_cs1_defconfig   |  3 +++
 configs/at91sam9m10g45ek_mmc_defconfig          |  1 +
 configs/at91sam9n12ek_mmc_defconfig             |  1 +
 configs/at91sam9n12ek_spiflash_defconfig        |  3 +++
 configs/at91sam9rlek_dataflash_defconfig        |  3 +++
 configs/at91sam9rlek_mmc_defconfig              |  1 +
 configs/at91sam9x5ek_dataflash_defconfig        |  3 +++
 configs/at91sam9x5ek_mmc_defconfig              |  1 +
 configs/at91sam9x5ek_spiflash_defconfig         |  3 +++
 configs/at91sam9xeek_dataflash_cs0_defconfig    |  3 +++
 configs/at91sam9xeek_dataflash_cs1_defconfig    |  3 +++
 configs/axm_defconfig                           |  1 +
 configs/brppt1_mmc_defconfig                    |  2 ++
 configs/brppt1_nand_defconfig                   |  2 ++
 configs/brppt1_spi_defconfig                    |  3 +++
 configs/brxre1_defconfig                        |  2 ++
 configs/chiliboard_defconfig                    |  2 ++
 configs/cm_t335_defconfig                       |  2 ++
 configs/cm_t35_defconfig                        |  1 +
 configs/cm_t43_defconfig                        |  3 +++
 configs/cm_t54_defconfig                        |  2 ++
 configs/corvus_defconfig                        |  1 +
 configs/draco_defconfig                         |  1 +
 configs/eco5pk_defconfig                        |  1 +
 configs/etamin_defconfig                        |  2 ++
 configs/ethernut5_defconfig                     |  3 +++
 configs/gardena-smart-gateway-at91sam_defconfig |  4 ++++
 configs/gurnard_defconfig                       |  2 ++
 configs/igep00x0_defconfig                      |  5 +++++
 configs/mcx_defconfig                           |  1 +
 configs/meesc_dataflash_defconfig               |  3 +++
 configs/meesc_defconfig                         |  1 +
 configs/mt_ventoux_defconfig                    |  1 +
 configs/omap3_overo_defconfig                   |  1 +
 configs/omap4_sdp4430_defconfig                 |  1 +
 configs/pengwyn_defconfig                       |  1 +
 configs/picosam9g45_defconfig                   |  1 +
 configs/pm9261_defconfig                        |  3 +++
 configs/pm9263_defconfig                        |  3 +++
 configs/pxm2_defconfig                          |  1 +
 configs/rastaban_defconfig                      |  1 +
 configs/rut_defconfig                           |  1 +
 configs/sama5d27_som1_ek_mmc1_defconfig         |  1 +
 configs/sama5d27_som1_ek_mmc_defconfig          |  1 +
 configs/sama5d2_icp_mmc_defconfig               |  1 +
 configs/sama5d2_ptc_ek_mmc_defconfig            |  1 +
 configs/sama5d2_xplained_emmc_defconfig         |  1 +
 configs/sama5d2_xplained_mmc_defconfig          |  1 +
 configs/sama5d2_xplained_spiflash_defconfig     |  3 +++
 configs/sama5d36ek_cmp_mmc_defconfig            |  1 +
 configs/sama5d36ek_cmp_spiflash_defconfig       |  3 +++
 configs/sama5d3_xplained_mmc_defconfig          |  1 +
 configs/sama5d3xek_mmc_defconfig                |  1 +
 configs/sama5d3xek_spiflash_defconfig           |  3 +++
 configs/sama5d4_xplained_mmc_defconfig          |  1 +
 configs/sama5d4_xplained_spiflash_defconfig     |  3 +++
 configs/sama5d4ek_mmc_defconfig                 |  1 +
 configs/sama5d4ek_spiflash_defconfig            |  3 +++
 configs/smartweb_defconfig                      |  1 +
 configs/snapper9260_defconfig                   |  2 ++
 configs/snapper9g20_defconfig                   |  2 ++
 configs/taurus_defconfig                        |  1 +
 configs/thuban_defconfig                        |  1 +
 configs/ti816x_evm_defconfig                    |  2 ++
 configs/tricorder_defconfig                     |  2 ++
 configs/tricorder_flash_defconfig               |  1 +
 configs/twister_defconfig                       |  1 +
 configs/usb_a9263_dataflash_defconfig           |  3 +++
 configs/vinco_defconfig                         |  3 +++
 configs/wb45n_defconfig                         |  1 +
 configs/wb50n_defconfig                         |  1 +
 env/Kconfig                                     | 11 +++++++----
 include/configs/am335x_evm.h                    |  3 ---
 include/configs/am335x_igep003x.h               |  7 -------
 include/configs/am335x_sl50.h                   |  3 ---
 include/configs/am3517_crane.h                  |  2 --
 include/configs/am3517_evm.h                    |  2 --
 include/configs/am43xx_evm.h                    |  5 -----
 include/configs/am57xx_evm.h                    |  2 --
 include/configs/at91-sama5_common.h             |  5 -----
 include/configs/at91rm9200ek.h                  |  2 +-
 include/configs/baltos.h                        |  3 ---
 include/configs/bav335x.h                       |  3 ---
 include/configs/brppt1.h                        |  5 -----
 include/configs/chiliboard.h                    |  4 ----
 include/configs/cm_t335.h                       |  2 --
 include/configs/cm_t35.h                        |  2 --
 include/configs/cm_t3517.h                      |  2 --
 include/configs/cm_t43.h                        |  5 -----
 include/configs/corvus.h                        |  2 --
 include/configs/devkit8000.h                    |  6 ------
 include/configs/dra7xx_evm.h                    |  2 --
 include/configs/ethernut5.h                     |  2 --
 include/configs/gardena-smart-gateway-at91sam.h |  6 ------
 include/configs/kc1.h                           |  2 --
 include/configs/mcx.h                           |  1 -
 include/configs/nokia_rx51.h                    |  1 -
 include/configs/omap3_beagle.h                  |  4 ----
 include/configs/omap3_cairo.h                   |  4 ----
 include/configs/omap3_evm.h                     |  3 ---
 include/configs/omap3_igep00x0.h                |  6 ------
 include/configs/omap3_logic.h                   |  3 ---
 include/configs/omap3_overo.h                   |  1 -
 include/configs/omap3_pandora.h                 |  3 ---
 include/configs/omap3_zoom1.h                   |  3 ---
 include/configs/omap5_uevm.h                    |  2 --
 include/configs/pcm051.h                        |  1 -
 include/configs/pepper.h                        |  2 --
 include/configs/siemens-am33x-common.h          |  2 --
 include/configs/smartweb.h                      |  2 --
 include/configs/snapper9260.h                   |  2 --
 include/configs/snapper9g45.h                   |  2 --
 include/configs/sniper.h                        |  2 --
 include/configs/tam3517-common.h                |  1 -
 include/configs/tao3530.h                       |  2 --
 include/configs/taurus.h                        |  2 --
 include/configs/ti814x_evm.h                    |  1 -
 include/configs/ti_omap4_common.h               |  5 -----
 include/configs/tricorder.h                     |  2 --
 include/configs/usb_a9263.h                     |  3 ---
 include/configs/wb50n.h                         |  2 --
 148 files changed, 202 insertions(+), 142 deletions(-)
configs/am335x_guardian_defconfig +2 -0
index 5753b10526..8dbbc586ba 100644
@@ -8,6 +8,8 @@ CONFIG_TARGET_AM335X_GUARDIAN=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x040000
+CONFIG_ENV_OFFSET=0x300000
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DISTRO_DEFAULTS=y
configs/am335x_igep003x_defconfig +4 -0
index ea2a68fe56..f44fb09b31 100644
@@ -8,6 +8,7 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_IGEP003X=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x18000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
@@ -42,6 +43,9 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-base0033"
 CONFIG_ENV_IS_IN_UBI=y
+CONFIG_ENV_UBI_PART="UBI"
+CONFIG_ENV_UBI_VOLUME="config"
+CONFIG_ENV_UBI_VOLUME_REDUND="config_r"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
configs/am335x_pdu001_defconfig +1 -0
index 05077c5b73..0e693e571f 100644
@@ -6,6 +6,7 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_PDU001=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am335x_shc_defconfig +2 -0
index 98efb6fdab..aa4caf6534 100644
@@ -7,6 +7,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_SHC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x7000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am335x_shc_ict_defconfig +2 -0
index 94672f66da..2083857b8d 100644
@@ -7,6 +7,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_SHC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x7000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am335x_shc_netboot_defconfig +2 -0
index ab7afdd46f..fdb22afb9e 100644
@@ -7,6 +7,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_SHC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x7000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am335x_shc_sdboot_defconfig +2 -0
index ea77f4e413..1bbd85fd0f 100644
@@ -7,6 +7,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_SHC=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x7000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am335x_sl50_defconfig +1 -0
index 678ead9a95..b10d045ab0 100644
@@ -7,6 +7,7 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_AM335X_SL50=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_OFFSET=0x0
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/am43xx_evm_defconfig +1 -0
index 526dda2a93..4bb5dfeef9 100644
@@ -4,6 +4,7 @@ CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
configs/am43xx_evm_qspiboot_defconfig +3 -0
index b64427364a..56881f2b74 100644
@@ -3,6 +3,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x30000000
 CONFIG_AM43XX=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x110000
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,QSPI,QSPI_BOOT"
 CONFIG_QSPI_BOOT=y
@@ -29,6 +31,7 @@ CONFIG_OF_LIST="am4372-generic am437x-sk-evm am437x-idk-evm"
 CONFIG_DTB_RESELECT=y
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 # CONFIG_BLK is not set
configs/am43xx_evm_rtconly_defconfig +1 -0
index c85570574b..1af908a599 100644
@@ -4,6 +4,7 @@ CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
 CONFIG_SPL_RTC_DDR_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
configs/am43xx_evm_usbhost_boot_defconfig +1 -0
index 6a47c6637b..fc474aacd5 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_ISW_ENTRY_ADDR=0x40300350
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
+CONFIG_ENV_SIZE=0x10000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
configs/am43xx_hs_evm_defconfig +1 -0
index ff7f81530a..fad564db81 100644
@@ -8,6 +8,7 @@ CONFIG_AM43XX=y
 CONFIG_TI_SECURE_EMIF_REGION_START=0xbdb00000
 CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE=0x02000000
 CONFIG_TI_SECURE_EMIF_PROTECTED_REGION_SIZE=0x01c00000
+CONFIG_ENV_SIZE=0x10000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_FIT_IMAGE_POST_PROCESS=y
configs/at91rm9200ek_defconfig +3 -0
index 7ebbdacbfc..5eb6da0954 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x10000000
 CONFIG_TARGET_AT91RM9200EK=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_BOOTDELAY=3
 # CONFIG_DISPLAY_CPUINFO is not set
@@ -18,6 +20,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
configs/at91rm9200ek_ram_defconfig +3 -0
index 87fd7a303a..f99b17b489 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x20100000
 CONFIG_TARGET_AT91RM9200EK=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT"
 CONFIG_BOOTDELAY=3
@@ -19,6 +21,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_FAT=y
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
configs/at91sam9260ek_dataflash_cs0_defconfig +3 -0
index 137ecd9474..633b0a30b8 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9260ek_dataflash_cs1_defconfig +3 -0
index 2547f2da97..2e47f43e53 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9261ek_dataflash_cs0_defconfig +3 -0
index 8eab764e31..82bf9ee969 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9261EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9261ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9261ek_dataflash_cs3_defconfig +3 -0
index dfafdfa604..7e4e4932cf 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9261EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9261ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9263ek_dataflash_cs0_defconfig +3 -0
index b768a32927..c26a128a64 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_AT91SAM9263EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
@@ -35,6 +37,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9263ek_dataflash_defconfig +3 -0
index b768a32927..c26a128a64 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_AT91SAM9263EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
@@ -35,6 +37,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9263ek_norflash_boot_defconfig +3 -0
index 270d2e6089..a40e07262f 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x0000000
 CONFIG_TARGET_AT91SAM9263EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x7e0000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
@@ -31,6 +33,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9263ek_norflash_defconfig +3 -0
index ad86956cd8..b7d4491764 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_AT91SAM9263EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x7e0000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
@@ -31,6 +33,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9g10ek_dataflash_cs0_defconfig +3 -0
index a20f461025..87796ddffc 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9261EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9261ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9g10ek_dataflash_cs3_defconfig +3 -0
index 5ea03c5faf..9ee0cbb203 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9261EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9261ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9g20ek_2mmc_defconfig +2 -0
index abc766113f..dde834356c 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
configs/at91sam9g20ek_dataflash_cs0_defconfig +3 -0
index 73146fdeec..bd2d548cd2 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9g20ek_dataflash_cs1_defconfig +3 -0
index 127e3ad3c6..88bffdb16c 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9g20ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9m10g45ek_mmc_defconfig +1 -0
index 039f4c15d4..dc1dedd280 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x73f00000
 CONFIG_TARGET_AT91SAM9M10G45EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
configs/at91sam9n12ek_mmc_defconfig +1 -0
index a20f575b48..ce3603b6bb 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_AT91SAM9N12EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
configs/at91sam9n12ek_spiflash_defconfig +3 -0
index a1caaeb2d1..7470c786a1 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_AT91SAM9N12EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x3000
+CONFIG_ENV_OFFSET=0x5000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9n12ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9rlek_dataflash_defconfig +3 -0
index 4f2818fef4..4d2926e31f 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_AT91SAM9RLEK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -32,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9rlek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 # CONFIG_NET is not set
 CONFIG_DM=y
 CONFIG_CLK=y
configs/at91sam9rlek_mmc_defconfig +1 -0
index 807a47b936..80a5b8deaf 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_AT91SAM9RLEK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
configs/at91sam9x5ek_dataflash_defconfig +3 -0
index c45970b9fe..d8b5712dfc 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_AT91SAM9X5EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -34,6 +36,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g35ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9x5ek_mmc_defconfig +1 -0
index 63ddf7535c..3fd4a8132a 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_AT91SAM9X5EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
configs/at91sam9x5ek_spiflash_defconfig +3 -0
index 65f3175086..f328257714 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_AT91SAM9X5EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x3000
+CONFIG_ENV_OFFSET=0x5000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -34,6 +36,7 @@ CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g35ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9xeek_dataflash_cs0_defconfig +3 -0
index 80cbb9ef91..f550ad477d 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/at91sam9xeek_dataflash_cs1_defconfig +3 -0
index 4f19edc049..5d69ac552d 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_AT91SAM9260EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xfffff200
@@ -31,6 +33,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9260ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/axm_defconfig +1 -0
index bcc5a0aa4a..3f5b30fb4a 100644
@@ -10,6 +10,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_OFFSET=0x100000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
configs/brppt1_mmc_defconfig +2 -0
index b5d7b7c49e..5487e5517c 100644
@@ -8,6 +8,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_BRPPT1=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_TPL_SYS_MALLOC_F_LEN=0x0
configs/brppt1_nand_defconfig +2 -0
index 2d93c895b3..5ab3f929b2 100644
@@ -7,6 +7,8 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM33XX=y
 CONFIG_TARGET_BRPPT1=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x60000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_TPL_SYS_MALLOC_F_LEN=0x0
configs/brppt1_spi_defconfig +3 -0
index 28856ab064..ce7c8522b1 100644
@@ -7,6 +7,8 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_AM33XX=y
 CONFIG_TARGET_BRPPT1=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x20000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -68,6 +70,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-brppt1-spi"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupt-parent interrupt-controller interrupt-cells dma-names dmas "
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
configs/brxre1_defconfig +2 -0
index c35c73f233..f2f10ba4bc 100644
@@ -9,6 +9,8 @@ CONFIG_SYS_MPUCLK=1000
 CONFIG_TARGET_BRXRE1=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x4000
 CONFIG_SPL=y
 CONFIG_TPL_SYS_MALLOC_F_LEN=0x0
configs/chiliboard_defconfig +2 -0
index 944dd0db3c..e208a2191d 100644
@@ -6,6 +6,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_CHILIBOARD=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x20000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/cm_t335_defconfig +2 -0
index 3df94d2312..550ee2b5fc 100644
@@ -7,6 +7,8 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_CM_T335=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0x300000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/cm_t35_defconfig +1 -0
index f363914dd8..44b66a468e 100644
@@ -3,6 +3,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_TARGET_CM_T35=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=3
configs/cm_t43_defconfig +3 -0
index 72b7d36684..be94b841f2 100644
@@ -6,6 +6,8 @@ CONFIG_AM43XX=y
 CONFIG_TARGET_CM_T43=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0xc0000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
@@ -44,6 +46,7 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_DM_GPIO=y
configs/cm_t54_defconfig +2 -0
index dedc8b573a..8b04f33e83 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_OMAP54XX=y
 CONFIG_TARGET_CM_T54=y
 CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC=16296
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0xc0000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
configs/corvus_defconfig +1 -0
index 68c7bec604..3894d19264 100644
@@ -10,6 +10,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x800
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_OFFSET=0x100000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH"
configs/draco_defconfig +1 -0
index 5f9e84a767..d23ca8a4c6 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_MPUCLK=300
 CONFIG_TARGET_DRACO=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/eco5pk_defconfig +1 -0
index e7061da4db..ca4afcbd52 100644
@@ -4,6 +4,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_TARGET_ECO5PK=y
 CONFIG_EMIF4=y
+CONFIG_ENV_OFFSET=0x180000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=10
configs/etamin_defconfig +2 -0
index 89968587c9..aded18fb77 100644
@@ -10,6 +10,8 @@ CONFIG_SYS_MPUCLK=300
 CONFIG_TARGET_ETAMIN=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x980000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/ethernut5_defconfig +3 -0
index 2ec3aae337..99cccdb5a5 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x27000000
 CONFIG_TARGET_ETHERNUT5=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x21000
+CONFIG_ENV_OFFSET=0x3DE000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9XE"
 CONFIG_BOOTDELAY=3
@@ -47,6 +49,7 @@ CONFIG_DEFAULT_DEVICE_TREE="ethernut5"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x21000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/gardena-smart-gateway-at91sam_defconfig +4 -0
index 577dceb2d4..7671e234fa 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x10000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
@@ -51,6 +52,9 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9g25-gardena-smart-gateway"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupts interrupt-parent interrupts-extended dmas dma-names"
 CONFIG_ENV_IS_IN_UBI=y
+CONFIG_ENV_UBI_PART="ubi"
+CONFIG_ENV_UBI_VOLUME="env"
+CONFIG_ENV_UBI_VOLUME_REDUND="env_r"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
configs/gurnard_defconfig +2 -0
index d19f485c1a..5001385426 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x73f00000
 CONFIG_TARGET_GURNARD=y
+CONFIG_ENV_SIZE=0x40000
+CONFIG_ENV_OFFSET=0x80000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G45"
configs/igep00x0_defconfig +5 -0
index bc770696fd..927d7f0ecd 100644
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_TARGET_OMAP3_IGEP00X0=y
+CONFIG_ENV_SIZE=0x8000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
@@ -29,6 +30,10 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="omap3-igep0020"
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_ENV_UBI_PART="UBI"
+CONFIG_ENV_UBI_VOLUME="config"
+CONFIG_ENV_UBI_VOLUME_REDUND="config_r"
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
configs/mcx_defconfig +1 -0
index 58d0ac08bf..8607dd4dba 100644
@@ -5,6 +5,7 @@ CONFIG_SYS_TEXT_BASE=0x80008000
 # CONFIG_SPL_GPIO_SUPPORT is not set
 CONFIG_TARGET_MCX=y
 CONFIG_EMIF4=y
+CONFIG_ENV_OFFSET=0x180000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=3
configs/meesc_dataflash_defconfig +3 -0
index 476700c7ed..0bef67e8cd 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_MEESC=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4200
+CONFIG_ENV_OFFSET=0x4200
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9263,SYS_USE_DATAFLASH"
@@ -22,6 +24,7 @@ CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x210
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/meesc_defconfig +1 -0
index 0e49d82ad1..970e8b8052 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21F00000
 CONFIG_TARGET_MEESC=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_OFFSET=0xC0000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9263,SYS_USE_NANDFLASH"
configs/mt_ventoux_defconfig +1 -0
index 4414875e09..26c82c8e74 100644
@@ -4,6 +4,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_TARGET_MT_VENTOUX=y
 CONFIG_EMIF4=y
+CONFIG_ENV_OFFSET=0x180000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=10
configs/omap3_overo_defconfig +1 -0
index ff968b3806..59867914cb 100644
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_OMAP3_OVERO=y
+CONFIG_ENV_OFFSET=0x240000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
configs/omap4_sdp4430_defconfig +1 -0
index 1d7f21a79a..7f251acd94 100644
@@ -5,6 +5,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_OMAP44XX=y
 CONFIG_TARGET_OMAP4_SDP4430=y
 CONFIG_CMD_BAT=y
+CONFIG_ENV_OFFSET=0xE0000
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
configs/pengwyn_defconfig +1 -0
index b0c0520a20..c4539e90f8 100644
@@ -7,6 +7,7 @@ CONFIG_AM33XX=y
 CONFIG_TARGET_PENGWYN=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/picosam9g45_defconfig +1 -0
index 6a087b49af..abae023915 100644
@@ -8,6 +8,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/pm9261_defconfig +3 -0
index d2c4c25672..4a749321a0 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0
 CONFIG_TARGET_PM9261=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9261"
 CONFIG_BOOTDELAY=3
@@ -29,6 +31,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=physmap-flash.0:256k(u-boot)ro,64k(u-boot-env)
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9261ek"
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/pm9263_defconfig +3 -0
index ceb7efe503..1c948b2ce5 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0
 CONFIG_TARGET_PM9263=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x40000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9263"
 CONFIG_BOOTDELAY=3
@@ -29,6 +31,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=physmap-flash.0:256k(u-boot)ro,64k(u-boot-env)
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91sam9263ek"
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/pxm2_defconfig +1 -0
index 1a5955ab14..31f5888184 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_MPUCLK=720
 CONFIG_TARGET_PXM2=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/rastaban_defconfig +1 -0
index e5052bb9d1..efd6e49333 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_MPUCLK=300
 CONFIG_TARGET_RASTABAN=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/rut_defconfig +1 -0
index 50387d5429..330f7e2371 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_MPUCLK=600
 CONFIG_TARGET_RUT=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/sama5d27_som1_ek_mmc1_defconfig +1 -0
index 205a439941..ff611f45a8 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf8020000
configs/sama5d27_som1_ek_mmc_defconfig +1 -0
index 0a0780066c..d8845b3f44 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d2_icp_mmc_defconfig +1 -0
index 1fafb767af..70db73905d 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf801c000
configs/sama5d2_ptc_ek_mmc_defconfig +1 -0
index bf2b5584df..d4cde7df2d 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_SAMA5D2_PTC_EK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf801c000
configs/sama5d2_xplained_emmc_defconfig +1 -0
index f643b5a62f..6b7c47c299 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xf8020000
configs/sama5d2_xplained_mmc_defconfig +1 -0
index c25d67bfeb..7c0d14a5c1 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d2_xplained_spiflash_defconfig +3 -0
index ac5ae5133c..267806c2e2 100644
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -43,6 +45,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_xplained"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dmas dma-names"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
configs/sama5d36ek_cmp_mmc_defconfig +1 -0
index e61f897121..bc20f17a1f 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_SAMA5D3XEK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
configs/sama5d36ek_cmp_spiflash_defconfig +3 -0
index 4a876e3614..eddeead2f2 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x26f00000
 CONFIG_TARGET_SAMA5D3XEK=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BOARD_INIT=y
 CONFIG_DEBUG_UART_BASE=0xffffee00
@@ -32,6 +34,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="sama5d36ek_cmp"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_CLK=y
configs/sama5d3_xplained_mmc_defconfig +1 -0
index d5021eb76a..6e9d65c04c 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d3xek_mmc_defconfig +1 -0
index b770ac4668..ea565ecd13 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d3xek_spiflash_defconfig +3 -0
index 84bbf9c8c8..9bf9e4f540 100644
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -44,6 +46,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="sama5d36ek"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dmas dma-names"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
configs/sama5d4_xplained_mmc_defconfig +1 -0
index f673832dff..6c781ef8c9 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d4_xplained_spiflash_defconfig +3 -0
index f10868900f..b12c4766fa 100644
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -42,6 +44,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4_xplained"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
configs/sama5d4ek_mmc_defconfig +1 -0
index d7e1701a57..2dd75c3652 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
configs/sama5d4ek_spiflash_defconfig +3 -0
index 8db517d7b6..1b6c19ff3c 100644
@@ -8,6 +8,8 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -42,6 +44,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d4ek"
 CONFIG_OF_SPL_REMOVE_PROPS="interrupts interrupt-parent dma-names dmas"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
configs/smartweb_defconfig +1 -0
index 005b6e9044..186c089a12 100644
@@ -9,6 +9,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_OFFSET=0x100000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
configs/snapper9260_defconfig +2 -0
index 7ce29bfb90..be71dc84d7 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_SNAPPER9260=y
+CONFIG_ENV_SIZE=0x40000
+CONFIG_ENV_OFFSET=0x80000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9260"
configs/snapper9g20_defconfig +2 -0
index 2773c6b41b..aca456e59f 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x21f00000
 CONFIG_TARGET_SNAPPER9260=y
+CONFIG_ENV_SIZE=0x40000
+CONFIG_ENV_OFFSET=0x80000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G20"
configs/taurus_defconfig +1 -0
index 02a89592d7..dd9fbb1227 100644
@@ -11,6 +11,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_OFFSET=0x100000
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
configs/thuban_defconfig +1 -0
index 67012f8216..68ce230704 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_MPUCLK=300
 CONFIG_TARGET_THUBAN=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
configs/ti816x_evm_defconfig +2 -0
index bf877f596b..19519f8004 100644
@@ -7,6 +7,8 @@ CONFIG_TI816X=y
 CONFIG_TARGET_TI816X_EVM=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x001c0000
 CONFIG_SPL=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
configs/tricorder_defconfig +2 -0
index 973c5acae0..53e8256b96 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80100000
 CONFIG_TARGET_TRICORDER=y
+CONFIG_ENV_SIZE=0x4000
+CONFIG_ENV_OFFSET=0x120000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=0
configs/tricorder_flash_defconfig +1 -0
index 1dc299296a..85ff2bf89b 100644
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80100000
 CONFIG_TARGET_TRICORDER=y
+CONFIG_ENV_SIZE=0x4000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="FLASHCARD"
configs/twister_defconfig +1 -0
index fcd647858a..f533b1c871 100644
@@ -4,6 +4,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_SYS_TEXT_BASE=0x80008000
 CONFIG_TARGET_TWISTER=y
 CONFIG_EMIF4=y
+CONFIG_ENV_OFFSET=0x180000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SPL=y
 CONFIG_BOOTDELAY=10
configs/usb_a9263_dataflash_defconfig +3 -0
index 3b9e4a535f..5d19809772 100644
@@ -3,6 +3,8 @@ CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x23f00000
 CONFIG_TARGET_USB_A9263=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_OFFSET=0x2000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9263,SYS_USE_DATAFLASH"
 CONFIG_BOOTDELAY=3
@@ -27,6 +29,7 @@ CONFIG_DEFAULT_DEVICE_TREE="usb_a9263"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=15000000
+CONFIG_ENV_SECT_SIZE=0x2000
 CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
configs/vinco_defconfig +3 -0
index 745aa85f3b..92fdc93d04 100644
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x20f00000
 CONFIG_TARGET_VINCO=y
+CONFIG_ENV_SIZE=0x10000
+CONFIG_ENV_OFFSET=0x10000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_SPI_BOOT=y
@@ -27,6 +29,7 @@ CONFIG_CMD_FAT=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="at91-vinco"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
configs/wb45n_defconfig +1 -0
index 8da284a1e1..16fb4449a3 100644
@@ -7,6 +7,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_OFFSET=0xa0000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_FIT=y
configs/wb50n_defconfig +1 -0
index 71a95b33f2..417eda36e9 100644
@@ -6,6 +6,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_ENV_OFFSET=0xA0000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_FIT=y
env/Kconfig +7 -4
index 9ae6b19ec5..a57b1fc70b 100644
@@ -470,7 +470,7 @@ config ENV_EXT4_FILE
 	  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 || ARC
+if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARC || ARCH_OMAP2PLUS || ARCH_AT91
 
 config ENV_OFFSET
 	hex "Environment Offset"
@@ -481,23 +481,26 @@ config ENV_OFFSET
 	default 0xE0000 if ARCH_ZYNQ
 	default 0x1E00000 if ARCH_ZYNQMP
 	default 0 if ARC
+	default 0x140000 if ARCH_AT91
+	default 0x260000 if ARCH_OMAP2PLUS
 	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 0x20000 if ARCH_SUNXI || ARCH_ZYNQ
+	default 0x20000 if ARCH_SUNXI || ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
 	default 0x8000 if ARCH_ROCKCHIP || ARCH_ZYNQMP || ARCH_VERSAL
 	default 0x4000 if ARC
+	default 0x1f000
 	help
 	  Size of the environment storage area
 
 config ENV_SECT_SIZE
 	hex "Environment Sector-Size"
-	depends on !ENV_IS_NOWHERE && (ARCH_ZYNQ || ARCH_ZYNQMP)
+	depends on !ENV_IS_NOWHERE && (ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_OMAP2PLUS || ARCH_AT91)
 	default 0x40000 if ARCH_ZYNQMP
-	default 0x20000 if ARCH_ZYNQ
+	default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
 	help
 	  Size of the sector containing the environment.
 
include/configs/am335x_evm.h +0 -3
index 7721907d8f..2e1c00d85f 100644
@@ -34,9 +34,6 @@
 /* Custom script for NOR */
 #define CONFIG_SYS_LDSCRIPT		"board/ti/am335x/u-boot.lds"
 
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE			SZ_128K
-
 #ifdef CONFIG_NAND
 #define NANDARGS \
 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
include/configs/am335x_igep003x.h +0 -7
index 5fe7565131..5131cd38e4 100644
@@ -20,8 +20,6 @@
 #define V_OSCK				24000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
 
-#define CONFIG_ENV_SIZE			(96 << 10)	/*  96 KiB */
-
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
@@ -124,11 +122,6 @@
 #define CONFIG_SPL_UBI_LEB_START	2048
 #define CONFIG_SPL_UBI_INFO_ADDR	0x88080000
 
-/* environment organization */
-#define CONFIG_ENV_UBI_PART		"UBI"
-#define CONFIG_ENV_UBI_VOLUME		"config"
-#define CONFIG_ENV_UBI_VOLUME_REDUND	"config_r"
-
 /* NAND config */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
include/configs/am335x_sl50.h +0 -3
index 381c75e6ef..a08e6bfe08 100644
@@ -22,9 +22,6 @@
 #define V_OSCK				24000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
 
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE			(128 << 10)
-
 #ifndef CONFIG_SPL_BUILD
 
 #define MEM_LAYOUT_ENV_SETTINGS \
include/configs/am3517_crane.h +0 -2
index 2c510265cc..cacd799aa2 100644
@@ -31,7 +31,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB sector */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (128 << 10))
 						/* initial data */
 /*
@@ -192,7 +191,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB sector */
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 /*-----------------------------------------------------------------------
include/configs/am3517_evm.h +0 -2
index 9475e9975d..e0521abe90 100644
@@ -184,8 +184,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
-#define CONFIG_ENV_SIZE			CONFIG_SYS_ENV_SECT_SIZE
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 /* Defines for SPL */
include/configs/am43xx_evm.h +0 -5
index ef85cd2994..b0d9559962 100644
@@ -59,9 +59,6 @@
 /* Now bring in the rest of the common code. */
 #include <configs/ti_armv7_omap.h>
 
-/* Always 64 KiB env size */
-#define CONFIG_ENV_SIZE			(64 << 10)
-
 /* Clock Defines */
 #define V_OSCK				24000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
@@ -114,8 +111,6 @@
 
 #ifdef CONFIG_QSPI_BOOT
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
-#define CONFIG_ENV_SECT_SIZE           (64 << 10) /* 64 KB sectors */
-#define CONFIG_ENV_OFFSET              0x110000
 #define CONFIG_ENV_OFFSET_REDUND       0x120000
 #endif
 
include/configs/am57xx_evm.h +0 -2
index 2c651aab17..e69e800f61 100644
@@ -19,8 +19,6 @@
 /* MMC ENV related defines */
 #define CONFIG_SYS_MMC_ENV_DEV		1		/* eMMC */
 #define CONFIG_SYS_MMC_ENV_PART		0
-#define CONFIG_ENV_SIZE			SZ_128K
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
include/configs/at91-sama5_common.h +0 -5
index 30c6cd47ca..b9c6a27a33 100644
@@ -57,17 +57,12 @@
 
 #ifdef CONFIG_NAND_BOOT
 /* u-boot env in nand flash */
-#define CONFIG_ENV_OFFSET		0x140000
 #define CONFIG_ENV_OFFSET_REDUND	0x100000
-#define CONFIG_ENV_SIZE			0x20000
 #define CONFIG_BOOTCOMMAND		"nand read 0x21000000 0x180000 0x80000;"	\
 					"nand read 0x22000000 0x200000 0x600000;"	\
 					"bootz 0x22000000 - 0x21000000"
 #elif CONFIG_SPI_BOOT
 /* u-boot env in serial flash, by default is bus 0 and cs 0 */
-#define CONFIG_ENV_OFFSET		0x6000
-#define CONFIG_ENV_SIZE			0x2000
-#define CONFIG_ENV_SECT_SIZE		0x1000
 #define CONFIG_BOOTCOMMAND		"sf probe 0; "				\
 					"sf read 0x21000000 0x60000 0xc000; "	\
 					"sf read 0x22000000 0x6c000 0x394000; "	\
include/configs/at91rm9200ek.h +1 -1
index e2a2f3b893..8bfba35e16 100644
@@ -145,7 +145,7 @@
  */
 #define CONFIG_ENV_ADDR			\
 		(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
-#define CONFIG_ENV_SIZE			SZ_64K /* sectors are 64K here */
+
 /* The following #defines are needed to get flash environment right */
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_MONITOR_LEN		SZ_256K
include/configs/baltos.h +0 -3
index 98ec0d626e..2e9148b0c0 100644
@@ -28,9 +28,6 @@
 /* Custom script for NOR */
 #define CONFIG_SYS_LDSCRIPT		"board/vscom/baltos/u-boot.lds"
 
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE			(128 << 10)
-
 /* FIT support */
 #define CONFIG_SYS_BOOTM_LEN         SZ_64M
 
include/configs/bav335x.h +0 -3
index 3d4d08aa70..65ba100762 100644
@@ -34,9 +34,6 @@
 /* Custom script for NOR */
 #define CONFIG_SYS_LDSCRIPT		"board/birdland/bav335x/u-boot.lds"
 
-/* Always 128 KiB env size */
-#define CONFIG_ENV_SIZE			(128 << 10)
-
 #ifdef CONFIG_NAND
 #define NANDARGS \
 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
include/configs/brppt1.h +0 -5
index 51af93a32f..a3d450dd8f 100644
@@ -59,9 +59,6 @@
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 #endif /* CONFIG_NAND */
 
-/* Always 64 KiB env size */
-#define CONFIG_ENV_SIZE			(64 << 10)
-
 #ifdef CONFIG_NAND
 #define NANDTGTS \
 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
@@ -182,8 +179,6 @@ NANDTGTS \
 #define CONFIG_SYS_SPI_U_BOOT_OFFS		0x40000
 /* Environment */
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
-#define CONFIG_ENV_SECT_SIZE			CONFIG_ENV_SIZE
-#define CONFIG_ENV_OFFSET			0x20000
 #define CONFIG_ENV_OFFSET_REDUND		(CONFIG_ENV_OFFSET + \
 						 CONFIG_ENV_SECT_SIZE)
 #elif defined(CONFIG_ENV_IS_IN_MMC)
include/configs/chiliboard.h +0 -4
index db990fcb2b..13c15bd79f 100644
@@ -161,15 +161,11 @@
 #endif
 
 #if defined(CONFIG_ENV_IS_IN_NAND)
-#define CONFIG_ENV_OFFSET		0x001c0000
 #define CONFIG_ENV_OFFSET_REDUND	0x001e0000
-#define CONFIG_ENV_SIZE			SZ_128K
 #define CONFIG_SYS_ENV_SECT_SIZE	CONFIG_SYS_NAND_BLOCK_SIZE
 #else
 #define CONFIG_SYS_MMC_ENV_DEV		0
-#define CONFIG_ENV_OFFSET		SZ_128K
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
-#define CONFIG_ENV_SIZE			SZ_8K
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 #endif
 
include/configs/cm_t335.h +0 -2
index 740bbd45a0..54f2cea864 100644
@@ -23,8 +23,6 @@
 #define V_OSCK				25000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
 
-#define CONFIG_ENV_SIZE			(16 << 10)	/* 16 KiB */
-
 #ifndef CONFIG_SPL_BUILD
 #define MMCARGS \
 	"mmcdev=0\0" \
include/configs/cm_t35.h +0 -2
index fd693cf251..f9a6444d1d 100644
@@ -39,7 +39,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE		(16 << 10)	/* 16 KiB */
 					/* Sector */
 #define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 10))
 
@@ -179,7 +178,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
 
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 /* additions for new relocation code, must be added to all boards */
include/configs/cm_t3517.h +0 -2
index c876853cd5..4890141d6d 100644
@@ -46,7 +46,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE		(128 << 10)	/* 128 KiB */
 #define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 10))
 
 /*
@@ -181,7 +180,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
 
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 #if defined(CONFIG_CMD_NET)
include/configs/cm_t43.h +0 -5
index bd409896bc..b2c1300427 100644
@@ -75,14 +75,9 @@
 #include <configs/ti_armv7_omap.h>
 #undef CONFIG_SYS_MONITOR_LEN
 
-#define CONFIG_ENV_SIZE			(16 * 1024)
-
 #define V_OSCK				24000000  /* Clock output from T2 */
 #define V_SCLK				(V_OSCK)
 
-#define CONFIG_ENV_SECT_SIZE		(64 * 1024)
-#define CONFIG_ENV_OFFSET		(768 * 1024)
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x80200000\0" \
 	"fdtaddr=0x81200000\0" \
include/configs/corvus.h +0 -2
index f1b0374abe..f2df66eaa3 100644
@@ -88,9 +88,7 @@
 #define CONFIG_SYS_LOAD_ADDR	ATMEL_BASE_CS6
 
 /* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_OFFSET		0x100000
 #define CONFIG_ENV_OFFSET_REDUND	0x180000
-#define CONFIG_ENV_SIZE			SZ_128K
 
 #define CONFIG_BOOTCOMMAND						\
 	"nand read 0x70000000 0x200000 0x300000;"			\
include/configs/devkit8000.h +0 -6
index 2eb658dc61..baf1a73b95 100644
@@ -37,8 +37,6 @@
 #define CONFIG_REVISION_TAG		1
 
 /* Size of malloc() pool */
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-						/* Sector */
 #undef CONFIG_SYS_MALLOC_LEN
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (128 << 10))
 
@@ -144,10 +142,6 @@
 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + \
 					0x01000000) /* 16MB */
 
-/* NAND and environment organization  */
-
-#define CONFIG_ENV_OFFSET		0x260000
-
 /* SRAM config */
 #define CONFIG_SYS_SRAM_START              0x40200000
 #define CONFIG_SYS_SRAM_SIZE               0x10000
include/configs/dra7xx_evm.h +0 -2
index aec70ee718..9c8141de2e 100644
@@ -21,8 +21,6 @@
 #ifndef CONFIG_QSPI_BOOT
 /* MMC ENV related defines */
 #define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2: eMMC(1) */
-#define CONFIG_ENV_SIZE			(128 << 10)
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 #endif
include/configs/ethernut5.h +0 -2
index b86b54209c..24aaae5640 100644
@@ -52,8 +52,6 @@
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_OFFSET	0x3DE000
-#define CONFIG_ENV_SIZE		(132 << 10)
-#define CONFIG_ENV_SECT_SIZE	CONFIG_ENV_SIZE
 
 /* NAND flash */
 #ifdef CONFIG_CMD_NAND
include/configs/gardena-smart-gateway-at91sam.h +0 -6
index 02bf4d195f..482e4714b1 100644
@@ -43,12 +43,6 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x22000000	/* load address */
 
-/* environment organization */
-#define CONFIG_ENV_UBI_PART		"ubi"
-#define CONFIG_ENV_UBI_VOLUME		"env"
-#define CONFIG_ENV_UBI_VOLUME_REDUND	"env_r"
-#define CONFIG_ENV_SIZE			(64 << 10)
-
 /* SPL */
 #define CONFIG_SPL_MAX_SIZE		0x7000
 #define CONFIG_SPL_STACK		0x308000
include/configs/kc1.h +0 -2
index 59814b5514..e3a219c46b 100644
@@ -103,8 +103,6 @@
  * Environment
  */
 
-#define CONFIG_ENV_SIZE		(128 * 1024)
-
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
include/configs/mcx.h +0 -1
index 411c27c4a8..e398558f42 100644
@@ -34,7 +34,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB sector */
 #define CONFIG_SYS_MALLOC_LEN		(1024 << 10)
 /*
  * DDR related
include/configs/nokia_rx51.h +0 -1
index 453dd32fbd..d9f4bdc1d6 100644
@@ -50,7 +50,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE			(128 << 10)
 #define CONFIG_UBI_SIZE			(512 << 10)
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
 					(128 << 10))
include/configs/omap3_beagle.h +0 -4
index f0c8c990fa..a2a6be7cf8 100644
@@ -40,7 +40,6 @@
 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x80000
 #define CONFIG_SYS_ENV_SECT_SIZE        SZ_128K
-#define CONFIG_ENV_OFFSET               0x260000
 #define CONFIG_ENV_ADDR                 0x260000
 #define CONFIG_ENV_OVERWRITE
 /* NAND: SPL falcon mode configs */
@@ -59,9 +58,6 @@
 
 /* TWL4030 LED Support */
 
-/* Environment */
-#define CONFIG_ENV_SIZE                 SZ_128K
-
 #define CONFIG_PREBOOT                  "usb start"
 
 #define MEM_LAYOUT_ENV_SETTINGS \
include/configs/omap3_cairo.h +0 -4
index ef69b24dd0..9e2b7523e5 100644
@@ -160,11 +160,7 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-#define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
-
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 /* Defines for SPL */
include/configs/omap3_evm.h +0 -3
index 5b9d8a57e3..4ab172c06d 100644
@@ -44,7 +44,6 @@
 #define CONFIG_SYS_NAND_ECCBYTES        3
 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_SYS_ENV_SECT_SIZE        SZ_128K
-#define CONFIG_ENV_OFFSET               0x260000
 #define CONFIG_ENV_ADDR                 0x260000
 #define CONFIG_ENV_OVERWRITE
 /* NAND: SPL falcon mode configs */
@@ -54,8 +53,6 @@
 #endif /* CONFIG_NAND */
 
 /* Environment */
-#define CONFIG_ENV_SIZE                 SZ_128K
-
 #define CONFIG_PREBOOT                  "usb start"
 
 #define MEM_LAYOUT_ENV_SETTINGS \
include/configs/omap3_igep00x0.h +0 -6
index 23d12c6a4e..a95a9cc664 100644
@@ -110,10 +110,4 @@
 #define CONFIG_SPL_UBI_LEB_START	2048
 #define CONFIG_SPL_UBI_INFO_ADDR	0x88080000
 
-/* environment organization */
-#define CONFIG_ENV_UBI_PART		"UBI"
-#define CONFIG_ENV_UBI_VOLUME		"config"
-#define CONFIG_ENV_UBI_VOLUME_REDUND	"config_r"
-#define CONFIG_ENV_SIZE			(32*1024)
-
 #endif /* __IGEP00X0_H */
include/configs/omap3_logic.h +0 -3
index e318a9f896..6b7104db5f 100644
@@ -194,10 +194,7 @@
 /* Monitor@start of flash */
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 /* Defines for SPL */
include/configs/omap3_overo.h +0 -1
index ea941dbb81..38a10e23d9 100644
@@ -19,7 +19,6 @@
 
 /* override size of malloc() pool */
 #undef CONFIG_SYS_MALLOC_LEN
-#define CONFIG_ENV_SIZE		(128 << 10)	/* 128 KiB sector */
 /* Shift 128 << 15 provides 4 MiB heap to support UBI commands.
  * Shift 128 << 10 provides 128 KiB heap for limited-memory devices. */
 #define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 15))
include/configs/omap3_pandora.h +0 -3
index 82c66c4b8c..98f243f4dd 100644
@@ -15,8 +15,6 @@
 
 #define CONFIG_REVISION_TAG		1
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-
 #define CONFIG_SYS_DEVICE_NULLDEV	1
 
 /*
@@ -63,7 +61,6 @@
 
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 #endif				/* __CONFIG_H */
include/configs/omap3_zoom1.h +0 -3
index 0a02ecdc14..4dc22a7a19 100644
@@ -23,8 +23,6 @@
 
 #define CONFIG_REVISION_TAG		1
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-
 /*
  * Hardware drivers
  */
@@ -132,7 +130,6 @@
 #define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			0x260000
 
 #endif				/* __CONFIG_H */
include/configs/omap5_uevm.h +0 -2
index 0d8f945349..27e47327d3 100644
@@ -32,8 +32,6 @@
 
 /* MMC ENV related defines */
 #define CONFIG_SYS_MMC_ENV_DEV		1	/* SLOT2: eMMC(1) */
-#define CONFIG_ENV_SIZE			(128 << 10)
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
include/configs/pcm051.h +0 -1
index 8cde12e375..153e567c2f 100644
@@ -21,7 +21,6 @@
 
 #include <configs/ti_am335x_common.h>
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
 #define CONFIG_MACH_TYPE		MACH_TYPE_PCM051
 
 /* set to negative value for no autoboot */
include/configs/pepper.h +0 -2
index ef662d7000..662fce3355 100644
@@ -17,8 +17,6 @@
 /* Mach type */
 #define CONFIG_MACH_TYPE		MACH_TYPE_PEPPER
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
 	"bootdir=/boot\0" \
include/configs/siemens-am33x-common.h +0 -2
index 12819553b0..c07814f91b 100644
@@ -18,7 +18,6 @@
 #define CONFIG_DMA_COHERENT
 #define CONFIG_DMA_COHERENT_SIZE	(1 << 20)
 
-#define CONFIG_ENV_SIZE			(0x2000)
 #define CONFIG_SYS_MALLOC_LEN		(16 * 1024 * 1024)
 #ifdef CONFIG_SIEMENS_MACH_TYPE
 #define CONFIG_MACH_TYPE		CONFIG_SIEMENS_MACH_TYPE
@@ -461,7 +460,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND
 							   devices */
 #if !defined(CONFIG_SPI_BOOT)
-#define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
 #endif
 #endif
include/configs/smartweb.h +0 -2
index 0d0c6bdc69..ddab7589f0 100644
@@ -144,10 +144,8 @@
 /*
  * The NAND Flash partitions:
  */
-#define CONFIG_ENV_OFFSET		(0x100000)
 #define CONFIG_ENV_OFFSET_REDUND	(0x180000)
 #define CONFIG_ENV_RANGE		(SZ_512K)
-#define CONFIG_ENV_SIZE			(SZ_128K)
 
 /*
  * Predefined environment variables.
include/configs/snapper9260.h +0 -2
index f212d154e9..7c2c5fb6ca 100644
@@ -111,8 +111,6 @@
 #define CONFIG_BOOTP_BOOTFILESIZE
 
 /* Environment settings */
-#define CONFIG_ENV_OFFSET		(512 << 10)
-#define CONFIG_ENV_SIZE			(256 << 10)
 #define CONFIG_ENV_OVERWRITE
 
 /* Console settings */
include/configs/snapper9g45.h +0 -2
index dac2e65231..ffcfdcaafc 100644
@@ -74,8 +74,6 @@
 #define CONFIG_BOOTP_BOOTFILESIZE
 
 /* Environment settings */
-#define CONFIG_ENV_OFFSET		(512 << 10)
-#define CONFIG_ENV_SIZE			(256 << 10)
 #define CONFIG_ENV_OVERWRITE
 
 #define	CONFIG_EXTRA_ENV_SETTINGS	\
include/configs/sniper.h +0 -2
index 540ea77ce0..0e2fcc3e23 100644
@@ -96,8 +96,6 @@
  * Environment
  */
 
-#define CONFIG_ENV_SIZE		(128 * 1024)
-
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
include/configs/tam3517-common.h +0 -1
index e7bab7203e..121de2bd24 100644
@@ -28,7 +28,6 @@
 /*
  * Size of malloc() pool
  */
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB sector */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (128 << 10) + \
 					2 * 1024 * 1024)
 /*
include/configs/tao3530.h +0 -2
index a95cbed33a..c34e785d9e 100644
@@ -32,7 +32,6 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN		(4 << 20)
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB sector */
 
 /*
  * Hardware drivers
@@ -170,7 +169,6 @@
 #define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)
-#define CONFIG_ENV_OFFSET		0x260000
 #define CONFIG_ENV_ADDR			CONFIG_ENV_OFFSET
 
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
include/configs/taurus.h +0 -2
index 45a4a800c5..17391549d4 100644
@@ -114,9 +114,7 @@
 #define CONFIG_SYS_LOAD_ADDR			0x22000000
 
 /* bootstrap in spi flash , u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET		0x100000
 #define CONFIG_ENV_OFFSET_REDUND	0x180000
-#define CONFIG_ENV_SIZE		(SZ_128K)	/* 1 sector = 128 kB */
 
 #ifndef CONFIG_SPL_BUILD
 #if defined(CONFIG_BOARD_AXM)
include/configs/ti814x_evm.h +0 -1
index 512386ee22..90b424f499 100644
@@ -18,7 +18,6 @@
 
 #include <asm/arch/omap.h>
 
-#define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
 #define CONFIG_SYS_MALLOC_LEN		(1024 << 10)
 #define CONFIG_MACH_TYPE		MACH_TYPE_TI8148EVM
 
include/configs/ti_omap4_common.h +0 -5
index fc59aba1fa..1e316227aa 100644
@@ -23,11 +23,6 @@
 /* Use General purpose timer 1 */
 #define CONFIG_SYS_TIMERBASE		GPT2_BASE
 
-/*
- * Total Size Environment - 128k
- */
-#define CONFIG_ENV_SIZE			(128 << 10)
-
 /*
  * For the DDR timing information we can either dynamically determine
  * the timings to use or use pre-determined timings (based on using the
include/configs/tricorder.h +0 -2
index 683375a0df..2106f4e5b0 100644
@@ -78,9 +78,7 @@
 
 /* environment placement (for NAND), is different for FLASHCARD but does not
  * harm there */
-#define CONFIG_ENV_OFFSET		0x120000    /* env start */
 #define CONFIG_ENV_OFFSET_REDUND	0x2A0000    /* redundant env start */
-#define CONFIG_ENV_SIZE			(16 << 10)  /* use 16KiB for env */
 #define CONFIG_ENV_RANGE		(384 << 10) /* allow badblocks in env */
 
 /* the loadaddr is the same as CONFIG_SYS_LOAD_ADDR, unfortunately the defiend
include/configs/usb_a9263.h +0 -3
index fa38274d56..ee72354dd5 100644
@@ -79,9 +79,6 @@
 #define CONFIG_SYS_MEMTEST_END			0x23e00000
 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
-#define CONFIG_ENV_OFFSET	0x2000
-#define CONFIG_ENV_SIZE		0x2000
-#define CONFIG_ENV_SECT_SIZE	CONFIG_ENV_SIZE
 #define CONFIG_BOOTCOMMAND	"nboot 21000000 0"
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
include/configs/wb50n.h +0 -2
index e3973d02a2..81d30a6114 100644
@@ -74,9 +74,7 @@
     "autostart=no\0"
 
 /* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_OFFSET           0xA0000
 #define CONFIG_ENV_OFFSET_REDUND    0xC0000
-#define CONFIG_ENV_SIZE             0x20000
 #define CONFIG_BOOTCOMMAND \
     "nand read 0x22000000 0x000e0000 0x500000; " \
     "bootm"
Signature · 1 line
2.20.1
#9 lore raw

PATCH v2 3/9 at91, omap2plus: configs: migrate CONFIG_ENV_ to defconfigs

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 167 lines

From: Markus Klotzbuecher <[email protected]>

Enable the extended ENV options for AT91 and OMAP2PLUS in order to be able to use CONFIG_ENV_UBI_* on these architectures.

As this change also makes the configs ENV_SIZE, ENV_SECT_SIZE, ENV_OFFSET visible to AT91 and OMAP2PLUS, migrate users of these to KConfig.

This migration was run using an extended moveconfig.py which evaluates expressions such as "(512 << 10)". See patch ("moveconfig: expand simple expressions").

All modified boards were built with SOURCE_DATE_EPOCH=0 before and after the change and successfully confirmed that the identical binary is generated (the only exception was igep00x0, which does not define CONFIG_ENV_IS_IN_UBI in the original board header. Once that is defined, the test passes too).

Cc Heiko Schocher <[email protected]>
Cc Eugen Hristev <[email protected]>
Cc Tom Rini <[email protected]>

---
Changes for v2: new patch

  configs/am335x_guardian_defconfig               |  2 ++
  configs/am335x_igep003x_defconfig               |  4 ++++
  configs/am335x_pdu001_defconfig                 |  1 +
  configs/am335x_shc_defconfig                    |  2 ++
  configs/am335x_shc_ict_defconfig                |  2 ++
  configs/am335x_shc_netboot_defconfig            |  2 ++
  configs/am335x_shc_sdboot_defconfig             |  2 ++
  configs/am335x_sl50_defconfig                   |  1 +
  configs/am43xx_evm_defconfig                    |  1 +
  configs/am43xx_evm_qspiboot_defconfig           |  3 +++
  configs/am43xx_evm_rtconly_defconfig            |  1 +
  configs/am43xx_evm_usbhost_boot_defconfig       |  1 +
  configs/am43xx_hs_evm_defconfig                 |  1 +
  configs/at91rm9200ek_defconfig                  |  3 +++
  configs/at91rm9200ek_ram_defconfig              |  3 +++
  configs/at91sam9260ek_dataflash_cs0_defconfig   |  3 +++
  configs/at91sam9260ek_dataflash_cs1_defconfig   |  3 +++
  configs/at91sam9261ek_dataflash_cs0_defconfig   |  3 +++
  configs/at91sam9261ek_dataflash_cs3_defconfig   |  3 +++
  configs/at91sam9263ek_dataflash_cs0_defconfig   |  3 +++
  configs/at91sam9263ek_dataflash_defconfig       |  3 +++
  configs/at91sam9263ek_norflash_boot_defconfig   |  3 +++
  configs/at91sam9263ek_norflash_defconfig        |  3 +++
  configs/at91sam9g10ek_dataflash_cs0_defconfig   |  3 +++
  configs/at91sam9g10ek_dataflash_cs3_defconfig   |  3 +++
  configs/at91sam9g20ek_2mmc_defconfig            |  2 ++
  configs/at91sam9g20ek_dataflash_cs0_defconfig   |  3 +++
  configs/at91sam9g20ek_dataflash_cs1_defconfig   |  3 +++
  configs/at91sam9m10g45ek_mmc_defconfig          |  1 +
  configs/at91sam9n12ek_mmc_defconfig             |  1 +
  configs/at91sam9n12ek_spiflash_defconfig        |  3 +++
  configs/at91sam9rlek_dataflash_defconfig        |  3 +++
  configs/at91sam9rlek_mmc_defconfig              |  1 +
  configs/at91sam9x5ek_dataflash_defconfig        |  3 +++
  configs/at91sam9x5ek_mmc_defconfig              |  1 +
  configs/at91sam9x5ek_spiflash_defconfig         |  3 +++
  configs/at91sam9xeek_dataflash_cs0_defconfig    |  3 +++
  configs/at91sam9xeek_dataflash_cs1_defconfig    |  3 +++
  configs/axm_defconfig                           |  1 +
  configs/brppt1_mmc_defconfig                    |  2 ++
  configs/brppt1_nand_defconfig                   |  2 ++
  configs/brppt1_spi_defconfig                    |  3 +++
  configs/brxre1_defconfig                        |  2 ++
  configs/chiliboard_defconfig                    |  2 ++
  configs/cm_t335_defconfig                       |  2 ++
  configs/cm_t35_defconfig                        |  1 +
  configs/cm_t43_defconfig                        |  3 +++
  configs/cm_t54_defconfig                        |  2 ++
  configs/corvus_defconfig                        |  1 +
  configs/draco_defconfig                         |  1 +
  configs/eco5pk_defconfig                        |  1 +
  configs/etamin_defconfig                        |  2 ++
  configs/ethernut5_defconfig                     |  3 +++
  configs/gardena-smart-gateway-at91sam_defconfig |  4 ++++
  configs/gurnard_defconfig                       |  2 ++
  configs/igep00x0_defconfig                      |  5 +++++
  configs/mcx_defconfig                           |  1 +
  configs/meesc_dataflash_defconfig               |  3 +++
  configs/meesc_defconfig                         |  1 +
  configs/mt_ventoux_defconfig                    |  1 +
  configs/omap3_overo_defconfig                   |  1 +
  configs/omap4_sdp4430_defconfig                 |  1 +
  configs/pengwyn_defconfig                       |  1 +
  configs/picosam9g45_defconfig                   |  1 +
  configs/pm9261_defconfig                        |  3 +++
  configs/pm9263_defconfig                        |  3 +++
  configs/pxm2_defconfig                          |  1 +
  configs/rastaban_defconfig                      |  1 +
  configs/rut_defconfig                           |  1 +
  configs/sama5d27_som1_ek_mmc1_defconfig         |  1 +
  configs/sama5d27_som1_ek_mmc_defconfig          |  1 +
  configs/sama5d2_icp_mmc_defconfig               |  1 +
  configs/sama5d2_ptc_ek_mmc_defconfig            |  1 +
  configs/sama5d2_xplained_emmc_defconfig         |  1 +
  configs/sama5d2_xplained_mmc_defconfig          |  1 +
  configs/sama5d2_xplained_spiflash_defconfig     |  3 +++
  configs/sama5d36ek_cmp_mmc_defconfig            |  1 +
  configs/sama5d36ek_cmp_spiflash_defconfig       |  3 +++
  configs/sama5d3_xplained_mmc_defconfig          |  1 +
  configs/sama5d3xek_mmc_defconfig                |  1 +
  configs/sama5d3xek_spiflash_defconfig           |  3 +++
  configs/sama5d4_xplained_mmc_defconfig          |  1 +
  configs/sama5d4_xplained_spiflash_defconfig     |  3 +++
  configs/sama5d4ek_mmc_defconfig                 |  1 +
  configs/sama5d4ek_spiflash_defconfig            |  3 +++
  configs/smartweb_defconfig                      |  1 +
  configs/snapper9260_defconfig                   |  2 ++
  configs/snapper9g20_defconfig                   |  2 ++
  configs/taurus_defconfig                        |  1 +
  configs/thuban_defconfig                        |  1 +
  configs/ti816x_evm_defconfig                    |  2 ++
  configs/tricorder_defconfig                     |  2 ++
  configs/tricorder_flash_defconfig               |  1 +
  configs/twister_defconfig                       |  1 +
  configs/usb_a9263_dataflash_defconfig           |  3 +++
  configs/vinco_defconfig                         |  3 +++
  configs/wb45n_defconfig                         |  1 +
  configs/wb50n_defconfig                         |  1 +
  env/Kconfig                                     | 11 +++++++----
  include/configs/am335x_evm.h                    |  3 ---
  include/configs/am335x_igep003x.h               |  7 -------
  include/configs/am335x_sl50.h                   |  3 ---
  include/configs/am3517_crane.h                  |  2 --
  include/configs/am3517_evm.h                    |  2 --
  include/configs/am43xx_evm.h                    |  5 -----
  include/configs/am57xx_evm.h                    |  2 --
  include/configs/at91-sama5_common.h             |  5 -----
  include/configs/at91rm9200ek.h                  |  2 +-
  include/configs/baltos.h                        |  3 ---
  include/configs/bav335x.h                       |  3 ---
  include/configs/brppt1.h                        |  5 -----
  include/configs/chiliboard.h                    |  4 ----
  include/configs/cm_t335.h                       |  2 --
  include/configs/cm_t35.h                        |  2 --
  include/configs/cm_t3517.h                      |  2 --
  include/configs/cm_t43.h                        |  5 -----
  include/configs/corvus.h                        |  2 --
  include/configs/devkit8000.h                    |  6 ------
  include/configs/dra7xx_evm.h                    |  2 --
  include/configs/ethernut5.h                     |  2 --
  include/configs/gardena-smart-gateway-at91sam.h |  6 ------
  include/configs/kc1.h                           |  2 --
  include/configs/mcx.h                           |  1 -
  include/configs/nokia_rx51.h                    |  1 -
  include/configs/omap3_beagle.h                  |  4 ----
  include/configs/omap3_cairo.h                   |  4 ----
  include/configs/omap3_evm.h                     |  3 ---
  include/configs/omap3_igep00x0.h                |  6 ------
  include/configs/omap3_logic.h                   |  3 ---
  include/configs/omap3_overo.h                   |  1 -
  include/configs/omap3_pandora.h                 |  3 ---
  include/configs/omap3_zoom1.h                   |  3 ---
  include/configs/omap5_uevm.h                    |  2 --
  include/configs/pcm051.h                        |  1 -
  include/configs/pepper.h                        |  2 --
  include/configs/siemens-am33x-common.h          |  2 --
  include/configs/smartweb.h                      |  2 --
  include/configs/snapper9260.h                   |  2 --
  include/configs/snapper9g45.h                   |  2 --
  include/configs/sniper.h                        |  2 --
  include/configs/tam3517-common.h                |  1 -
Quoted 8 lines
  include/configs/tao3530.h                       |  2 --
  include/configs/taurus.h                        |  2 --
  include/configs/ti814x_evm.h                    |  1 -
  include/configs/ti_omap4_common.h               |  5 -----
  include/configs/tricorder.h                     |  2 --
  include/configs/usb_a9263.h                     |  3 ---
  include/configs/wb50n.h                         |  2 --
  148 files changed, 202 insertions(+), 142 deletions(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#10 lore raw

PATCH v2 4/9 env: ubi: support configurable VID offset

In reply to Markus Klotzbuecher

From: Hamish Guthrie <[email protected]>

Introduce KConfig CONFIG_ENV_UBI_VID_OFFSET to allow providing custom VID header offsets for the environment on UBI.

---
Changes for v2:
- default to no custom vid offset

 env/Kconfig |  7 +++++++
 env/ubi.c   | 17 +++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)
env/Kconfig +7 -0
index a57b1fc70b..c4c3309c09 100644
@@ -522,6 +522,13 @@ config ENV_UBI_VOLUME_REDUND
 	help
 	  Name of the redundant volume that you want to store the environment in.
 
+config ENV_UBI_VID_OFFSET
+	int "ubi environment VID offset"
+	depends on ENV_IS_IN_UBI
+	default 0
+	help
+	  UBI VID offset for environment. If 0, no custom VID offset is used.
+
 endif
 
 config USE_DEFAULT_ENV_FILE
env/ubi.c +13 -4
index 1dfdf0a8c8..e4b85167ec 100644
@@ -15,6 +15,15 @@
 #include <ubi_uboot.h>
 #undef crc32
 
+#define _QUOTE(x) #x
+#define QUOTE(x) _QUOTE(x)
+
+#if (CONFIG_ENV_UBI_VID_OFFSET == 0)
+ #define UBI_VID_OFFSET NULL
+#else
+ #define UBI_VID_OFFSET QUOTE(CONFIG_ENV_UBI_VID_OFFSET)
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_CMD_SAVEENV
@@ -28,7 +37,7 @@ static int env_ubi_save(void)
 	if (ret)
 		return ret;
 
-	if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
+	if (ubi_part(CONFIG_ENV_UBI_PART, UBI_VID_OFFSET)) {
 		printf("\n** Cannot find mtd partition \"%s\"\n",
 		       CONFIG_ENV_UBI_PART);
 		return 1;
@@ -70,7 +79,7 @@ static int env_ubi_save(void)
 	if (ret)
 		return ret;
 
-	if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
+	if (ubi_part(CONFIG_ENV_UBI_PART, UBI_VID_OFFSET)) {
 		printf("\n** Cannot find mtd partition \"%s\"\n",
 		       CONFIG_ENV_UBI_PART);
 		return 1;
@@ -111,7 +120,7 @@ static int env_ubi_load(void)
 	tmp_env1 = (env_t *)env1_buf;
 	tmp_env2 = (env_t *)env2_buf;
 
-	if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
+	if (ubi_part(CONFIG_ENV_UBI_PART, UBI_VID_OFFSET)) {
 		printf("\n** Cannot find mtd partition \"%s\"\n",
 		       CONFIG_ENV_UBI_PART);
 		set_default_env(NULL, 0);
@@ -148,7 +157,7 @@ static int env_ubi_load(void)
 	 */
 	memset(buf, 0x0, CONFIG_ENV_SIZE);
 
-	if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
+	if (ubi_part(CONFIG_ENV_UBI_PART, UBI_VID_OFFSET)) {
 		printf("\n** Cannot find mtd partition \"%s\"\n",
 		       CONFIG_ENV_UBI_PART);
 		set_default_env(NULL, 0);
Signature · 1 line
2.20.1
#11 lore raw

PATCH v2 4/9 env: ubi: support configurable VID offset

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 9 lines

From: Hamish Guthrie <[email protected]>

Introduce KConfig CONFIG_ENV_UBI_VID_OFFSET to allow providing custom VID header offsets for the environment on UBI.

Quoted 7 lines

---
Changes for v2:
- default to no custom vid offset

  env/Kconfig |  7 +++++++
  env/ubi.c   | 17 +++++++++++++----
  2 files changed, 20 insertions(+), 4 deletions(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#12 lore raw

PATCH v2 5/9 ubi: fix UBI_SILENCE_MSG

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

- drop CONFIG_ prefix from kconfig entry
- fix small compilation issue with CONFIG_UBI_SILENCE_MSG

---
Changes for v2: None

 drivers/mtd/ubi/Kconfig | 2 +-
 drivers/mtd/ubi/io.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/mtd/ubi/Kconfig +1 -1
index 2b17eae947..a78fd51ba7 100644
@@ -1,6 +1,6 @@
 menu "UBI support"
 
-config CONFIG_UBI_SILENCE_MSG
+config UBI_SILENCE_MSG
 	bool "UBI silence verbose messages"
 	default ENV_IS_IN_UBI
 	help
drivers/mtd/ubi/io.c +2 -0
index 8ef7823b37..688fb509d2 100644
@@ -1351,6 +1351,7 @@ static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
 
 		ubi_err(ubi, "self-check failed for PEB %d:%d, len %d",
 			pnum, offset, len);
+#if !defined(CONFIG_UBI_SILENCE_MSG)
 		ubi_msg(ubi, "data differ at position %d", i);
 		ubi_msg(ubi, "hex dump of the original buffer from %d to %d",
 			i, i + dump_len);
@@ -1360,6 +1361,7 @@ static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum,
 			i, i + dump_len);
 		print_hex_dump("", DUMP_PREFIX_OFFSET, 32, 1,
 			       buf1 + i, dump_len, 1);
+#endif
 		dump_stack();
 		err = -EINVAL;
 		goto out_free;
Signature · 1 line
2.20.1
#13 lore raw

PATCH v2 5/9 ubi: fix UBI_SILENCE_MSG

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 8 lines

From: Markus Klotzbuecher <[email protected]>

- drop CONFIG_ prefix from kconfig entry
- fix small compilation issue with CONFIG_UBI_SILENCE_MSG

Quoted 6 lines

---
Changes for v2: None

  drivers/mtd/ubi/Kconfig | 2 +-
  drivers/mtd/ubi/io.c    | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#14 lore raw

PATCH v2 6/9 ubispl: migrate configuration to Kconfig

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Move the ubispl configuration to KConfig and drop them from the whitelist.

Cc Heiko Schocher <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Javier Martínez Canillas <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>

---
Changes for v2: None

 common/spl/Kconfig           | 79 ++++++++++++++++++++++++++++++++++++
 scripts/config_whitelist.txt | 12 ------
 2 files changed, 79 insertions(+), 12 deletions(-)
common/spl/Kconfig +79 -0
index c7cd34449a..fa63746909 100644
@@ -556,6 +556,85 @@ config SPL_NAND_SUPPORT
 	  This enables the drivers in drivers/mtd/nand/raw as part of an SPL
 	  build.
 
+config SPL_UBI
+	bool "Support UBI"
+	help
+	  Enable support for loading payloads from UBI. See
+	  README.ubispl for more info.
+
+if SPL_UBI
+config SPL_UBI_MAX_VOL_LEBS
+	int "Maximum number of LEBs per volume"
+	depends on SPL_UBI
+	help
+	  The maximum number of logical eraseblocks which a static volume
+	  to load can contain. Used for sizing the scan data structure.
+
+config SPL_UBI_MAX_PEB_SIZE
+	int "Maximum PEB size"
+	depends on SPL_UBI
+	help
+	  The maximum physical erase block size.
+
+config SPL_UBI_MAX_PEBS
+	int "Maximum number of PEBs"
+	depends on SPL_UBI
+	help
+	  The maximum physical erase block size. If not overridden by
+	  board code, this value will be used as the actual number of PEBs.
+
+config SPL_UBI_PEB_OFFSET
+	int "Offset to first UBI PEB"
+	depends on SPL_UBI
+	help
+	  The offset in number of PEBs from the start of flash to the first
+	  PEB part of the UBI image.
+
+config SPL_UBI_VID_OFFSET
+	int "Offset to VID header"
+	depends on SPL_UBI
+
+config SPL_UBI_LEB_START
+	int "Offset to LEB in PEB"
+	depends on SPL_UBI
+	help
+	  The offset in bytes to the LEB within a PEB.
+
+config SPL_UBI_INFO_ADDR
+	hex "Address to place UBI scan info"
+	depends on SPL_UBI
+	help
+	  Address for ubispl to place the scan info. Read README.ubispl to
+	  determine the required size
+
+config SPL_UBI_VOL_IDS
+	int "Maximum volume id"
+	depends on SPL_UBI
+	help
+	  The maximum volume id which can be loaded. Used for sizing the
+	  scan data structure.
+
+config SPL_UBI_LOAD_MONITOR_ID
+	int "id of U-Boot volume"
+	depends on SPL_UBI
+	help
+	  The UBI volume id from which to load U-Boot
+
+config SPL_UBI_LOAD_KERNEL_ID
+	int "id of kernel volume"
+	depends on SPL_OS_BOOT && SPL_UBI
+	help
+	  The UBI volume id from which to load the kernel
+
+config SPL_UBI_LOAD_ARGS_ID
+	int "id of kernel args volume"
+	depends on SPL_OS_BOOT && SPL_UBI
+	help
+	  The UBI volume id from which to load the device tree
+
+
+endif   # if SPL_UBI
+
 config SPL_NET_SUPPORT
 	bool "Support networking"
 	help
scripts/config_whitelist.txt +0 -12
index af7eb73e4a..eeddc6a974 100644
@@ -1871,18 +1871,6 @@ CONFIG_SPL_STACK_ADDR
 CONFIG_SPL_STACK_SIZE
 CONFIG_SPL_START_S_PATH
 CONFIG_SPL_TARGET
-CONFIG_SPL_UBI
-CONFIG_SPL_UBI_INFO_ADDR
-CONFIG_SPL_UBI_LEB_START
-CONFIG_SPL_UBI_LOAD_ARGS_ID
-CONFIG_SPL_UBI_LOAD_KERNEL_ID
-CONFIG_SPL_UBI_LOAD_MONITOR_ID
-CONFIG_SPL_UBI_MAX_PEBS
-CONFIG_SPL_UBI_MAX_PEB_SIZE
-CONFIG_SPL_UBI_MAX_VOL_LEBS
-CONFIG_SPL_UBI_PEB_OFFSET
-CONFIG_SPL_UBI_VID_OFFSET
-CONFIG_SPL_UBI_VOL_IDS
 CONFIG_SPL_UBOOT_KEY_HASH
 CONFIG_SRAM_BASE
 CONFIG_SRAM_SIZE
Signature · 1 line
2.20.1
#15 lore raw

PATCH v2 6/9 ubispl: migrate configuration to Kconfig

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 10 lines

From: Markus Klotzbuecher <[email protected]>

Move the ubispl configuration to KConfig and drop them from the whitelist.

Cc Heiko Schocher <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Javier Martínez Canillas <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Quoted 6 lines

---
Changes for v2: None

  common/spl/Kconfig           | 79 ++++++++++++++++++++++++++++++++++++
  scripts/config_whitelist.txt | 12 ------
  2 files changed, 79 insertions(+), 12 deletions(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#16 lore raw

PATCH v2 7/9 configs: migrate ubispl boards to KConfig

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

Migrate the ubispl configuration for the omap3_igep00x0 and am335x_igep003x boards to KConfig. Both boards were built with SOURCE_DATE_EPOCH=0 and found to be equal before and after.

Cc Heiko Schocher <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Javier Martínez Canillas <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>

---
Changes for v2: new patch

 configs/am335x_igep003x_defconfig | 12 ++++++++++++
 configs/igep00x0_defconfig        | 12 ++++++++++++
 include/configs/am335x_igep003x.h | 16 ----------------
 include/configs/omap3_igep00x0.h  | 14 --------------
 4 files changed, 24 insertions(+), 30 deletions(-)
configs/am335x_igep003x_defconfig +12 -0
index f44fb09b31..5874831ba1 100644
@@ -21,6 +21,18 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_UBI=y
+CONFIG_SPL_UBI_MAX_VOL_LEBS=256
+CONFIG_SPL_UBI_MAX_PEB_SIZE=262144
+CONFIG_SPL_UBI_MAX_PEBS=4096
+CONFIG_SPL_UBI_PEB_OFFSET=4
+CONFIG_SPL_UBI_VID_OFFSET=512
+CONFIG_SPL_UBI_LEB_START=2048
+CONFIG_SPL_UBI_INFO_ADDR=0x88080000
+CONFIG_SPL_UBI_VOL_IDS=8
+CONFIG_SPL_UBI_LOAD_MONITOR_ID=0
+CONFIG_SPL_UBI_LOAD_KERNEL_ID=3
+CONFIG_SPL_UBI_LOAD_ARGS_ID=4
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
configs/igep00x0_defconfig +12 -0
index 927d7f0ecd..ab11935f48 100644
@@ -17,6 +17,18 @@ CONFIG_SPL_TEXT_BASE=0x40200000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_UBI=y
+CONFIG_SPL_UBI_MAX_VOL_LEBS=256
+CONFIG_SPL_UBI_MAX_PEB_SIZE=262144
+CONFIG_SPL_UBI_MAX_PEBS=4096
+CONFIG_SPL_UBI_PEB_OFFSET=4
+CONFIG_SPL_UBI_VID_OFFSET=512
+CONFIG_SPL_UBI_LEB_START=2048
+CONFIG_SPL_UBI_INFO_ADDR=0x88080000
+CONFIG_SPL_UBI_VOL_IDS=8
+CONFIG_SPL_UBI_LOAD_MONITOR_ID=0
+CONFIG_SPL_UBI_LOAD_KERNEL_ID=3
+CONFIG_SPL_UBI_LOAD_ARGS_ID=4
 CONFIG_SPL_ONENAND_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_CMD_SPL=y
include/configs/am335x_igep003x.h +0 -16
index 5131cd38e4..5b5e16026e 100644
@@ -106,22 +106,6 @@
 /* NAND support */
 #define CONFIG_SYS_NAND_ONFI_DETECTION	1
 
-/* SPL */
-
-/* UBI configuration */
-#define CONFIG_SPL_UBI			1
-#define CONFIG_SPL_UBI_MAX_VOL_LEBS	256
-#define CONFIG_SPL_UBI_MAX_PEB_SIZE	(256*1024)
-#define CONFIG_SPL_UBI_MAX_PEBS		4096
-#define CONFIG_SPL_UBI_VOL_IDS		8
-#define CONFIG_SPL_UBI_LOAD_MONITOR_ID	0
-#define CONFIG_SPL_UBI_LOAD_KERNEL_ID	3
-#define CONFIG_SPL_UBI_LOAD_ARGS_ID	4
-#define CONFIG_SPL_UBI_PEB_OFFSET	4
-#define CONFIG_SPL_UBI_VID_OFFSET	512
-#define CONFIG_SPL_UBI_LEB_START	2048
-#define CONFIG_SPL_UBI_INFO_ADDR	0x88080000
-
 /* NAND config */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
include/configs/omap3_igep00x0.h +0 -14
index a95a9cc664..4ad7dc18b1 100644
@@ -96,18 +96,4 @@
 #define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 
-/* UBI configuration */
-#define CONFIG_SPL_UBI			1
-#define CONFIG_SPL_UBI_MAX_VOL_LEBS	256
-#define CONFIG_SPL_UBI_MAX_PEB_SIZE	(256*1024)
-#define CONFIG_SPL_UBI_MAX_PEBS		4096
-#define CONFIG_SPL_UBI_VOL_IDS		8
-#define CONFIG_SPL_UBI_LOAD_MONITOR_ID	0
-#define CONFIG_SPL_UBI_LOAD_KERNEL_ID	3
-#define CONFIG_SPL_UBI_LOAD_ARGS_ID	4
-#define CONFIG_SPL_UBI_PEB_OFFSET	4
-#define CONFIG_SPL_UBI_VID_OFFSET	512
-#define CONFIG_SPL_UBI_LEB_START	2048
-#define CONFIG_SPL_UBI_INFO_ADDR	0x88080000
-
 #endif /* __IGEP00X0_H */
Signature · 1 line
2.20.1
#17 lore raw

PATCH v2 7/9 configs: migrate ubispl boards to KConfig

Missatge de Markus Klotzbuecher <[email protected]> del dia dc., 15 de maig 2019 a les 15:16:

Quoted 7 lines

From: Markus Klotzbuecher <[email protected]>

Migrate the ubispl configuration for the omap3_igep00x0 and am335x_igep003x boards to KConfig. Both boards were built with SOURCE_DATE_EPOCH=0 and found to be equal before and after.

Quoted 5 lines
Cc Heiko Schocher <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Javier Martínez Canillas <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>

Thanks,
Enric

Quoted 108 lines

---
Changes for v2: new patch

 configs/am335x_igep003x_defconfig | 12 ++++++++++++
 configs/igep00x0_defconfig        | 12 ++++++++++++
 include/configs/am335x_igep003x.h | 16 ----------------
 include/configs/omap3_igep00x0.h  | 14 --------------
 4 files changed, 24 insertions(+), 30 deletions(-)
configs/am335x_igep003x_defconfig +12 -0
index f44fb09b31..5874831ba1 100644
@@ -21,6 +21,18 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_UBI=y
+CONFIG_SPL_UBI_MAX_VOL_LEBS=256
+CONFIG_SPL_UBI_MAX_PEB_SIZE=262144
+CONFIG_SPL_UBI_MAX_PEBS=4096
+CONFIG_SPL_UBI_PEB_OFFSET=4
+CONFIG_SPL_UBI_VID_OFFSET=512
+CONFIG_SPL_UBI_LEB_START=2048
+CONFIG_SPL_UBI_INFO_ADDR=0x88080000
+CONFIG_SPL_UBI_VOL_IDS=8
+CONFIG_SPL_UBI_LOAD_MONITOR_ID=0
+CONFIG_SPL_UBI_LOAD_KERNEL_ID=3
+CONFIG_SPL_UBI_LOAD_ARGS_ID=4
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
configs/igep00x0_defconfig +12 -0
index 927d7f0ecd..ab11935f48 100644
@@ -17,6 +17,18 @@ CONFIG_SPL_TEXT_BASE=0x40200000
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_UBI=y
+CONFIG_SPL_UBI_MAX_VOL_LEBS=256
+CONFIG_SPL_UBI_MAX_PEB_SIZE=262144
+CONFIG_SPL_UBI_MAX_PEBS=4096
+CONFIG_SPL_UBI_PEB_OFFSET=4
+CONFIG_SPL_UBI_VID_OFFSET=512
+CONFIG_SPL_UBI_LEB_START=2048
+CONFIG_SPL_UBI_INFO_ADDR=0x88080000
+CONFIG_SPL_UBI_VOL_IDS=8
+CONFIG_SPL_UBI_LOAD_MONITOR_ID=0
+CONFIG_SPL_UBI_LOAD_KERNEL_ID=3
+CONFIG_SPL_UBI_LOAD_ARGS_ID=4
 CONFIG_SPL_ONENAND_SUPPORT=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_CMD_SPL=y
include/configs/am335x_igep003x.h +0 -16
index 5131cd38e4..5b5e16026e 100644
@@ -106,22 +106,6 @@
 /* NAND support */
 #define CONFIG_SYS_NAND_ONFI_DETECTION 1
 
-/* SPL */
-
-/* UBI configuration */
-#define CONFIG_SPL_UBI                 1
-#define CONFIG_SPL_UBI_MAX_VOL_LEBS    256
-#define CONFIG_SPL_UBI_MAX_PEB_SIZE    (256*1024)
-#define CONFIG_SPL_UBI_MAX_PEBS                4096
-#define CONFIG_SPL_UBI_VOL_IDS         8
-#define CONFIG_SPL_UBI_LOAD_MONITOR_ID 0
-#define CONFIG_SPL_UBI_LOAD_KERNEL_ID  3
-#define CONFIG_SPL_UBI_LOAD_ARGS_ID    4
-#define CONFIG_SPL_UBI_PEB_OFFSET      4
-#define CONFIG_SPL_UBI_VID_OFFSET      512
-#define CONFIG_SPL_UBI_LEB_START       2048
-#define CONFIG_SPL_UBI_INFO_ADDR       0x88080000
-
 /* NAND config */
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
include/configs/omap3_igep00x0.h +0 -15
index a95a9cc664..4ad7dc18b1 100644
@@ -96,18 +96,4 @@
 #define CONFIG_SYS_NAND_ECCBYTES       14
 #define CONFIG_NAND_OMAP_ECCSCHEME     OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 
-/* UBI configuration */
-#define CONFIG_SPL_UBI                 1
-#define CONFIG_SPL_UBI_MAX_VOL_LEBS    256
-#define CONFIG_SPL_UBI_MAX_PEB_SIZE    (256*1024)
-#define CONFIG_SPL_UBI_MAX_PEBS                4096
-#define CONFIG_SPL_UBI_VOL_IDS         8
-#define CONFIG_SPL_UBI_LOAD_MONITOR_ID 0
-#define CONFIG_SPL_UBI_LOAD_KERNEL_ID  3
-#define CONFIG_SPL_UBI_LOAD_ARGS_ID    4
-#define CONFIG_SPL_UBI_PEB_OFFSET      4
-#define CONFIG_SPL_UBI_VID_OFFSET      512
-#define CONFIG_SPL_UBI_LEB_START       2048
-#define CONFIG_SPL_UBI_INFO_ADDR       0x88080000
-
 #endif /* __IGEP00X0_H */
--

2.20.1

#18 lore raw

PATCH v2 7/9 configs: migrate ubispl boards to KConfig

In reply to Markus Klotzbuecher

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 11 lines

From: Markus Klotzbuecher <[email protected]>

Migrate the ubispl configuration for the omap3_igep00x0 and am335x_igep003x boards to KConfig. Both boards were built with SOURCE_DATE_EPOCH=0 and found to be equal before and after.

Cc Heiko Schocher <[email protected]>
Cc Kyungmin Park <[email protected]>
Cc Javier Martínez Canillas <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>
Quoted 8 lines

---
Changes for v2: new patch

  configs/am335x_igep003x_defconfig | 12 ++++++++++++
  configs/igep00x0_defconfig        | 12 ++++++++++++
  include/configs/am335x_igep003x.h | 16 ----------------
  include/configs/omap3_igep00x0.h  | 14 --------------
  4 files changed, 24 insertions(+), 30 deletions(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#19 lore raw

PATCH v2 8/9 ubispl: add support for loading volumes by name

In reply to Markus Klotzbuecher

From: Hamish Guthrie <[email protected]>

The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates on UBI. To that end the SPL is configured to always load the same volume name (e.g. "u-boot"), whereas a software updater always installs into the secondary volume "u-boot_r". After successful installation, these two volume names are switched.

This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching.

This adds two vtbl related functions from Linux, which are taken from the same kernel version as the current main U-Boot UBI code (Linux 4.2 64291f7db5bd8).

---
Changes for v2:
- indicate version of Kernel from which code was copied

 common/spl/Kconfig          |  13 +++
 common/spl/spl_ubi.c        |   7 ++
 drivers/mtd/ubispl/ubispl.c | 215 +++++++++++++++++++++++++++++++++++-
 drivers/mtd/ubispl/ubispl.h |   7 ++
 include/ubispl.h            |   6 +
 5 files changed, 246 insertions(+), 2 deletions(-)
common/spl/Kconfig +13 -0
index fa63746909..624d084d03 100644
@@ -563,6 +563,13 @@ config SPL_UBI
 	  README.ubispl for more info.
 
 if SPL_UBI
+config SPL_UBI_LOAD_BY_VOLNAME
+	bool "Support loading volumes by name"
+	help
+	  This enables support for loading UBI volumes by name. When this
+	  is set, CONFIG_SPL_UBI_LOAD_MONITOR_VOLNAME can be used to
+	  configure the volume name from which to load U-Boot.
+
 config SPL_UBI_MAX_VOL_LEBS
 	int "Maximum number of LEBs per volume"
 	depends on SPL_UBI
@@ -620,6 +627,12 @@ config SPL_UBI_LOAD_MONITOR_ID
 	help
 	  The UBI volume id from which to load U-Boot
 
+config SPL_UBI_LOAD_MONITOR_VOLNAME
+	string "volume name of U-Boot volume"
+	depends on SPL_UBI_LOAD_BY_VOLNAME
+	help
+	  The UBI volume name from which to load U-Boot
+
 config SPL_UBI_LOAD_KERNEL_ID
 	int "id of kernel volume"
 	depends on SPL_OS_BOOT && SPL_UBI
common/spl/spl_ubi.c +7 -0
index 67e5fadd7c..0cb5080882 100644
@@ -62,7 +62,14 @@ int spl_ubi_load_image(struct spl_image_info *spl_image,
 	}
 #endif
 	header = spl_get_load_buffer(-sizeof(*header), sizeof(header));
+#ifdef CONFIG_SPL_UBI_LOAD_BY_VOLNAME
+	volumes[0].vol_id = -1;
+	strncpy(volumes[0].name,
+		CONFIG_SPL_UBI_LOAD_MONITOR_VOLNAME,
+		UBI_VOL_NAME_MAX + 1);
+#else
 	volumes[0].vol_id = CONFIG_SPL_UBI_LOAD_MONITOR_ID;
+#endif
 	volumes[0].load_addr = (void *)header;
 
 	ret = ubispl_load_volumes(&info, volumes, 1);
drivers/mtd/ubispl/ubispl.c +213 -2

259 lines not on this page · raw message

drivers/mtd/ubispl/ubispl.h +7 -0
index 9e40b46eac..bcc376c6d7 100644
@@ -77,6 +77,8 @@ struct ubi_vol_info {
  * @blockinfo:		The vid headers of the scanned blocks
  * @volinfo:		The volume information of the interesting (toload)
  *			volumes
+ * @vtbl_corrupted:	Flag to indicate status of volume table
+ * @vtbl:		Volume table
  *
  * @fm_buf:		The large fastmap attach buffer
  */
@@ -112,6 +114,11 @@ struct ubi_scan_info {
 	struct ubi_vol_info		volinfo[UBI_SPL_VOL_IDS];
 	struct ubi_vid_hdr		blockinfo[CONFIG_SPL_UBI_MAX_PEBS];
 
+#ifdef CONFIG_SPL_UBI_LOAD_BY_VOLNAME
+	/* Volume table */
+	int                             vtbl_valid;
+	struct ubi_vtbl_record          vtbl[UBI_SPL_VOL_IDS];
+#endif
 	/* The large buffer for the fastmap */
 	uint8_t				fm_buf[UBI_FM_BUF_SIZE];
 };
include/ubispl.h +6 -0
index 1e5da94eb1..ecfe0c93c1 100644
@@ -5,6 +5,8 @@
 #ifndef __UBOOT_UBISPL_H
 #define __UBOOT_UBISPL_H
 
+#define UBI_VOL_NAME_MAX	127
+
 /*
  * The following CONFIG options are relevant for UBISPL
  *
@@ -74,6 +76,10 @@ struct ubispl_info {
  */
 struct ubispl_load {
 	int		vol_id;
+#ifdef CONFIG_SPL_UBI_LOAD_BY_VOLNAME
+	u32		name_len;
+	char		name[UBI_VOL_NAME_MAX + 1];
+#endif
 	void		*load_addr;
 };
 
Signature · 1 line
2.20.1
#20 lore raw

PATCH v2 8/9 ubispl: add support for loading volumes by name

Hello Markus,

Am 15.05.2019 um 15:15 schrieb Markus Klotzbuecher:

Quoted 26 lines

From: Hamish Guthrie <[email protected]>

The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates on UBI. To that end the SPL is configured to always load the same volume name (e.g. "u-boot"), whereas a software updater always installs into the secondary volume "u-boot_r". After successful installation, these two volume names are switched.

This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching.

This adds two vtbl related functions from Linux, which are taken from the same kernel version as the current main U-Boot UBI code (Linux 4.2 64291f7db5bd8).

---
Changes for v2:
- indicate version of Kernel from which code was copied

Quoted 6 lines
  common/spl/Kconfig          |  13 +++
  common/spl/spl_ubi.c        |   7 ++
  drivers/mtd/ubispl/ubispl.c | 215 +++++++++++++++++++++++++++++++++++-
  drivers/mtd/ubispl/ubispl.h |   7 ++
  include/ubispl.h            |   6 +
  5 files changed, 246 insertions(+), 2 deletions(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#21 lore raw

PATCH v2 9/9 ubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSG

In reply to Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

This allows to silence ubi and ubispl individually.

---
Changes for v2: None

 common/spl/Kconfig          | 6 ++++++
 drivers/mtd/ubispl/ubispl.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
common/spl/Kconfig +6 -0
index 624d084d03..ebe61969f9 100644
@@ -645,6 +645,12 @@ config SPL_UBI_LOAD_ARGS_ID
 	help
 	  The UBI volume id from which to load the device tree
 
+config UBI_SPL_SILENCE_MSG
+	bool "silence UBI SPL messages"
+	default n
+	help
+	  Disable messages from UBI SPL. This leaves warnings
+	  and errors enabled.
 
 endif   # if SPL_UBI
 
drivers/mtd/ubispl/ubispl.h +1 -1
index bcc376c6d7..b7cb7fc941 100644
@@ -129,7 +129,7 @@ struct ubi_scan_info {
 #define ubi_dbg(fmt, ...)
 #endif
 
-#ifdef CONFIG_UBI_SILENCE_MSG
+#ifdef CONFIG_UBI_SPL_SILENCE_MSG
 #define ubi_msg(fmt, ...)
 #else
 #define ubi_msg(fmt, ...) printf("UBI: " fmt "\n", ##__VA_ARGS__)
Signature · 1 line
2.20.1
#22 lore raw

PATCH v2 9/9 ubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSG

Hello Markus,

Am 15.05.2019 um 15:16 schrieb Markus Klotzbuecher:

Quoted 7 lines

From: Markus Klotzbuecher <[email protected]>

This allows to silence ubi and ubispl individually.

Quoted 6 lines

---
Changes for v2: None

  common/spl/Kconfig          | 6 ++++++
  drivers/mtd/ubispl/ubispl.h | 2 +-
  2 files changed, 7 insertions(+), 1 deletion(-)

Thanks!

Travis buils is fine, pushed to u-boot-ubi.git next

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#23 lore raw

v2 cover miscellaneous ubispl and ubi improvements

In reply to Markus Klotzbuecher

Hello Heiko

Quoted 24 lines · Markus Klotzbuecher

From: Markus Klotzbuecher <[email protected]>

This series contains a couple of UBI and UBI SPL improvements, notably a ubispl extension to allow loading volumes by name. The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates of U-Boot on UBI. To do that we configured the SPL to always load the same volume name (e.g. "u-boot"), and the software updater always installs into the secondary volume "u-boot_r". After a successful upgrade, these two volume names are switched.

This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching.

We have tested both with and without fastmap enabled and both paths seems to work reliably.

As per Heikos request, this v2 adds two patches that migrate the omap2plus and at91 CONFIG_ENV_* to defconfigs and likewise for the two boards using ubispl. The first migration was supported by an extension to the moveconfig script (patch 1) to expand simple expressions. Both migrations were tested to be binary equal before and after the change.

Quoted 6 lines

Changes v2:
- Add a patch (1) for moveconfig to expand simple expressions
- Add patch (3) to move at91 and omap2plus CONFIG_ENV_ to defconfigs
- Add patch (7) to migrate boards using ubispl to KConfig
- Add missing commit messages
- Indicate version of kernel code which was used in ubispl

I don't mean to bug, just wanted to ask if there's anything missing for this v2 series...

Thanks,
Markus

Signature · 3 lines
Markus Klotzbuecher
Freelancer Embedded, Distributed & Real-time
Am See 28, 78465 Konstanz, Germany