[U-Boot] [PATCH 2/2] Convert CONFIG_SYS_NAND_ECCSIZE et al to Kconfig

Adam Ford aford173 at gmail.com
Sun Sep 3 13:49:59 UTC 2017


This converts the following to Kconfig:
   CONFIG_SYS_NAND_ECCSIZE
   CONFIG_SYS_NAND_ECCBYTES
   CONFIG_SYS_NAND_ECCSTEPS
   CONFIG_SYS_NAND_MAX_ECCPOS
   CONFIG_SYS_NAND_MAX_OOBFREE

Signed-off-by: Adam Ford <aford173 at gmail.com>
---
 README                                       |  4 ----
 arch/arm/include/asm/arch-lpc32xx/config.h   |  2 --
 configs/B4420QDS_NAND_defconfig              |  2 ++
 configs/B4420QDS_SPIFLASH_defconfig          |  2 ++
 configs/B4420QDS_defconfig                   |  2 ++
 configs/B4860QDS_NAND_defconfig              |  2 ++
 configs/B4860QDS_SECURE_BOOT_defconfig       |  2 ++
 configs/B4860QDS_SPIFLASH_defconfig          |  2 ++
 configs/B4860QDS_SRIO_PCIE_BOOT_defconfig    |  2 ++
 configs/B4860QDS_defconfig                   |  2 ++
 configs/CHIP_pro_defconfig                   |  1 +
 configs/MPC8572DS_36BIT_defconfig            |  2 ++
 configs/MPC8572DS_defconfig                  |  2 ++
 configs/P1022DS_36BIT_NAND_defconfig         |  2 ++
 configs/P1022DS_36BIT_SDCARD_defconfig       |  2 ++
 configs/P1022DS_36BIT_SPIFLASH_defconfig     |  2 ++
 configs/P1022DS_36BIT_defconfig              |  2 ++
 configs/P1022DS_NAND_defconfig               |  2 ++
 configs/P1022DS_SDCARD_defconfig             |  2 ++
 configs/P1022DS_SPIFLASH_defconfig           |  2 ++
 configs/P1022DS_defconfig                    |  2 ++
 configs/T4160QDS_NAND_defconfig              |  2 ++
 configs/T4160QDS_SDCARD_defconfig            |  2 ++
 configs/T4160QDS_SECURE_BOOT_defconfig       |  2 ++
 configs/T4160QDS_defconfig                   |  2 ++
 configs/T4160RDB_defconfig                   |  2 ++
 configs/T4240QDS_NAND_defconfig              |  2 ++
 configs/T4240QDS_SDCARD_defconfig            |  2 ++
 configs/T4240QDS_SECURE_BOOT_defconfig       |  2 ++
 configs/T4240QDS_SRIO_PCIE_BOOT_defconfig    |  2 ++
 configs/T4240QDS_defconfig                   |  2 ++
 configs/T4240RDB_SDCARD_defconfig            |  2 ++
 configs/T4240RDB_defconfig                   |  2 ++
 configs/am335x_baltos_defconfig              |  1 +
 configs/am335x_evm_defconfig                 |  1 +
 configs/am335x_evm_nor_defconfig             |  1 +
 configs/am335x_evm_usbspl_defconfig          |  1 +
 configs/am335x_hs_evm_defconfig              |  1 +
 configs/am335x_igep003x_defconfig            |  1 +
 configs/am3517_crane_defconfig               |  1 +
 configs/am3517_evm_defconfig                 |  3 +++
 configs/am43xx_evm_defconfig                 |  1 +
 configs/am43xx_evm_ethboot_defconfig         |  1 +
 configs/am43xx_evm_usbhost_boot_defconfig    |  1 +
 configs/am43xx_hs_evm_defconfig              |  1 +
 configs/at91sam9m10g45ek_nandflash_defconfig |  2 ++
 configs/axm_defconfig                        |  2 ++
 configs/brppt1_nand_defconfig                |  1 +
 configs/cairo_defconfig                      |  1 +
 configs/chiliboard_defconfig                 |  1 +
 configs/cm_t335_defconfig                    |  1 +
 configs/cm_t35_defconfig                     |  1 +
 configs/cm_t43_defconfig                     |  1 +
 configs/corvus_defconfig                     |  2 ++
 configs/devkit3250_defconfig                 |  2 ++
 configs/devkit8000_defconfig                 |  1 +
 configs/draco_defconfig                      |  2 ++
 configs/eco5pk_defconfig                     |  2 ++
 configs/etamin_defconfig                     |  2 ++
 configs/igep0032_defconfig                   |  1 +
 configs/igep00x0_defconfig                   |  1 +
 configs/ipam390_defconfig                    |  1 +
 configs/ls2080a_simu_defconfig               |  2 ++
 configs/ls2080aqds_SECURE_BOOT_defconfig     |  2 ++
 configs/ls2080aqds_defconfig                 |  2 ++
 configs/ls2080aqds_nand_defconfig            |  2 ++
 configs/ls2080aqds_qspi_defconfig            |  2 ++
 configs/ls2080aqds_sdcard_defconfig          |  2 ++
 configs/ls2080ardb_SECURE_BOOT_defconfig     |  2 ++
 configs/ls2080ardb_defconfig                 |  2 ++
 configs/ls2080ardb_nand_defconfig            |  2 ++
 configs/mcx_defconfig                        |  2 ++
 configs/mt_ventoux_defconfig                 |  2 ++
 configs/omap3_beagle_defconfig               |  1 +
 configs/omap3_evm_defconfig                  |  1 +
 configs/omap3_ha_defconfig                   |  1 +
 configs/omap3_logic_defconfig                |  3 +++
 configs/omap3_overo_defconfig                |  2 ++
 configs/omapl138_lcdk_defconfig              |  1 +
 configs/pengwyn_defconfig                    |  2 ++
 configs/pxm2_defconfig                       |  2 ++
 configs/rastaban_defconfig                   |  2 ++
 configs/rut_defconfig                        |  2 ++
 configs/smartweb_defconfig                   |  2 ++
 configs/tao3530_defconfig                    |  1 +
 configs/taurus_defconfig                     |  2 ++
 configs/thuban_defconfig                     |  2 ++
 configs/ti816x_evm_defconfig                 |  1 +
 configs/tricorder_defconfig                  |  3 +++
 configs/tricorder_flash_defconfig            |  3 +++
 configs/twister_defconfig                    |  2 ++
 drivers/mtd/nand/Kconfig                     | 34 ++++++++++++++++++++++++++++
 include/configs/B4860QDS.h                   |  2 --
 include/configs/MPC8572DS.h                  |  2 --
 include/configs/P1022DS.h                    |  2 --
 include/configs/T4240QDS.h                   |  2 --
 include/configs/T4240RDB.h                   |  2 --
 include/configs/am335x_evm.h                 |  2 --
 include/configs/am335x_igep003x.h            |  2 --
 include/configs/am3517_crane.h               |  2 --
 include/configs/am3517_evm.h                 |  4 ----
 include/configs/am43xx_evm.h                 |  2 --
 include/configs/at91sam9m10g45ek.h           |  2 --
 include/configs/baltos.h                     |  2 --
 include/configs/bav335x.h                    |  2 --
 include/configs/brppt1.h                     |  3 ---
 include/configs/chiliboard.h                 |  2 --
 include/configs/cm_t335.h                    |  3 ---
 include/configs/cm_t35.h                     |  2 --
 include/configs/cm_t43.h                     |  2 --
 include/configs/corvus.h                     |  2 --
 include/configs/da850evm.h                   |  2 --
 include/configs/devkit8000.h                 |  2 --
 include/configs/dra7xx_evm.h                 |  2 --
 include/configs/etamin.h                     |  5 ----
 include/configs/ipam390.h                    |  2 --
 include/configs/ls2080a_simu.h               |  2 --
 include/configs/ls2080aqds.h                 |  2 --
 include/configs/ls2080ardb.h                 |  2 --
 include/configs/mcx.h                        |  2 --
 include/configs/omap3_beagle.h               |  2 --
 include/configs/omap3_cairo.h                |  2 --
 include/configs/omap3_evm.h                  |  2 --
 include/configs/omap3_igep00x0.h             |  2 --
 include/configs/omap3_logic.h                |  4 ----
 include/configs/omap3_overo.h                |  3 ---
 include/configs/omapl138_lcdk.h              |  2 --
 include/configs/pengwyn.h                    |  3 ---
 include/configs/siemens-am33x-common.h       |  3 ---
 include/configs/smartweb.h                   |  2 --
 include/configs/sunxi-common.h               |  1 -
 include/configs/tam3517-common.h             |  2 --
 include/configs/tao3530.h                    |  2 --
 include/configs/taurus.h                     |  2 --
 include/configs/ti816x_evm.h                 |  2 --
 include/configs/tricorder.h                  |  4 ----
 scripts/config_whitelist.txt                 |  5 ----
 137 files changed, 188 insertions(+), 112 deletions(-)

diff --git a/README b/README
index fc40ddf..777dd28 100644
--- a/README
+++ b/README
@@ -2812,10 +2812,6 @@ FIT uImage format:
 		CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
 		CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
 		CONFIG_SYS_NAND_ECCPOS, CONFIG_SYS_NAND_ECCSIZE,
-		CONFIG_SYS_NAND_ECCBYTES
-		Defines the size and behavior of the NAND that SPL uses
-		to read U-Boot
-
 		CONFIG_SPL_NAND_BOOT
 		Add support NAND boot
 
diff --git a/arch/arm/include/asm/arch-lpc32xx/config.h b/arch/arm/include/asm/arch-lpc32xx/config.h
index 3b7f6bd..5fa0c3a 100644
--- a/arch/arm/include/asm/arch-lpc32xx/config.h
+++ b/arch/arm/include/asm/arch-lpc32xx/config.h
@@ -62,8 +62,6 @@
 #error "CONFIG_SYS_NAND_PAGE_SIZE set to an invalid value"
 #endif
 
-#define CONFIG_SYS_NAND_ECCSIZE		0x100
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 						CONFIG_SYS_NAND_PAGE_SIZE)
 #endif	/* CONFIG_NAND_LPC32XX_SLC */
diff --git a/configs/B4420QDS_NAND_defconfig b/configs/B4420QDS_NAND_defconfig
index 01af4aa..277f631 100644
--- a/configs/B4420QDS_NAND_defconfig
+++ b/configs/B4420QDS_NAND_defconfig
@@ -32,6 +32,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4420QDS_SPIFLASH_defconfig b/configs/B4420QDS_SPIFLASH_defconfig
index b6583d2..c19157f 100644
--- a/configs/B4420QDS_SPIFLASH_defconfig
+++ b/configs/B4420QDS_SPIFLASH_defconfig
@@ -23,6 +23,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4420QDS_defconfig b/configs/B4420QDS_defconfig
index 95f4fb2..7c3cd42 100644
--- a/configs/B4420QDS_defconfig
+++ b/configs/B4420QDS_defconfig
@@ -22,6 +22,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4860QDS_NAND_defconfig b/configs/B4860QDS_NAND_defconfig
index be0011e..310dd24 100644
--- a/configs/B4860QDS_NAND_defconfig
+++ b/configs/B4860QDS_NAND_defconfig
@@ -32,6 +32,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4860QDS_SECURE_BOOT_defconfig b/configs/B4860QDS_SECURE_BOOT_defconfig
index ddf26db..a2db391 100644
--- a/configs/B4860QDS_SECURE_BOOT_defconfig
+++ b/configs/B4860QDS_SECURE_BOOT_defconfig
@@ -23,6 +23,8 @@ CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4860QDS_SPIFLASH_defconfig b/configs/B4860QDS_SPIFLASH_defconfig
index 3eb9b3a..c99a59d 100644
--- a/configs/B4860QDS_SPIFLASH_defconfig
+++ b/configs/B4860QDS_SPIFLASH_defconfig
@@ -23,6 +23,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4860QDS_SRIO_PCIE_BOOT_defconfig b/configs/B4860QDS_SRIO_PCIE_BOOT_defconfig
index 600e055..5e6757d 100644
--- a/configs/B4860QDS_SRIO_PCIE_BOOT_defconfig
+++ b/configs/B4860QDS_SRIO_PCIE_BOOT_defconfig
@@ -24,6 +24,8 @@ CONFIG_ENV_IS_IN_REMOTE=y
 CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/B4860QDS_defconfig b/configs/B4860QDS_defconfig
index 995808f..a47eca2 100644
--- a/configs/B4860QDS_defconfig
+++ b/configs/B4860QDS_defconfig
@@ -22,6 +22,8 @@ CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index 3a748fc..bc5c42d 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -22,6 +22,7 @@ CONFIG_ENV_UBI_VOLUME="uboot-env"
 # CONFIG_MMC is not set
 CONFIG_NAND=y
 CONFIG_NAND_SUNXI=y
+CONFIG_SYS_NAND_MAX_ECCPOS=1664
 CONFIG_AXP_ALDO3_VOLT=3300
 CONFIG_AXP_ALDO4_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/MPC8572DS_36BIT_defconfig b/configs/MPC8572DS_36BIT_defconfig
index b4ab061..00d7b93 100644
--- a/configs/MPC8572DS_36BIT_defconfig
+++ b/configs/MPC8572DS_36BIT_defconfig
@@ -22,6 +22,8 @@ CONFIG_SYS_FSL_DDR2=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
 CONFIG_PHY_GIGE=y
diff --git a/configs/MPC8572DS_defconfig b/configs/MPC8572DS_defconfig
index cf70a5f..9d8fc14 100644
--- a/configs/MPC8572DS_defconfig
+++ b/configs/MPC8572DS_defconfig
@@ -21,6 +21,8 @@ CONFIG_SYS_FSL_DDR2=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
 CONFIG_PHY_GIGE=y
diff --git a/configs/P1022DS_36BIT_NAND_defconfig b/configs/P1022DS_36BIT_NAND_defconfig
index 7cd4ebb..d9775db 100644
--- a/configs/P1022DS_36BIT_NAND_defconfig
+++ b/configs/P1022DS_36BIT_NAND_defconfig
@@ -36,6 +36,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_36BIT_SDCARD_defconfig b/configs/P1022DS_36BIT_SDCARD_defconfig
index 89fadb5..13b5423 100644
--- a/configs/P1022DS_36BIT_SDCARD_defconfig
+++ b/configs/P1022DS_36BIT_SDCARD_defconfig
@@ -34,6 +34,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_36BIT_SPIFLASH_defconfig b/configs/P1022DS_36BIT_SPIFLASH_defconfig
index 71d1d2e..609d607 100644
--- a/configs/P1022DS_36BIT_SPIFLASH_defconfig
+++ b/configs/P1022DS_36BIT_SPIFLASH_defconfig
@@ -35,6 +35,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_36BIT_defconfig b/configs/P1022DS_36BIT_defconfig
index 1f0d3ed..537aa64 100644
--- a/configs/P1022DS_36BIT_defconfig
+++ b/configs/P1022DS_36BIT_defconfig
@@ -25,6 +25,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_NAND_defconfig b/configs/P1022DS_NAND_defconfig
index 27cf431..e00a98c 100644
--- a/configs/P1022DS_NAND_defconfig
+++ b/configs/P1022DS_NAND_defconfig
@@ -35,6 +35,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_SDCARD_defconfig b/configs/P1022DS_SDCARD_defconfig
index 496ca01..389c652 100644
--- a/configs/P1022DS_SDCARD_defconfig
+++ b/configs/P1022DS_SDCARD_defconfig
@@ -33,6 +33,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_SPIFLASH_defconfig b/configs/P1022DS_SPIFLASH_defconfig
index 02bcce9..cf323d3 100644
--- a/configs/P1022DS_SPIFLASH_defconfig
+++ b/configs/P1022DS_SPIFLASH_defconfig
@@ -34,6 +34,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/P1022DS_defconfig b/configs/P1022DS_defconfig
index dc65490..73a72e1 100644
--- a/configs/P1022DS_defconfig
+++ b/configs/P1022DS_defconfig
@@ -24,6 +24,8 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=5
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4160QDS_NAND_defconfig b/configs/T4160QDS_NAND_defconfig
index 9b49c3d..741a259 100644
--- a/configs/T4160QDS_NAND_defconfig
+++ b/configs/T4160QDS_NAND_defconfig
@@ -31,6 +31,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4160QDS_SDCARD_defconfig b/configs/T4160QDS_SDCARD_defconfig
index 05dfed9..37d54a7 100644
--- a/configs/T4160QDS_SDCARD_defconfig
+++ b/configs/T4160QDS_SDCARD_defconfig
@@ -31,6 +31,8 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4160QDS_SECURE_BOOT_defconfig b/configs/T4160QDS_SECURE_BOOT_defconfig
index 40ddf34..56d8c12 100644
--- a/configs/T4160QDS_SECURE_BOOT_defconfig
+++ b/configs/T4160QDS_SECURE_BOOT_defconfig
@@ -22,6 +22,8 @@ CONFIG_CMD_FAT=y
 CONFIG_DM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4160QDS_defconfig b/configs/T4160QDS_defconfig
index 91cca13..45c341a 100644
--- a/configs/T4160QDS_defconfig
+++ b/configs/T4160QDS_defconfig
@@ -21,6 +21,8 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4160RDB_defconfig b/configs/T4160RDB_defconfig
index e1fa021..b8bbe12 100644
--- a/configs/T4160RDB_defconfig
+++ b/configs/T4160RDB_defconfig
@@ -21,6 +21,8 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240QDS_NAND_defconfig b/configs/T4240QDS_NAND_defconfig
index 8552b81..0e9e828 100644
--- a/configs/T4240QDS_NAND_defconfig
+++ b/configs/T4240QDS_NAND_defconfig
@@ -31,6 +31,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240QDS_SDCARD_defconfig b/configs/T4240QDS_SDCARD_defconfig
index 683a85d..6d2e126 100644
--- a/configs/T4240QDS_SDCARD_defconfig
+++ b/configs/T4240QDS_SDCARD_defconfig
@@ -31,6 +31,8 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240QDS_SECURE_BOOT_defconfig b/configs/T4240QDS_SECURE_BOOT_defconfig
index e9c7e63..b1565ce 100644
--- a/configs/T4240QDS_SECURE_BOOT_defconfig
+++ b/configs/T4240QDS_SECURE_BOOT_defconfig
@@ -22,6 +22,8 @@ CONFIG_CMD_FAT=y
 CONFIG_DM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240QDS_SRIO_PCIE_BOOT_defconfig b/configs/T4240QDS_SRIO_PCIE_BOOT_defconfig
index 8d756a4..cd37965 100644
--- a/configs/T4240QDS_SRIO_PCIE_BOOT_defconfig
+++ b/configs/T4240QDS_SRIO_PCIE_BOOT_defconfig
@@ -23,6 +23,8 @@ CONFIG_CMD_FAT=y
 CONFIG_ENV_IS_IN_REMOTE=y
 CONFIG_FSL_CAAM=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240QDS_defconfig b/configs/T4240QDS_defconfig
index e46933c..6536258 100644
--- a/configs/T4240QDS_defconfig
+++ b/configs/T4240QDS_defconfig
@@ -21,6 +21,8 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240RDB_SDCARD_defconfig b/configs/T4240RDB_SDCARD_defconfig
index 6d693de..af1e626 100644
--- a/configs/T4240RDB_SDCARD_defconfig
+++ b/configs/T4240RDB_SDCARD_defconfig
@@ -31,6 +31,8 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/T4240RDB_defconfig b/configs/T4240RDB_defconfig
index 0e03fcc..4b464a1 100644
--- a/configs/T4240RDB_defconfig
+++ b/configs/T4240RDB_defconfig
@@ -21,6 +21,8 @@ CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index eb8338f..3d4945c 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -51,6 +51,7 @@ CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 00c1af4..74060b1 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -34,6 +34,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHYLIB=y
diff --git a/configs/am335x_evm_nor_defconfig b/configs/am335x_evm_nor_defconfig
index 9f08edf..21c89c8 100644
--- a/configs/am335x_evm_nor_defconfig
+++ b/configs/am335x_evm_nor_defconfig
@@ -27,6 +27,7 @@ CONFIG_DFU_RAM=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHYLIB=y
diff --git a/configs/am335x_evm_usbspl_defconfig b/configs/am335x_evm_usbspl_defconfig
index 7c35138..5b0c284 100644
--- a/configs/am335x_evm_usbspl_defconfig
+++ b/configs/am335x_evm_usbspl_defconfig
@@ -31,6 +31,7 @@ CONFIG_DFU_NAND=y
 CONFIG_DFU_RAM=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHYLIB=y
diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig
index acdd56b..e8d2c33 100644
--- a/configs/am335x_hs_evm_defconfig
+++ b/configs/am335x_hs_evm_defconfig
@@ -38,6 +38,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHYLIB=y
diff --git a/configs/am335x_igep003x_defconfig b/configs/am335x_igep003x_defconfig
index 1b03c33..98e4fdd 100644
--- a/configs/am335x_igep003x_defconfig
+++ b/configs/am335x_igep003x_defconfig
@@ -53,6 +53,7 @@ CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_UBI=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/am3517_crane_defconfig b/configs/am3517_crane_defconfig
index fd5993e..c5dea41 100644
--- a/configs/am3517_crane_defconfig
+++ b/configs/am3517_crane_defconfig
@@ -27,6 +27,7 @@ CONFIG_CMD_JFFS2=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
index 27ea7a4..3d43782 100644
--- a/configs/am3517_evm_defconfig
+++ b/configs/am3517_evm_defconfig
@@ -37,6 +37,9 @@ CONFIG_SPL_PARTITION_UUIDS=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=13
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_HOST=y
diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig
index 15c25d3..6154d33 100644
--- a/configs/am43xx_evm_defconfig
+++ b/configs/am43xx_evm_defconfig
@@ -34,6 +34,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHYLIB=y
diff --git a/configs/am43xx_evm_ethboot_defconfig b/configs/am43xx_evm_ethboot_defconfig
index 6c17088..62f8a54 100644
--- a/configs/am43xx_evm_ethboot_defconfig
+++ b/configs/am43xx_evm_ethboot_defconfig
@@ -47,6 +47,7 @@ CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHYLIB=y
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig b/configs/am43xx_evm_usbhost_boot_defconfig
index 0bed335..37c9894 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -57,6 +57,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHYLIB=y
diff --git a/configs/am43xx_hs_evm_defconfig b/configs/am43xx_hs_evm_defconfig
index a4d23e1..5da205b 100644
--- a/configs/am43xx_hs_evm_defconfig
+++ b/configs/am43xx_hs_evm_defconfig
@@ -45,6 +45,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_PHYLIB=y
diff --git a/configs/at91sam9m10g45ek_nandflash_defconfig b/configs/at91sam9m10g45ek_nandflash_defconfig
index e131ef9..78fbbcc 100644
--- a/configs/at91sam9m10g45ek_nandflash_defconfig
+++ b/configs/at91sam9m10g45ek_nandflash_defconfig
@@ -38,6 +38,8 @@ CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_DM_ETH=y
 CONFIG_MACB=y
 CONFIG_PINCTRL=y
diff --git a/configs/axm_defconfig b/configs/axm_defconfig
index 248be12..9ddbe1d 100644
--- a/configs/axm_defconfig
+++ b/configs/axm_defconfig
@@ -38,6 +38,8 @@ CONFIG_OF_EMBED=y
 CONFIG_ENV_IS_IN_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
diff --git a/configs/brppt1_nand_defconfig b/configs/brppt1_nand_defconfig
index f814f2b..7445a23 100644
--- a/configs/brppt1_nand_defconfig
+++ b/configs/brppt1_nand_defconfig
@@ -53,6 +53,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_NETCONSOLE=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
diff --git a/configs/cairo_defconfig b/configs/cairo_defconfig
index 2a1b0f9..c5f18ea 100644
--- a/configs/cairo_defconfig
+++ b/configs/cairo_defconfig
@@ -40,6 +40,7 @@ CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_FAT_WRITE=y
diff --git a/configs/chiliboard_defconfig b/configs/chiliboard_defconfig
index ea729b0..d90e0cc 100644
--- a/configs/chiliboard_defconfig
+++ b/configs/chiliboard_defconfig
@@ -41,6 +41,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
diff --git a/configs/cm_t335_defconfig b/configs/cm_t335_defconfig
index d0a9f69..a872c22 100644
--- a/configs/cm_t335_defconfig
+++ b/configs/cm_t335_defconfig
@@ -54,6 +54,7 @@ CONFIG_LED_STATUS_BOOT_ENABLE=y
 CONFIG_LED_STATUS_BOOT=0
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_FAT_WRITE=y
diff --git a/configs/cm_t35_defconfig b/configs/cm_t35_defconfig
index b203752..7f6bdc8 100644
--- a/configs/cm_t35_defconfig
+++ b/configs/cm_t35_defconfig
@@ -40,6 +40,7 @@ CONFIG_LED_STATUS_BOOT_ENABLE=y
 CONFIG_LED_STATUS_BOOT=0
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
diff --git a/configs/cm_t43_defconfig b/configs/cm_t43_defconfig
index 27d9063..e874ad5 100644
--- a/configs/cm_t43_defconfig
+++ b/configs/cm_t43_defconfig
@@ -55,6 +55,7 @@ CONFIG_DM=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_ATMEL=y
diff --git a/configs/corvus_defconfig b/configs/corvus_defconfig
index 8650e4d..a483965 100644
--- a/configs/corvus_defconfig
+++ b/configs/corvus_defconfig
@@ -43,6 +43,8 @@ CONFIG_AT91_UTMI=y
 CONFIG_DFU_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_PHYLIB=y
 # CONFIG_SPL_DM_SERIAL is not set
 CONFIG_ATMEL_USART=y
diff --git a/configs/devkit3250_defconfig b/configs/devkit3250_defconfig
index c2c9e30..8b1dc7a 100644
--- a/configs/devkit3250_defconfig
+++ b/configs/devkit3250_defconfig
@@ -33,6 +33,8 @@ CONFIG_DM_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_PHYLIB=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
diff --git a/configs/devkit8000_defconfig b/configs/devkit8000_defconfig
index 8f3888a..0d8b7b4 100644
--- a/configs/devkit8000_defconfig
+++ b/configs/devkit8000_defconfig
@@ -32,5 +32,6 @@ CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/draco_defconfig b/configs/draco_defconfig
index f5a2c1b..3fa2823 100644
--- a/configs/draco_defconfig
+++ b/configs/draco_defconfig
@@ -54,6 +54,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/eco5pk_defconfig b/configs/eco5pk_defconfig
index ed32930..f8ebe6f 100644
--- a/configs/eco5pk_defconfig
+++ b/configs/eco5pk_defconfig
@@ -26,6 +26,8 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig
index 148d421..ae23437 100644
--- a/configs/etamin_defconfig
+++ b/configs/etamin_defconfig
@@ -54,6 +54,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/igep0032_defconfig b/configs/igep0032_defconfig
index 6e3dcb0..d988290 100644
--- a/configs/igep0032_defconfig
+++ b/configs/igep0032_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_UBI=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_FAT_WRITE=y
diff --git a/configs/igep00x0_defconfig b/configs/igep00x0_defconfig
index c504e75..5465e2b 100644
--- a/configs/igep00x0_defconfig
+++ b/configs/igep00x0_defconfig
@@ -31,6 +31,7 @@ CONFIG_CMD_UBI=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
diff --git a/configs/ipam390_defconfig b/configs/ipam390_defconfig
index 8e8ebde..7d3d5dd 100644
--- a/configs/ipam390_defconfig
+++ b/configs/ipam390_defconfig
@@ -33,4 +33,5 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=10
 CONFIG_SYS_NS16550=y
diff --git a/configs/ls2080a_simu_defconfig b/configs/ls2080a_simu_defconfig
index dfdbd82..969a63b 100644
--- a/configs/ls2080a_simu_defconfig
+++ b/configs/ls2080a_simu_defconfig
@@ -32,6 +32,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SYS_NS16550=y
 CONFIG_OF_LIBFDT=y
 CONFIG_EFI_LOADER_BOUNCE_BUFFER=y
diff --git a/configs/ls2080aqds_SECURE_BOOT_defconfig b/configs/ls2080aqds_SECURE_BOOT_defconfig
index 902c14b..d263a7e 100644
--- a/configs/ls2080aqds_SECURE_BOOT_defconfig
+++ b/configs/ls2080aqds_SECURE_BOOT_defconfig
@@ -28,6 +28,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080aqds_defconfig b/configs/ls2080aqds_defconfig
index 8711eac..69d59d7 100644
--- a/configs/ls2080aqds_defconfig
+++ b/configs/ls2080aqds_defconfig
@@ -29,6 +29,8 @@ CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig
index e6f1e53..d889d27 100644
--- a/configs/ls2080aqds_nand_defconfig
+++ b/configs/ls2080aqds_nand_defconfig
@@ -39,6 +39,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080aqds_qspi_defconfig b/configs/ls2080aqds_qspi_defconfig
index 908e54e..db9ff29 100644
--- a/configs/ls2080aqds_qspi_defconfig
+++ b/configs/ls2080aqds_qspi_defconfig
@@ -30,6 +30,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080aqds_sdcard_defconfig b/configs/ls2080aqds_sdcard_defconfig
index 4e75b33..b644d05 100644
--- a/configs/ls2080aqds_sdcard_defconfig
+++ b/configs/ls2080aqds_sdcard_defconfig
@@ -37,6 +37,8 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080ardb_SECURE_BOOT_defconfig b/configs/ls2080ardb_SECURE_BOOT_defconfig
index e372ca7..4ec124a 100644
--- a/configs/ls2080ardb_SECURE_BOOT_defconfig
+++ b/configs/ls2080ardb_SECURE_BOOT_defconfig
@@ -27,6 +27,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080ardb_defconfig b/configs/ls2080ardb_defconfig
index feeb71e..a062d62 100644
--- a/configs/ls2080ardb_defconfig
+++ b/configs/ls2080ardb_defconfig
@@ -28,6 +28,8 @@ CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_DM_SPI_FLASH=y
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig
index 4545152..095b0f4 100644
--- a/configs/ls2080ardb_nand_defconfig
+++ b/configs/ls2080ardb_nand_defconfig
@@ -36,6 +36,8 @@ CONFIG_DM=y
 CONFIG_FSL_CAAM=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_MAX_ECCPOS=256
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_PHYLIB=y
 CONFIG_NETDEVICES=y
 CONFIG_PHY_GIGE=y
diff --git a/configs/mcx_defconfig b/configs/mcx_defconfig
index daea7c4..ac65e9d 100644
--- a/configs/mcx_defconfig
+++ b/configs/mcx_defconfig
@@ -35,6 +35,8 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/mt_ventoux_defconfig b/configs/mt_ventoux_defconfig
index 09580e7..1b4d328 100644
--- a/configs/mt_ventoux_defconfig
+++ b/configs/mt_ventoux_defconfig
@@ -32,6 +32,8 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index 091979e..db43115 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -41,6 +41,7 @@ CONFIG_LED_STATUS_GREEN=2
 CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index a64151d..51e3f95 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -46,6 +46,7 @@ CONFIG_DM_GPIO=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
diff --git a/configs/omap3_ha_defconfig b/configs/omap3_ha_defconfig
index 4629c04..b02dda5 100644
--- a/configs/omap3_ha_defconfig
+++ b/configs/omap3_ha_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 8d0a4d4..7009706 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -38,6 +38,9 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=13
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000
 CONFIG_SYS_NS16550=y
diff --git a/configs/omap3_overo_defconfig b/configs/omap3_overo_defconfig
index 5d1cbe9..25ca43b 100644
--- a/configs/omap3_overo_defconfig
+++ b/configs/omap3_overo_defconfig
@@ -44,6 +44,8 @@ CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=13
+CONFIG_SYS_NAND_MAX_ECCPOS=56
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
diff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig
index c95134b..4cb724a 100644
--- a/configs/omapl138_lcdk_defconfig
+++ b/configs/omapl138_lcdk_defconfig
@@ -28,6 +28,7 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=10
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x28000
 CONFIG_SPI_FLASH=y
diff --git a/configs/pengwyn_defconfig b/configs/pengwyn_defconfig
index 569f12c..e1e766e 100644
--- a/configs/pengwyn_defconfig
+++ b/configs/pengwyn_defconfig
@@ -56,6 +56,8 @@ CONFIG_EFI_PARTITION=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=26
+CONFIG_SYS_NAND_ECCSTEPS=8
 CONFIG_PHYLIB=y
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
index 38370ee..3635b6a 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -58,6 +58,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
index 5acfe22..f997f6d 100644
--- a/configs/rastaban_defconfig
+++ b/configs/rastaban_defconfig
@@ -54,6 +54,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/rut_defconfig b/configs/rut_defconfig
index 6ec8ff3..17bec37 100644
--- a/configs/rut_defconfig
+++ b/configs/rut_defconfig
@@ -59,6 +59,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index e7eaad0..8ad304b 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -43,6 +43,8 @@ CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_PHYLIB=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
diff --git a/configs/tao3530_defconfig b/configs/tao3530_defconfig
index 92ce6f3..ec401df 100644
--- a/configs/tao3530_defconfig
+++ b/configs/tao3530_defconfig
@@ -26,6 +26,7 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
index dc884e6..7f86307 100644
--- a/configs/taurus_defconfig
+++ b/configs/taurus_defconfig
@@ -48,6 +48,8 @@ CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig
index c30e924..1f5c6d9 100644
--- a/configs/thuban_defconfig
+++ b/configs/thuban_defconfig
@@ -54,6 +54,8 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DFU_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
+CONFIG_SYS_NAND_ECCSTEPS=4
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_MTD_UBI_FASTMAP=y
diff --git a/configs/ti816x_evm_defconfig b/configs/ti816x_evm_defconfig
index 4341d8d..699eda4 100644
--- a/configs/ti816x_evm_defconfig
+++ b/configs/ti816x_evm_defconfig
@@ -43,6 +43,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=14
 CONFIG_SYS_NS16550=y
 CONFIG_OMAP3_SPI=y
 # CONFIG_USE_PRIVATE_LIBGCC is not set
diff --git a/configs/tricorder_defconfig b/configs/tricorder_defconfig
index 63eeb00..6acc041 100644
--- a/configs/tricorder_defconfig
+++ b/configs/tricorder_defconfig
@@ -36,6 +36,9 @@ CONFIG_LED_STATUS_STATE2=2
 CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=13
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SYS_NS16550=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/tricorder_flash_defconfig b/configs/tricorder_flash_defconfig
index fd9e0e8..af045d5 100644
--- a/configs/tricorder_flash_defconfig
+++ b/configs/tricorder_flash_defconfig
@@ -35,6 +35,9 @@ CONFIG_LED_STATUS_STATE2=2
 CONFIG_LED_STATUS_CMD=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCBYTES=13
+CONFIG_SYS_NAND_MAX_ECCPOS=56
+CONFIG_SYS_NAND_MAX_OOBFREE=2
 CONFIG_SYS_NS16550=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/twister_defconfig b/configs/twister_defconfig
index 7bbf781..f4169dc 100644
--- a/configs/twister_defconfig
+++ b/configs/twister_defconfig
@@ -31,6 +31,8 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
+CONFIG_SYS_NAND_ECCSIZE=256
+CONFIG_SYS_NAND_ECCBYTES=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 85b26d6..61d1ca6 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -130,6 +130,40 @@ config NAND_ZYNQ
 
 comment "Generic NAND options"
 
+config SYS_NAND_ECCSIZE
+	int "NAND ECC Size"
+	default 512
+	help
+	  Defines the size and behavior of the NAND that SPL uses to read U-Boot
+
+config SYS_NAND_ECCBYTES
+	int "NAND ECC Bytes"
+	default 0
+	help
+	  Defines the size and behavior of the NAND that SPL uses to read U-Boot
+
+config SYS_NAND_ECCSTEPS
+	int "NAND ECC Steps"
+	default 0
+	help
+	  Defines the size and behavior of the NAND that SPL uses to read U-Boot
+
+config SYS_NAND_MAX_ECCPOS
+	int "Max number of ECC bytes"
+	default 0
+	help
+	  If specified, overrides the maximum number of ECC bytes
+	  supported.  Useful for reducing image size, especially with SPL.
+	  This must be at least 48 if nand_base.c is used.
+
+config SYS_NAND_MAX_OOBFREE
+	int "Max number of free OOB regions"
+	default 0
+	help
+	  If specified, overrides the maximum number of free OOB regions
+	  supported.  Useful for reducing image size, especially with SPL.
+	  This must be at least 2 if nand_base.c is used.
+	  	  
 # Enhance depends when converting drivers to Kconfig which use this config
 # option (mxc_nand, ndfc, omap_gpmc).
 config SYS_NAND_BUSWIDTH_16BIT
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index f2313a5..be5794f 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -312,8 +312,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* NAND Flash on IFC */
 #define CONFIG_NAND_FSL_IFC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
 #define CONFIG_SYS_NAND_BASE		0xff800000
 #ifdef CONFIG_PHYS_64BIT
 #define CONFIG_SYS_NAND_BASE_PHYS	(0xf00000000ull | CONFIG_SYS_NAND_BASE)
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 218d212..94d2ab5 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -287,8 +287,6 @@
 #define CONFIG_SYS_MAX_NAND_DEVICE    4
 #define CONFIG_NAND_FSL_ELBC	1
 #define CONFIG_SYS_NAND_BLOCK_SIZE    (128 * 1024)
-#define CONFIG_SYS_NAND_MAX_OOBFREE	5
-#define CONFIG_SYS_NAND_MAX_ECCPOS	56
 
 /* NAND boot: 4K NAND loader config */
 #define CONFIG_SYS_NAND_SPL_SIZE	0x1000
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 8c83f2d..be2c4e4 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -52,8 +52,6 @@
 #endif
 
 #define CONFIG_NAND_FSL_ELBC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	56
-#define CONFIG_SYS_NAND_MAX_OOBFREE	5
 
 #ifdef CONFIG_NAND
 #ifdef CONFIG_TPL_BUILD
diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
index 885dc77..ae3c3fc 100644
--- a/include/configs/T4240QDS.h
+++ b/include/configs/T4240QDS.h
@@ -260,8 +260,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 
 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
 
 #if defined(CONFIG_NAND)
 #define CONFIG_SYS_CSPR0_EXT		CONFIG_SYS_NAND_CSPR_EXT
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index fee8b8f..ab30c70 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -406,8 +406,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* NAND Flash on IFC */
 #define CONFIG_NAND_FSL_IFC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
 #define CONFIG_SYS_NAND_BASE		0xff800000
 #define CONFIG_SYS_NAND_BASE_PHYS	(0xf00000000ull | CONFIG_SYS_NAND_BASE)
 
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 415ce46..a320980 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -214,8 +214,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define MTDIDS_DEFAULT			"nand0=nand.0"
diff --git a/include/configs/am335x_igep003x.h b/include/configs/am335x_igep003x.h
index 9b14603..434c108 100644
--- a/include/configs/am335x_igep003x.h
+++ b/include/configs/am335x_igep003x.h
@@ -159,8 +159,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 
 #endif	/* ! __CONFIG_IGEP003X_H */
diff --git a/include/configs/am3517_crane.h b/include/configs/am3517_crane.h
index 9bd1606..0d40ff3 100644
--- a/include/configs/am3517_crane.h
+++ b/include/configs/am3517_crane.h
@@ -267,8 +267,6 @@
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
 						10, 11, 12, 13}
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h
index e7ef3dd..7c9800b 100644
--- a/include/configs/am3517_evm.h
+++ b/include/configs/am3517_evm.h
@@ -126,11 +126,7 @@
 					 40, 41, 42, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56 }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	13
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
-#define CONFIG_SYS_NAND_MAX_ECCPOS	56
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 #define CONFIG_MTD_PARTITIONS		/* required for UBI partition support */
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index b84f6e3..548bc39 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -283,8 +283,6 @@
 			190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
 			200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \
 			}
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	26
 #define MTDIDS_DEFAULT			"nand0=nand.0"
 #define MTDPARTS_DEFAULT		"mtdparts=nand.0:" \
 					"256k(NAND.SPL)," \
diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h
index 2ce58e1..0fa6c65 100644
--- a/include/configs/at91sam9m10g45ek.h
+++ b/include/configs/at91sam9m10g45ek.h
@@ -142,8 +142,6 @@
 #define CONFIG_SYS_NAND_BLOCK_SIZE	0x20000
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_ECCPOS		{ 40, 41, 42, 43, 44, 45, 46, 47, \
 					  48, 49, 50, 51, 52, 53, 54, 55, \
diff --git a/include/configs/baltos.h b/include/configs/baltos.h
index 185c749..2eeca67 100644
--- a/include/configs/baltos.h
+++ b/include/configs/baltos.h
@@ -260,8 +260,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/bav335x.h b/include/configs/bav335x.h
index 062c99c..7de01e9 100644
--- a/include/configs/bav335x.h
+++ b/include/configs/bav335x.h
@@ -367,8 +367,6 @@ DEFAULT_LINUX_BOOT_ENV \
 	42, 43, 44, 45, 46, 47, 48, 49, \
 	50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define MTDIDS_DEFAULT			"nand0=nand.0"
diff --git a/include/configs/brppt1.h b/include/configs/brppt1.h
index 07a173f..6667af1 100644
--- a/include/configs/brppt1.h
+++ b/include/configs/brppt1.h
@@ -203,9 +203,6 @@ MMCARGS
 					42, 43, 44, 45, 46, 47, 48, 49, \
 					50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
-
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 
diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h
index b7887d9..04793c4 100644
--- a/include/configs/chiliboard.h
+++ b/include/configs/chiliboard.h
@@ -147,8 +147,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define MTDIDS_DEFAULT			"nand0=8000000.nand"
diff --git a/include/configs/cm_t335.h b/include/configs/cm_t335.h
index 2287d5b..d9f2b96 100644
--- a/include/configs/cm_t335.h
+++ b/include/configs/cm_t335.h
@@ -117,9 +117,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
-
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 
 #undef CONFIG_SYS_NAND_U_BOOT_OFFS
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index e0f5765..05c2c75 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -272,8 +272,6 @@
  */
 #define CONFIG_SYS_NAND_ECCPOS		{ 1, 2, 3, 4, 5, 6, 7, 8, 9, \
 					 10, 11, 12 }
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/cm_t43.h b/include/configs/cm_t43.h
index bbc455a..7af78d7 100644
--- a/include/configs/cm_t43.h
+++ b/include/configs/cm_t43.h
@@ -32,8 +32,6 @@
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
diff --git a/include/configs/corvus.h b/include/configs/corvus.h
index e47f06b..e3c62dd 100644
--- a/include/configs/corvus.h
+++ b/include/configs/corvus.h
@@ -145,8 +145,6 @@
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_ECCPOS		{ 40, 41, 42, 43, 44, 45, 46, 47, \
 					  48, 49, 50, 51, 52, 53, 54, 55, \
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index 0736b39..052ff27 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -194,8 +194,6 @@
 				59, 60, 61, 62, 63 }
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	10
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h
index 2bf0983..ab5bcd6 100644
--- a/include/configs/devkit8000.h
+++ b/include/configs/devkit8000.h
@@ -198,8 +198,6 @@
 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
 						10, 11, 12, 13}
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index 6c0fc35..d0060e8 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -178,8 +178,6 @@
 					 34, 35, 36, 37, 38, 39, 40, 41, \
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define MTDIDS_DEFAULT			"nand0=nand.0"
 #define MTDPARTS_DEFAULT		"mtdparts=nand.0:" \
 					"128k(NAND.SPL)," \
diff --git a/include/configs/etamin.h b/include/configs/etamin.h
index c9584ad..40f9328 100644
--- a/include/configs/etamin.h
+++ b/include/configs/etamin.h
@@ -53,11 +53,6 @@
 			200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \
 			}
 
-#undef CONFIG_SYS_NAND_ECCSIZE
-#undef CONFIG_SYS_NAND_ECCBYTES
-#define CONFIG_SYS_NAND_ECCSIZE 512
-#define CONFIG_SYS_NAND_ECCBYTES 26
-
 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x200000
 
 #define CONFIG_SYS_NAND_MAX_CHIPS       1
diff --git a/include/configs/ipam390.h b/include/configs/ipam390.h
index d2fc81b..6f1f510 100644
--- a/include/configs/ipam390.h
+++ b/include/configs/ipam390.h
@@ -170,8 +170,6 @@
 			54, 55, 56, 57, 58,	59, 60, 61, 62, 63}
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	10
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
diff --git a/include/configs/ls2080a_simu.h b/include/configs/ls2080a_simu.h
index dad1090..728e4c0 100644
--- a/include/configs/ls2080a_simu.h
+++ b/include/configs/ls2080a_simu.h
@@ -73,8 +73,6 @@
 #endif
 
 #define CONFIG_NAND_FSL_IFC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
 
 #define CONFIG_SYS_NAND_CSPR_EXT	(0x0)
 #define CONFIG_SYS_NAND_CSPR	(CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
index dcd1b0c..1b98387 100644
--- a/include/configs/ls2080aqds.h
+++ b/include/configs/ls2080aqds.h
@@ -117,8 +117,6 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 #define CONFIG_NAND_FSL_IFC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
 
 #define CONFIG_SYS_NAND_CSPR_EXT	(0x0)
 #define CONFIG_SYS_NAND_CSPR	(CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 145b285..ffbeb28 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -126,8 +126,6 @@ unsigned long get_board_sys_clk(void);
 #endif
 
 #define CONFIG_NAND_FSL_IFC
-#define CONFIG_SYS_NAND_MAX_ECCPOS	256
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
 
 #define CONFIG_SYS_NAND_CSPR_EXT	(0x0)
 #define CONFIG_SYS_NAND_CSPR	(CSPR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index 7047e3f..32c1b17 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -308,8 +308,6 @@
 #define CONFIG_SYS_NAND_ECCPOS		{40, 41, 42, 43, 44, 45, 46, 47,\
 					 48, 49, 50, 51, 52, 53, 54, 55,\
 					 56, 57, 58, 59, 60, 61, 62, 63}
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_SW
 #define CONFIG_SPL_NAND_SOFTECC
 
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 26e2c8d..ea22b17 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -262,8 +262,6 @@
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
 						10, 11, 12, 13}
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 /* NAND: SPL falcon mode configs */
diff --git a/include/configs/omap3_cairo.h b/include/configs/omap3_cairo.h
index b4d7f17..98cfc66 100644
--- a/include/configs/omap3_cairo.h
+++ b/include/configs/omap3_cairo.h
@@ -187,8 +187,6 @@
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9,\
 						10, 11, 12, 13}
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
 /* NAND: SPL falcon mode configs */
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index dd7ea5c..f92593c 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -61,8 +61,6 @@
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
 #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9,\
                                          10, 11, 12, 13}
-#define CONFIG_SYS_NAND_ECCSIZE         512
-#define CONFIG_SYS_NAND_ECCBYTES        3
 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x80000
 #define CONFIG_ENV_IS_IN_NAND           1
diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
index 5118b93..5fa2a36 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -133,8 +133,6 @@
 					 34, 35, 36, 37, 38, 39, 40, 41, \
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_NAND_OMAP_GPMC
 
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index a4a40f4..3183d0f 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -85,11 +85,7 @@
 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
 					 52, 53, 54, 55, 56}
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	13
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
-#define CONFIG_SYS_NAND_MAX_ECCPOS	56
 #define CONFIG_MTD_DEVICE		/* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS		/* required for UBI partition support */
 #define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index d53657f..6b2203b 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -194,7 +194,6 @@
 
 /* NAND boot config */
 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
-#define CONFIG_SYS_NAND_MAX_ECCPOS  56
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
@@ -207,8 +206,6 @@
 					33, 34, 35, 36, 37, 38, 39, 40, 41, \
 					42, 44, 45, 46, 47, 48, 49, 50, 51, \
 					52, 53, 54, 55, 56}
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	13
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
index 0085559..8629db2 100644
--- a/include/configs/omapl138_lcdk.h
+++ b/include/configs/omapl138_lcdk.h
@@ -186,8 +186,6 @@
 				54, 55, 56, 57, 58, 59, 60, 61, 62, 63 }
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	10
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
diff --git a/include/configs/pengwyn.h b/include/configs/pengwyn.h
index 242a139..c7bd44c 100644
--- a/include/configs/pengwyn.h
+++ b/include/configs/pengwyn.h
@@ -138,9 +138,6 @@
 					  174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,\
 					  194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209}
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	26
-#define CONFIG_SYS_NAND_ECCSTEPS	8
 #define	CONFIG_SYS_NAND_ECCTOTAL	(CONFIG_SYS_NAND_ECCBYTES * \
 						CONFIG_SYS_NAND_ECCSTEPS)
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH16_CODE_HW
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index 4ea3a0b..092fdc6 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -139,11 +139,8 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 
-#define CONFIG_SYS_NAND_ECCSTEPS	4
 #define	CONFIG_SYS_NAND_ECCTOTAL	(CONFIG_SYS_NAND_ECCBYTES * \
 						CONFIG_SYS_NAND_ECCSTEPS)
 
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index fe24b3a..7b74479 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -239,8 +239,6 @@
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_ECCPOS		{ 40, 41, 42, 43, 44, 45, 46, 47, \
 					  48, 49, 50, 51, 52, 53, 54, 55, \
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 7a22ef6..1a2a2b1 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -130,7 +130,6 @@
 #define CONFIG_SERIAL_TAG
 
 #ifdef CONFIG_NAND_SUNXI
-#define CONFIG_SYS_NAND_MAX_ECCPOS 1664
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_SYS_MAX_NAND_DEVICE 8
 
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index 4336251..c98753f 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -204,8 +204,6 @@
 #define CONFIG_SYS_NAND_ECCPOS		{40, 41, 42, 43, 44, 45, 46, 47,\
 					 48, 49, 50, 51, 52, 53, 54, 55,\
 					 56, 57, 58, 59, 60, 61, 62, 63}
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_SW
 #define CONFIG_NAND_OMAP_GPMC_PREFETCH
 
diff --git a/include/configs/tao3530.h b/include/configs/tao3530.h
index 9f6e243..d370fb3 100644
--- a/include/configs/tao3530.h
+++ b/include/configs/tao3530.h
@@ -253,8 +253,6 @@
  */
 #define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8, 9, \
 					 10, 11, 12, 13 }
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index 55f47f8..5902e4d 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -188,8 +188,6 @@
 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
 					 CONFIG_SYS_NAND_PAGE_SIZE)
 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
-#define CONFIG_SYS_NAND_ECCSIZE		256
-#define CONFIG_SYS_NAND_ECCBYTES	3
 #define CONFIG_SYS_NAND_OOBSIZE		64
 #define CONFIG_SYS_NAND_ECCPOS		{ 40, 41, 42, 43, 44, 45, 46, 47, \
 					  48, 49, 50, 51, 52, 53, 54, 55, \
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index 1898a82..fcc44d4 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -88,8 +88,6 @@
 					 42, 43, 44, 45, 46, 47, 48, 49, \
 					 50, 51, 52, 53, 54, 55, 56, 57, }
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	14
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
 #define MTDIDS_DEFAULT			"nand0=nand.0"
diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h
index 3820096..ef7d436 100644
--- a/include/configs/tricorder.h
+++ b/include/configs/tricorder.h
@@ -92,8 +92,6 @@
 							/* CS0 */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
-#define CONFIG_SYS_NAND_MAX_OOBFREE	2
-#define CONFIG_SYS_NAND_MAX_ECCPOS	56
 
 /* needed for ubi */
 #define CONFIG_MTD_DEVICE       /* needed for mtdparts commands */
@@ -282,8 +280,6 @@
 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
 					 52, 53, 54, 55, 56}
 
-#define CONFIG_SYS_NAND_ECCSIZE		512
-#define CONFIG_SYS_NAND_ECCBYTES	13
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
 
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 84dc5c9..49e8fa9 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -3954,10 +3954,7 @@ CONFIG_SYS_NAND_DATA_BASE
 CONFIG_SYS_NAND_DBW_16
 CONFIG_SYS_NAND_DBW_8
 CONFIG_SYS_NAND_DDR_LAW
-CONFIG_SYS_NAND_ECCBYTES
 CONFIG_SYS_NAND_ECCPOS
-CONFIG_SYS_NAND_ECCSIZE
-CONFIG_SYS_NAND_ECCSTEPS
 CONFIG_SYS_NAND_ECCTOTAL
 CONFIG_SYS_NAND_ECC_BASE
 CONFIG_SYS_NAND_ENABLE_PIN
@@ -3974,8 +3971,6 @@ CONFIG_SYS_NAND_LBLAWBAR_PRELIM
 CONFIG_SYS_NAND_MASK_ALE
 CONFIG_SYS_NAND_MASK_CLE
 CONFIG_SYS_NAND_MAX_CHIPS
-CONFIG_SYS_NAND_MAX_ECCPOS
-CONFIG_SYS_NAND_MAX_OOBFREE
 CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
 CONFIG_SYS_NAND_NO_SUBPAGE
 CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
-- 
2.7.4



More information about the U-Boot mailing list