Skip to contentSkip to conversation

MTD defconfigs/Kconfigs/Makefiles heavy cleanup

PATCH Superseded Miquel Raynal 4 participants 67 messages Oct 3, 2019 – Dec 5, 2019 Page 2 of 2

Subsystems (17)
lore
Share & tools
lore
author maintainer
#13 lore raw

PATCH v5 7/26 mtd: ensure UBI is compiled when using fastmap

In reply to Miquel Raynal

UBI must be enabled when using fastmap, reflect this is defconfigs.

---
 configs/am335x_igep003x_defconfig     | 1 +
 configs/aristainetos2_defconfig       | 1 +
 configs/aristainetos2b_defconfig      | 1 +
 configs/aristainetos_defconfig        | 1 +
 configs/colibri-imx6ull_defconfig     | 1 +
 configs/colibri_imx7_defconfig        | 1 +
 configs/colibri_t20_defconfig         | 1 +
 configs/colibri_vf_defconfig          | 1 +
 configs/draco_defconfig               | 1 +
 configs/etamin_defconfig              | 1 +
 configs/harmony_defconfig             | 1 +
 configs/igep00x0_defconfig            | 1 +
 configs/pxm2_defconfig                | 1 +
 configs/rastaban_defconfig            | 1 +
 configs/rut_defconfig                 | 1 +
 configs/socfpga_vining_fpga_defconfig | 1 +
 configs/thuban_defconfig              | 1 +
 17 files changed, 17 insertions(+)
configs/am335x_igep003x_defconfig +1 -0
index f8d8eb640c..959e7dc5aa 100644
@@ -64,6 +64,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
configs/aristainetos2_defconfig +1 -0
index 9213915390..17ce35341f 100644
@@ -45,6 +45,7 @@ CONFIG_SF_DEFAULT_CS=1
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_PHYLIB=y
configs/aristainetos2b_defconfig +1 -0
index eda3baea0e..6143eb2264 100644
@@ -43,6 +43,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_PHYLIB=y
configs/aristainetos_defconfig +1 -0
index 39b0c38412..895a014069 100644
@@ -44,6 +44,7 @@ CONFIG_SF_DEFAULT_BUS=3
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_PHYLIB=y
configs/colibri-imx6ull_defconfig +1 -0
index 55db6c7ea5..2f7003cca0 100644
@@ -59,6 +59,7 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_MXS=y
 CONFIG_MTD_RAW_NAND_MXS_DT=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
configs/colibri_imx7_defconfig +1 -0
index 9a47eafddd..e873099b63 100644
@@ -57,6 +57,7 @@ CONFIG_DM_MTD=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS_DT=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
configs/colibri_t20_defconfig +1 -0
index ea51675003..aeb824b003 100644
@@ -42,6 +42,7 @@ CONFIG_SYS_I2C_TEGRA=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_DM_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
configs/colibri_vf_defconfig +1 -0
index c359d86bd9..f657ccf659 100644
@@ -64,6 +64,7 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
configs/draco_defconfig +1 -0
index 4e075776a4..ea317d043c 100644
@@ -68,6 +68,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_DRIVER_TI_CPSW=y
configs/etamin_defconfig +1 -0
index 479a1fbcc3..f9d888bae2 100644
@@ -69,6 +69,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_DRIVER_TI_CPSW=y
configs/harmony_defconfig +1 -0
index c7c8bc249c..70779b89cf 100644
@@ -30,6 +30,7 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra20-harmony"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
 CONFIG_DM_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
configs/igep00x0_defconfig +1 -0
index e1b7f673ca..8660b339a5 100644
@@ -53,6 +53,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x2C000000
configs/pxm2_defconfig +1 -0
index b170b5a355..d1cda87d71 100644
@@ -70,6 +70,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_MII=y
configs/rastaban_defconfig +1 -0
index bf2fd33bf8..98b77cd93f 100644
@@ -68,6 +68,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_DRIVER_TI_CPSW=y
configs/rut_defconfig +1 -0
index 735d856a65..c728318f18 100644
@@ -71,6 +71,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_MII=y
configs/socfpga_vining_fpga_defconfig +1 -0
index 627009d632..0c2c2a53b1 100644
@@ -72,6 +72,7 @@ CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
configs/thuban_defconfig +1 -0
index 94b010ca89..1ebab8c87c 100644
@@ -68,6 +68,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT=1
 CONFIG_DRIVER_TI_CPSW=y
Signature · 1 line
2.20.1
#14 lore raw

PATCH v5 7/26 mtd: ensure UBI is compiled when using fastmap

Quoted 4 lines · Miquel Raynal

UBI must be enabled when using fastmap, reflect this is defconfigs.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/caa350ab/attachment.sig>
author maintainer
#15 lore raw

PATCH v5 8/26 mtd: ensure MTD is compiled when UBI is used

In reply to Miquel Raynal

MTD must be enabled when UBI is used, this is mandatory and will later be reflected thanks to a "depends on" in Kconfig. But first, defconfigs need to be fixed.

---
 configs/gardena-smart-gateway-mt7688-ram_defconfig | 1 +
 configs/gardena-smart-gateway-mt7688_defconfig     | 1 +
 configs/harmony_defconfig                          | 1 +
 configs/mscc_ocelot_defconfig                      | 1 +
 4 files changed, 4 insertions(+)
configs/gardena-smart-gateway-mt7688-ram_defconfig +1 -0
index 281ad308e6..c362b407ea 100644
@@ -49,6 +49,7 @@ CONFIG_CLK=y
 CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
+CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_SPI_FLASH=y
configs/gardena-smart-gateway-mt7688_defconfig +1 -0
index d5792b63d8..5d3d7c9f04 100644
@@ -52,6 +52,7 @@ CONFIG_CLK=y
 CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
+CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_SPI_FLASH=y
configs/harmony_defconfig +1 -0
index 70779b89cf..441cbf9774 100644
@@ -29,6 +29,7 @@ CONFIG_OF_LIVE=y
 CONFIG_DEFAULT_DEVICE_TREE="tegra20-harmony"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
+CONFIG_MTD=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
configs/mscc_ocelot_defconfig +1 -0
index 18dd956b98..109d947934 100644
@@ -50,6 +50,7 @@ CONFIG_MSCC_SGPIO=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_DM_MTD=y
+CONFIG_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
Signature · 1 line
2.20.1
#16 lore raw

PATCH v5 8/26 mtd: ensure MTD is compiled when UBI is used

Quoted 6 lines · Miquel Raynal

MTD must be enabled when UBI is used, this is mandatory and will later be reflected thanks to a "depends on" in Kconfig. But first, defconfigs need to be fixed.

This is not applied. Upon full migration in the initial part of this series this patch is no longer required, so is dropped. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/a1380d15/attachment.sig>
author maintainer
#17 lore raw

PATCH v5 9/26 mtd: ensure UBI is compiled when CMD_UBI is selected

In reply to Miquel Raynal

UBI must be enabled when CMD_UBI is used, this is mandatory and will later be reflected thanks to a "depends on" in Kconfig. But first, defconfigs needs to be fixed.

---
 configs/am335x_baltos_defconfig                    | 1 +
 configs/am3517_evm_defconfig                       | 1 +
 configs/apf27_defconfig                            | 1 +
 configs/apx4devkit_defconfig                       | 1 +
 configs/at91sam9x5ek_dataflash_defconfig           | 1 +
 configs/at91sam9x5ek_mmc_defconfig                 | 1 +
 configs/at91sam9x5ek_nandflash_defconfig           | 1 +
 configs/at91sam9x5ek_spiflash_defconfig            | 1 +
 configs/bk4r1_defconfig                            | 1 +
 configs/dns325_defconfig                           | 1 +
 configs/dockstar_defconfig                         | 1 +
 configs/ds414_defconfig                            | 1 +
 configs/ethernut5_defconfig                        | 1 +
 configs/gardena-smart-gateway-mt7688-ram_defconfig | 1 +
 configs/gardena-smart-gateway-mt7688_defconfig     | 1 +
 configs/goflexhome_defconfig                       | 1 +
 configs/guruplug_defconfig                         | 1 +
 configs/gwventana_emmc_defconfig                   | 1 +
 configs/gwventana_gw5904_defconfig                 | 1 +
 configs/gwventana_nand_defconfig                   | 1 +
 configs/ib62x0_defconfig                           | 1 +
 configs/iconnect_defconfig                         | 1 +
 configs/imx6dl_icore_nand_defconfig                | 1 +
 configs/imx6q_icore_nand_defconfig                 | 1 +
 configs/imx6q_logic_defconfig                      | 2 ++
 configs/imx6qdl_icore_mmc_defconfig                | 1 +
 configs/imx6qdl_icore_nand_defconfig               | 1 +
 configs/imx6ul_geam_nand_defconfig                 | 1 +
 configs/imx6ul_isiot_nand_defconfig                | 1 +
 configs/k2e_evm_defconfig                          | 1 +
 configs/k2e_hs_evm_defconfig                       | 1 +
 configs/k2g_evm_defconfig                          | 1 +
 configs/k2g_hs_evm_defconfig                       | 1 +
 configs/k2hk_evm_defconfig                         | 1 +
 configs/k2hk_hs_evm_defconfig                      | 1 +
 configs/k2l_evm_defconfig                          | 1 +
 configs/k2l_hs_evm_defconfig                       | 1 +
 configs/km_kirkwood_128m16_defconfig               | 1 +
 configs/km_kirkwood_defconfig                      | 1 +
 configs/km_kirkwood_pci_defconfig                  | 1 +
 configs/kmcoge4_defconfig                          | 2 ++
 configs/kmcoge5ne_defconfig                        | 1 +
 configs/kmcoge5un_defconfig                        | 1 +
 configs/kmeter1_defconfig                          | 1 +
 configs/kmnusa_defconfig                           | 1 +
 configs/kmopti2_defconfig                          | 1 +
 configs/kmsugp1_defconfig                          | 1 +
 configs/kmsupx5_defconfig                          | 1 +
 configs/kmsuv31_defconfig                          | 1 +
 configs/kmtegr1_defconfig                          | 1 +
 configs/kmtepr2_defconfig                          | 1 +
 configs/m53menlo_defconfig                         | 1 +
 configs/mgcoge3un_defconfig                        | 1 +
 configs/mx28evk_auart_console_defconfig            | 1 +
 configs/mx28evk_defconfig                          | 1 +
 configs/mx28evk_nand_defconfig                     | 1 +
 configs/mx28evk_spi_defconfig                      | 1 +
 configs/nas220_defconfig                           | 1 +
 configs/nsa310s_defconfig                          | 1 +
 configs/omap35_logic_defconfig                     | 1 +
 configs/omap35_logic_somlv_defconfig               | 1 +
 configs/omap3_beagle_defconfig                     | 1 +
 configs/omap3_evm_defconfig                        | 1 +
 configs/omap3_ha_defconfig                         | 1 +
 configs/omap3_logic_defconfig                      | 1 +
 configs/omap3_logic_somlv_defconfig                | 1 +
 configs/omap3_overo_defconfig                      | 1 +
 configs/omap3_pandora_defconfig                    | 1 +
 configs/omapl138_lcdk_defconfig                    | 1 +
 configs/openrd_base_defconfig                      | 1 +
 configs/openrd_client_defconfig                    | 1 +
 configs/openrd_ultimate_defconfig                  | 1 +
 configs/pcm052_defconfig                           | 1 +
 configs/pcm058_defconfig                           | 1 +
 configs/pfla02_defconfig                           | 1 +
 configs/platinum_picon_defconfig                   | 1 +
 configs/platinum_titanium_defconfig                | 1 +
 configs/pogo_e02_defconfig                         | 1 +
 configs/sama5d3_xplained_mmc_defconfig             | 1 +
 configs/sama5d3_xplained_nandflash_defconfig       | 1 +
 configs/sheevaplug_defconfig                       | 1 +
 configs/socfpga_arria5_defconfig                   | 1 +
 configs/socfpga_cyclone5_defconfig                 | 1 +
 configs/socfpga_de0_nano_soc_defconfig             | 1 +
 configs/socfpga_is1_defconfig                      | 1 +
 configs/socfpga_sockit_defconfig                   | 1 +
 configs/socfpga_socrates_defconfig                 | 1 +
 configs/socfpga_sr1500_defconfig                   | 1 +
 configs/suvd3_defconfig                            | 1 +
 configs/tao3530_defconfig                          | 1 +
 configs/titanium_defconfig                         | 1 +
 configs/tricorder_defconfig                        | 1 +
 configs/tricorder_flash_defconfig                  | 1 +
 configs/tuge1_defconfig                            | 1 +
 configs/tuxx1_defconfig                            | 1 +
 configs/uniphier_ld4_sld8_defconfig                | 1 +
 configs/uniphier_v7_defconfig                      | 1 +
 configs/uniphier_v8_defconfig                      | 1 +
 configs/vct_platinum_onenand_defconfig             | 1 +
 configs/vct_platinum_onenand_small_defconfig       | 1 +
 configs/vct_platinumavc_onenand_defconfig          | 1 +
 configs/vct_platinumavc_onenand_small_defconfig    | 1 +
 configs/vct_premium_onenand_defconfig              | 1 +
 configs/vct_premium_onenand_small_defconfig        | 1 +
 configs/vf610twr_defconfig                         | 1 +
 configs/vf610twr_nand_defconfig                    | 1 +
 configs/x600_defconfig                             | 1 +
 include/env_internal.h                             | 4 ++--
 108 files changed, 111 insertions(+), 2 deletions(-)
configs/am335x_baltos_defconfig +1 -0
index c9524cab73..635c9beac7 100644
@@ -48,6 +48,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP_HS_ADMA=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x00080000
configs/am3517_evm_defconfig +1 -0
index 6dd04a4c17..02d5ed3aa0 100644
@@ -50,6 +50,7 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DM_PCA953X=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
configs/apf27_defconfig +1 -0
index be8ef7d2dd..41f4b2cf15 100644
@@ -44,6 +44,7 @@ CONFIG_FPGA_SPARTAN3=y
 CONFIG_MXC_GPIO=y
 CONFIG_MMC_MXC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
configs/apx4devkit_defconfig +1 -0
index 28b507e23f..e46a9f1a2c 100644
@@ -34,6 +34,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MXS_GPIO=y
 CONFIG_MMC_MXS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_MII=y
configs/at91sam9x5ek_dataflash_defconfig +1 -0
index ebb3885e91..c791a062f0 100644
@@ -45,6 +45,7 @@ CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
configs/at91sam9x5ek_mmc_defconfig +1 -0
index a225cf291a..0a575b411f 100644
@@ -43,6 +43,7 @@ CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
configs/at91sam9x5ek_nandflash_defconfig +1 -0
index 1509dd7cff..fe2353178a 100644
@@ -43,6 +43,7 @@ CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_ATMEL=y
 CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
configs/at91sam9x5ek_spiflash_defconfig +1 -0
index 8f53244e6f..a2e4a01f8e 100644
@@ -45,6 +45,7 @@ CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
configs/bk4r1_defconfig +1 -0
index 173e56813e..686f1ca482 100644
@@ -60,6 +60,7 @@ CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_MTD=y
configs/dns325_defconfig +1 -0
index 5fa13df1c6..a7193875d5 100644
@@ -32,6 +32,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dns325"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
configs/dockstar_defconfig +1 -0
index 2d501ef5cb..3cb368293d 100644
@@ -29,6 +29,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dockstar"
 CONFIG_ENV_IS_IN_NAND=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/ds414_defconfig +1 -0
index 9720ff8e91..110f7f96cf 100644
@@ -51,6 +51,7 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_ADDR_ENABLE=y
configs/ethernut5_defconfig +1 -0
index 6058272b24..c09888b4ed 100644
@@ -57,6 +57,7 @@ CONFIG_CLK_AT91=y
 CONFIG_DM_GPIO=y
 CONFIG_AT91_GPIO=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
configs/gardena-smart-gateway-mt7688-ram_defconfig +1 -0
index c362b407ea..0e43576c1c 100644
@@ -50,6 +50,7 @@ CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_SPI_FLASH=y
configs/gardena-smart-gateway-mt7688_defconfig +1 -0
index 5d3d7c9f04..b4ed551b43 100644
@@ -53,6 +53,7 @@ CONFIG_LED=y
 CONFIG_LED_BLINK=y
 CONFIG_LED_GPIO=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_SPI_FLASH=y
configs/goflexhome_defconfig +1 -0
index 3d51c0de82..33de608b6f 100644
@@ -37,6 +37,7 @@ CONFIG_MVSATA_IDE=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/guruplug_defconfig +1 -0
index 18346e59af..23e550ae07 100644
@@ -37,6 +37,7 @@ CONFIG_MVSATA_IDE=y
 CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/gwventana_emmc_defconfig +1 -0
index 6b343bf7b3..d8462001ea 100644
@@ -65,6 +65,7 @@ CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_PHYLIB=y
 CONFIG_E1000=y
 CONFIG_MII=y
configs/gwventana_gw5904_defconfig +1 -0
index 48ce0112ae..bb87d7728e 100644
@@ -65,6 +65,7 @@ CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_PHYLIB=y
 CONFIG_MV88E61XX_SWITCH=y
 CONFIG_MV88E61XX_CPU_PORT=5
configs/gwventana_nand_defconfig +1 -0
index d53210e204..21ffa20bff 100644
@@ -68,6 +68,7 @@ CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/ib62x0_defconfig +1 -0
index 89eb677664..df79f314d2 100644
@@ -33,6 +33,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/iconnect_defconfig +1 -0
index 47ddd62ea0..c93a3d6992 100644
@@ -28,6 +28,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-iconnect"
 CONFIG_ENV_IS_IN_NAND=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/imx6dl_icore_nand_defconfig +1 -0
index e0fac8e60a..a93194bf3b 100644
@@ -42,6 +42,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/imx6q_icore_nand_defconfig +1 -0
index 9b01bc3555..0dc81f026c 100644
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/imx6q_logic_defconfig +2 -0
index 110f91c4b2..ae3395a5bc 100644
@@ -68,6 +68,8 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_FSL_USDHC=y
 CONFIG_DM_MTD=y
+CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_MXS=y
configs/imx6qdl_icore_mmc_defconfig +1 -0
index 2e8721e559..c497aee973 100644
@@ -57,6 +57,7 @@ CONFIG_SYS_BOOTCOUNT_MAGIC=0x0B01C041
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/imx6qdl_icore_nand_defconfig +1 -0
index 9b01bc3555..0dc81f026c 100644
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/imx6ul_geam_nand_defconfig +1 -0
index 86fdc61690..77fa6da182 100644
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/imx6ul_isiot_nand_defconfig +1 -0
index 95beb0a143..fe9e5c1dcc 100644
@@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/k2e_evm_defconfig +1 -0
index a74b6e565b..3ffba36dff 100644
@@ -45,6 +45,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2e_hs_evm_defconfig +1 -0
index 15982f7c6d..8d494e6804 100644
@@ -37,6 +37,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2g_evm_defconfig +1 -0
index bfcd616824..0346558c69 100644
@@ -45,6 +45,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2g_hs_evm_defconfig +1 -0
index 7cc7f77e28..b28f4a7da9 100644
@@ -38,6 +38,7 @@ CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2hk_evm_defconfig +1 -0
index 7d33520de4..01c8be6201 100644
@@ -45,6 +45,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2hk_hs_evm_defconfig +1 -0
index 8b3b70d2b8..d9ed31f5fc 100644
@@ -37,6 +37,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2l_evm_defconfig +1 -0
index b781cccb40..00cc1a563f 100644
@@ -45,6 +45,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/k2l_hs_evm_defconfig +1 -0
index 916de8f56e..79cca378b4 100644
@@ -36,6 +36,7 @@ CONFIG_TI_AEMIF=y
 CONFIG_MISC=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/km_kirkwood_128m16_defconfig +1 -0
index 10b33ab7ad..2f7a9e328c 100644
@@ -37,6 +37,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/km_kirkwood_defconfig +1 -0
index 199bb3c2fe..db60a113bf 100644
@@ -37,6 +37,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/km_kirkwood_pci_defconfig +1 -0
index 7ff7ccf00d..5ff8c2842c 100644
@@ -38,6 +38,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/kmcoge4_defconfig +2 -0
index 7ee4ce44aa..653ab00f4a 100644
@@ -39,6 +39,8 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
configs/kmcoge5ne_defconfig +1 -0
index b66665416d..0a5b798d96 100644
@@ -181,6 +181,7 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
configs/kmcoge5un_defconfig +1 -0
index 3ab3671faa..45c528a64f 100644
@@ -40,6 +40,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/kmeter1_defconfig +1 -0
index 369ba6a9d4..4da683c3a2 100644
@@ -145,6 +145,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/kmnusa_defconfig +1 -0
index 9ce041e1bd..aae2106187 100644
@@ -40,6 +40,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/kmopti2_defconfig +1 -0
index a72dc7f808..5abb694e18 100644
@@ -165,6 +165,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/kmsugp1_defconfig +1 -0
index d67b4bc4b6..0bd6d9fa33 100644
@@ -40,6 +40,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/kmsupx5_defconfig +1 -0
index 8ce90cd23f..1004cedccc 100644
@@ -145,6 +145,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/kmsuv31_defconfig +1 -0
index 141f5e7e01..f813a76430 100644
@@ -39,6 +39,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/kmtegr1_defconfig +1 -0
index e13bd84a45..276dbeacdf 100644
@@ -145,6 +145,7 @@ CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
configs/kmtepr2_defconfig +1 -0
index c131d7f2ef..7dc5bef99e 100644
@@ -165,6 +165,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/m53menlo_defconfig +1 -0
index 2b16c1d403..9c8cbf9378 100644
@@ -64,6 +64,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_MXC=y
configs/mgcoge3un_defconfig +1 -0
index 51b5358e69..6844600c57 100644
@@ -39,6 +39,7 @@ CONFIG_BOOTCOUNT_RAM=y
 CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=8100000
configs/mx28evk_auart_console_defconfig +1 -0
index f434ee0c34..cdbfffca87 100644
@@ -41,6 +41,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_MXS_GPIO=y
 CONFIG_MMC_MXS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_MII=y
configs/mx28evk_defconfig +1 -0
index 3f96f07586..207ebd4be1 100644
@@ -41,6 +41,7 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_MXS_GPIO=y
 CONFIG_MMC_MXS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_MII=y
configs/mx28evk_nand_defconfig +1 -0
index 81856e2286..cc536aa297 100644
@@ -40,6 +40,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MXS_GPIO=y
 CONFIG_MMC_MXS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_MII=y
configs/mx28evk_spi_defconfig +1 -0
index 6867c17209..7fcd068356 100644
@@ -39,6 +39,7 @@ CONFIG_CMD_UBI=y
 CONFIG_MXS_GPIO=y
 CONFIG_MMC_MXS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_MII=y
configs/nas220_defconfig +1 -0
index 27dd7752db..9d194a2f6a 100644
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-blackarmor-nas220"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
configs/nsa310s_defconfig +1 -0
index df49fd8498..e950f6aabf 100644
@@ -30,6 +30,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/omap35_logic_defconfig +1 -0
index a1fd2c1fb0..5decb71008 100644
@@ -48,6 +48,7 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
configs/omap35_logic_somlv_defconfig +1 -0
index 9773464d04..fe97a2f1a8 100644
@@ -47,6 +47,7 @@ CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
configs/omap3_beagle_defconfig +1 -0
index ed7cb8f2ff..a4fd5cd494 100644
@@ -68,6 +68,7 @@ CONFIG_TWL4030_LED=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
configs/omap3_evm_defconfig +1 -0
index 2670dfb1e6..0aa6ed3f10 100644
@@ -55,6 +55,7 @@ CONFIG_DM_MMC=y
 # CONFIG_SPL_DM_MMC is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
configs/omap3_ha_defconfig +1 -0
index 12ce30659f..a78fc386bb 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPL_NAND_SIMPLE=y
configs/omap3_logic_defconfig +1 -0
index bc7334cef5..50172b2c10 100644
@@ -47,6 +47,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
configs/omap3_logic_somlv_defconfig +1 -0
index c2fac5b7c5..c6ac4e5682 100644
@@ -48,6 +48,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
configs/omap3_overo_defconfig +1 -0
index a5069fd964..e8b18bdddd 100644
@@ -37,6 +37,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPL_NAND_SIMPLE=y
configs/omap3_pandora_defconfig +1 -0
index d8ee7995de..1e33be3c39 100644
@@ -31,6 +31,7 @@ CONFIG_DM=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SERIAL=y
configs/omapl138_lcdk_defconfig +1 -0
index ba42133e94..fee278907b 100644
@@ -47,6 +47,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DAVINCI=y
 CONFIG_DM_MMC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_DAVINCI=y
configs/openrd_base_defconfig +1 -0
index b7e05a8039..ea0c6f719d 100644
@@ -35,6 +35,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/openrd_client_defconfig +1 -0
index 731e5cb1df..150de1f7c8 100644
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-client"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC_HW_PARTITIONING is not set
configs/openrd_ultimate_defconfig +1 -0
index fd6fe37ae9..b6f8f078d9 100644
@@ -33,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-ultimate"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC_HW_PARTITIONING is not set
configs/pcm052_defconfig +1 -0
index ad744c86e8..0525a97830 100644
@@ -42,6 +42,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_DM_MTD=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_NAND_VF610_NFC_DT=y
configs/pcm058_defconfig +1 -0
index f617d130d6..6ca24c0007 100644
@@ -46,6 +46,7 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
configs/pfla02_defconfig +1 -0
index f80240b25a..970670d0ab 100644
@@ -45,6 +45,7 @@ CONFIG_CMD_UBI=y
 CONFIG_DM=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_DM_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
configs/platinum_picon_defconfig +1 -0
index b850e2cbc9..86763c85fd 100644
@@ -50,6 +50,7 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/platinum_titanium_defconfig +1 -0
index 88d6d5302d..f5e8b7038e 100644
@@ -50,6 +50,7 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/pogo_e02_defconfig +1 -0
index a1998f62ce..5aace219a4 100644
@@ -28,6 +28,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-pogo_e02"
 CONFIG_ENV_IS_IN_NAND=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MVGBE=y
 CONFIG_MII=y
configs/sama5d3_xplained_mmc_defconfig +1 -0
index ab3d1d0d32..94c32be666 100644
@@ -63,6 +63,7 @@ CONFIG_AT91_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
configs/sama5d3_xplained_nandflash_defconfig +1 -0
index 5f12455d47..9b30ee8efc 100644
@@ -59,6 +59,7 @@ CONFIG_DM_MMC=y
 CONFIG_GENERIC_ATMEL_MCI=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_ATMEL=y
 CONFIG_PMECC_CAP=4
configs/sheevaplug_defconfig +1 -0
index 75682298ec..54bb1f5a5e 100644
@@ -35,6 +35,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
configs/socfpga_arria5_defconfig +1 -0
index 7517df6e1e..983e04dddb 100644
@@ -43,6 +43,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/socfpga_cyclone5_defconfig +1 -0
index 1c576cedfe..559d820ea3 100644
@@ -43,6 +43,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/socfpga_de0_nano_soc_defconfig +1 -0
index f677149bec..273803d7e9 100644
@@ -43,6 +43,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_PHY_MICREL=y
 CONFIG_PHY_MICREL_KSZ90X1=y
 CONFIG_DM_ETH=y
configs/socfpga_is1_defconfig +1 -0
index 274e2aa382..aff5e5b05a 100644
@@ -41,6 +41,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHY_MICREL=y
configs/socfpga_sockit_defconfig +1 -0
index 8e804a425f..dce6ef56e1 100644
@@ -43,6 +43,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/socfpga_socrates_defconfig +1 -0
index 7c78fa3224..7455ffcabd 100644
@@ -44,6 +44,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
configs/socfpga_sr1500_defconfig +1 -0
index e4286e5415..214edf46c3 100644
@@ -45,6 +45,7 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=100000000
 CONFIG_SPI_FLASH_STMICRO=y
configs/suvd3_defconfig +1 -0
index 9c45501038..41de60b39a 100644
@@ -166,6 +166,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/tao3530_defconfig +1 -0
index 1fa5f010b1..72b1fb5c98 100644
@@ -29,6 +29,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SPL_NAND_SIMPLE=y
configs/titanium_defconfig +1 -0
index 3bd9262a4f..13675885c3 100644
@@ -36,6 +36,7 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_PHYLIB=y
configs/tricorder_defconfig +1 -0
index 5c1404f4f0..4d22c63454 100644
@@ -41,6 +41,7 @@ CONFIG_LED_STATUS_CMD=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPL_NAND_SIMPLE=y
 CONFIG_CONS_INDEX=3
configs/tricorder_flash_defconfig +1 -0
index fbcce5f6bc..c957bd4ea2 100644
@@ -39,6 +39,7 @@ CONFIG_LED_STATUS_CMD=y
 CONFIG_TWL4030_LED=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SPL_NAND_SIMPLE=y
 CONFIG_CONS_INDEX=3
configs/tuge1_defconfig +1 -0
index 3ddcad39d4..d5ef094716 100644
@@ -145,6 +145,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/tuxx1_defconfig +1 -0
index 621e4ece7e..d3d4230626 100644
@@ -167,6 +167,7 @@ CONFIG_BOOTCOUNT_BOOTLIMIT=3
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
configs/uniphier_ld4_sld8_defconfig +1 -0
index 4f22f3eefa..0602bf89ce 100644
@@ -45,6 +45,7 @@ CONFIG_MMC_UNIPHIER=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_v7_defconfig +1 -0
index f41c61f7bd..9315ffa5f7 100644
@@ -44,6 +44,7 @@ CONFIG_MMC_UNIPHIER=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/uniphier_v8_defconfig +1 -0
index 78a872e157..7a4f78b0b8 100644
@@ -45,6 +45,7 @@ CONFIG_MMC_SDHCI_CADENCE=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_DENALI_DT=y
 CONFIG_NAND_DENALI_SPARE_AREA_SKIP_BYTES=8
configs/vct_platinum_onenand_defconfig +1 -0
index 1d3d405d8e..5cb798859c 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_ONENAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x00000000
 CONFIG_SMC911X_32_BIT=y
configs/vct_platinum_onenand_small_defconfig +1 -0
index 50adb73129..00fc222710 100644
@@ -30,4 +30,5 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_ONENAND=y
 # CONFIG_NET is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SYS_NS16550=y
configs/vct_platinumavc_onenand_defconfig +1 -0
index 692fae7036..f9f598b3cb 100644
@@ -21,5 +21,6 @@ CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 CONFIG_ENV_IS_IN_ONENAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SYS_NS16550=y
 # CONFIG_REGEX is not set
configs/vct_platinumavc_onenand_small_defconfig +1 -0
index bcf39bc1ed..be06cf5aac 100644
@@ -30,4 +30,5 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_ONENAND=y
 # CONFIG_NET is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SYS_NS16550=y
configs/vct_premium_onenand_defconfig +1 -0
index 2e87bdf358..fea07c1916 100644
@@ -24,6 +24,7 @@ CONFIG_CMD_UBI=y
 # CONFIG_CMD_UBIFS is not set
 CONFIG_ENV_IS_IN_ONENAND=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x00000000
 CONFIG_SMC911X_32_BIT=y
configs/vct_premium_onenand_small_defconfig +1 -0
index 93fd4299d2..998c5d3ef5 100644
@@ -30,4 +30,5 @@ CONFIG_CMD_UBI=y
 CONFIG_ENV_IS_IN_ONENAND=y
 # CONFIG_NET is not set
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_SYS_NS16550=y
configs/vf610twr_defconfig +1 -0
index 92c3299b4f..46e2ee9321 100644
@@ -33,6 +33,7 @@ CONFIG_DM_GPIO=y
 CONFIG_VYBRID_GPIO=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
configs/vf610twr_nand_defconfig +1 -0
index b9a046ef8e..e8113f6684 100644
@@ -33,6 +33,7 @@ CONFIG_DM_GPIO=y
 CONFIG_VYBRID_GPIO=y
 CONFIG_FSL_ESDHC_IMX=y
 CONFIG_MTD=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_VF610_NFC=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
configs/x600_defconfig +1 -0
index 33f67c8a0f..7267955fa3 100644
@@ -51,6 +51,7 @@ CONFIG_SYS_I2C_DW=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_UBI=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_MICREL=y
include/env_internal.h +2 -2
index b1ddcb5adf..801edfa23a 100644
@@ -107,8 +107,8 @@ extern unsigned long nand_env_oob_offset;
 # ifndef CONFIG_ENV_SIZE
 #  error "Need to define CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_UBI"
 # endif
-# ifndef CONFIG_CMD_UBI
-#  error "Need to define CONFIG_CMD_UBI when using CONFIG_ENV_IS_IN_UBI"
+# ifndef CONFIG_MTD_UBI
+#  error "Need to define CONFIG_MTD_UBI when using CONFIG_ENV_IS_IN_UBI"
 # endif
 #endif /* CONFIG_ENV_IS_IN_UBI */
 
Signature · 1 line
2.20.1
#18 lore raw

PATCH v5 9/26 mtd: ensure UBI is compiled when CMD_UBI is selected

Quoted 6 lines · Miquel Raynal

UBI must be enabled when CMD_UBI is used, this is mandatory and will later be reflected thanks to a "depends on" in Kconfig. But first, defconfigs needs to be fixed.

This is not applied. Upon full migration in the initial part of this series this patch is no longer required, so is dropped. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/357e2f20/attachment.sig>
author maintainer
#19 lore raw

PATCH v5 10/26 mtd: ensure UBI is compiled when ENV_IS_IN_UBI is selected

In reply to Miquel Raynal

UBI must be enabled when the environment is in UBI.

---
 configs/CHIP_pro_defconfig | 2 ++
 env/Kconfig                | 2 ++
 2 files changed, 4 insertions(+)
configs/CHIP_pro_defconfig +2 -0
index 524c56ed4b..f2aeedf5af 100644
@@ -9,6 +9,7 @@ CONFIG_USE_PREBOOT=y
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
 CONFIG_MTDIDS_DEFAULT="nand0=sunxi-nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=sunxi-nand.0:256k(spl),256k(spl-backup),2m(uboot),2m(uboot-backup),-(UBI)"
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-gr8-chip-pro"
@@ -18,6 +19,7 @@ CONFIG_ENV_UBI_VOLUME="uboot-env"
 # CONFIG_MMC is not set
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_UBI=y
 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000
 CONFIG_SYS_NAND_PAGE_SIZE=0x1000
 CONFIG_SYS_NAND_OOBSIZE=0x100
env/Kconfig +2 -0
index 74db2f38cc..87614430f8 100644
@@ -373,6 +373,8 @@ config ENV_SPI_MODE
 config ENV_IS_IN_UBI
 	bool "Environment in a UBI volume"
 	depends on !CHAIN_OF_TRUST
+	depends on MTD_UBI
+	depends on CMD_UBI
 	help
 	  Define this if you have an UBI volume that you want to use for the
 	  environment.  This has the benefit of wear-leveling the environment
Signature · 1 line
2.20.1
#20 lore raw

PATCH v5 10/26 mtd: ensure UBI is compiled when ENV_IS_IN_UBI is selected

Quoted 4 lines · Miquel Raynal

UBI must be enabled when the environment is in UBI.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/c048bcfe/attachment.sig>
author maintainer
#21 lore raw

PATCH v5 11/26 mtd: ensure MTD_RAW_NAND is compiled when ENV_IS_IN_NAND is selected

In reply to Miquel Raynal

Raw NAND support must be enabled when the environment is in NAND.

---
 configs/bk4r1_defconfig   | 1 +
 configs/harmony_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/bk4r1_defconfig +1 -0
index 686f1ca482..12bdf22876 100644
@@ -60,6 +60,7 @@ CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_UBI=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/harmony_defconfig +1 -0
index 441cbf9774..330802d28e 100644
@@ -31,6 +31,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SPL_DM=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PCI=y
Signature · 1 line
2.20.1
#22 lore raw

PATCH v5 11/26 mtd: ensure MTD_RAW_NAND is compiled when ENV_IS_IN_NAND is selected

Quoted 4 lines · Miquel Raynal

Raw NAND support must be enabled when the environment is in NAND.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/11909a96/attachment.sig>
author maintainer
#23 lore raw

PATCH v5 12/26 mtd: ensure CMD_NAND is compiled when its options are selected

In reply to Miquel Raynal

In some files, options of CMD_NAND are selected but not the command itself. Fix this inconsistency.

---
 configs/apf27_defconfig                          | 1 +
 configs/aristainetos2_defconfig                  | 1 +
 configs/aristainetos2b_defconfig                 | 1 +
 configs/aristainetos_defconfig                   | 1 +
 configs/bg0900_defconfig                         | 1 +
 configs/bitmain_antminer_s9_defconfig            | 1 +
 configs/bk4r1_defconfig                          | 1 +
 configs/colibri-imx6ull_defconfig                | 1 +
 configs/colibri_imx7_defconfig                   | 1 +
 configs/gwventana_nand_defconfig                 | 1 +
 configs/imx6q_logic_defconfig                    | 1 +
 configs/m53menlo_defconfig                       | 1 +
 configs/mx28evk_auart_console_defconfig          | 1 +
 configs/mx28evk_defconfig                        | 1 +
 configs/mx28evk_nand_defconfig                   | 1 +
 configs/mx28evk_spi_defconfig                    | 1 +
 configs/mx6sabreauto_defconfig                   | 1 +
 configs/mx6sxsabreauto_defconfig                 | 1 +
 configs/pcm052_defconfig                         | 1 +
 configs/pcm058_defconfig                         | 1 +
 configs/platinum_picon_defconfig                 | 1 +
 configs/platinum_titanium_defconfig              | 1 +
 configs/titanium_defconfig                       | 1 +
 configs/vf610twr_defconfig                       | 1 +
 configs/vf610twr_nand_defconfig                  | 1 +
 configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig | 1 +
 configs/zynq_zc770_xm011_defconfig               | 1 +
 configs/zynq_zc770_xm011_x16_defconfig           | 1 +
 28 files changed, 28 insertions(+)
configs/apf27_defconfig +1 -0
index 41f4b2cf15..edc9c8dfca 100644
@@ -23,6 +23,7 @@ CONFIG_CMD_EEPROM=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_DHCP=y
configs/aristainetos2_defconfig +1 -0
index 17ce35341f..275a8d4f16 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
configs/aristainetos2b_defconfig +1 -0
index 6143eb2264..550058bc24 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
configs/aristainetos_defconfig +1 -0
index 895a014069..31a699bdf5 100644
@@ -18,6 +18,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
configs/bg0900_defconfig +1 -0
index fae085e14d..53237e110b 100644
@@ -21,6 +21,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
configs/bitmain_antminer_s9_defconfig +1 -0
index 21cd33a2ec..a06f222a8f 100644
@@ -33,6 +33,7 @@ CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_PART=y
 # CONFIG_CMD_SETEXPR is not set
configs/bk4r1_defconfig +1 -0
index 12bdf22876..5e1e3b4745 100644
@@ -20,6 +20,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_DHCP=y
configs/colibri-imx6ull_defconfig +1 -0
index 2f7003cca0..b265b315d2 100644
@@ -28,6 +28,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_TORTURE=y
 CONFIG_CMD_USB=y
configs/colibri_imx7_defconfig +1 -0
index e873099b63..14502b9ca3 100644
@@ -28,6 +28,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_TORTURE=y
 CONFIG_CMD_USB=y
configs/gwventana_nand_defconfig +1 -0
index 21ffa20bff..3122971c99 100644
@@ -43,6 +43,7 @@ CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_USB=y
configs/imx6q_logic_defconfig +1 -0
index ae3395a5bc..99561be4a6 100644
@@ -40,6 +40,7 @@ CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_SDP=y
configs/m53menlo_defconfig +1 -0
index 9c8cbf9378..e8b2c12e29 100644
@@ -35,6 +35,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 # CONFIG_CMD_PINMUX is not set
 CONFIG_CMD_USB=y
configs/mx28evk_auart_console_defconfig +1 -0
index cdbfffca87..e8c36ee0cf 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
configs/mx28evk_defconfig +1 -0
index 207ebd4be1..28305e5431 100644
@@ -21,6 +21,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
configs/mx28evk_nand_defconfig +1 -0
index cc536aa297..f24bd7a995 100644
@@ -20,6 +20,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
configs/mx28evk_spi_defconfig +1 -0
index 7fcd068356..305213d9c5 100644
@@ -20,6 +20,7 @@ CONFIG_CMD_BOOTZ=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
configs/mx6sabreauto_defconfig +1 -0
index be34d25bd3..b8bf2e164d 100644
@@ -37,6 +37,7 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
configs/mx6sxsabreauto_defconfig +1 -0
index 377a4dbbb0..5eec92098e 100644
@@ -13,6 +13,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
configs/pcm052_defconfig +1 -0
index 0525a97830..ffbd1c26bb 100644
@@ -13,6 +13,7 @@ CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
configs/pcm058_defconfig +1 -0
index 6ca24c0007..6430238f20 100644
@@ -33,6 +33,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_CACHE=y
configs/platinum_picon_defconfig +1 -0
index 86763c85fd..5b5986f6ce 100644
@@ -30,6 +30,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
configs/platinum_titanium_defconfig +1 -0
index f5e8b7038e..0bacbc7e40 100644
@@ -30,6 +30,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
configs/titanium_defconfig +1 -0
index 13675885c3..4c556043da 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
configs/vf610twr_defconfig +1 -0
index 46e2ee9321..7fd071e88a 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
configs/vf610twr_nand_defconfig +1 -0
index e8113f6684..df9761a0c4 100644
@@ -16,6 +16,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
configs/xilinx_zynqmp_zc1751_xm016_dc2_defconfig +1 -0
index 9faebdcf46..ed7b33c337 100644
@@ -33,6 +33,7 @@ CONFIG_CMD_FPGA_LOAD_SECURE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TFTPPUT=y
configs/zynq_zc770_xm011_defconfig +1 -0
index 029093396e..3cafcd7711 100644
@@ -26,6 +26,7 @@ CONFIG_CMD_FPGA_LOADFS=y
 CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
configs/zynq_zc770_xm011_x16_defconfig +1 -0
index b24764e42d..904ff56ed1 100644
@@ -26,6 +26,7 @@ CONFIG_CMD_FPGA_LOADFS=y
 CONFIG_CMD_FPGA_LOADMK=y
 CONFIG_CMD_FPGA_LOADP=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NET is not set
Signature · 1 line
2.20.1
#24 lore raw

PATCH v5 12/26 mtd: ensure CMD_NAND is compiled when its options are selected

Quoted 5 lines · Miquel Raynal

In some files, options of CMD_NAND are selected but not the command itself. Fix this inconsistency.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/93f34687/attachment.sig>
author maintainer
#25 lore raw

PATCH v5 13/26 mtd: ensure MTD is compiled when CMD_MTDPARTS is selected

In reply to Miquel Raynal

MTD support must be enabled when using mtdparts. Indeed, functions like get_mtd_info(), get_mtd_device() and put_mtd_device() are in drivers/mtd/mtd_uboot.c and are built only with CONFIG_MTD.

---
 configs/BSC9131RDB_SPIFLASH_SYSCLK100_defconfig | 1 +
 configs/BSC9131RDB_SPIFLASH_defconfig           | 1 +
 configs/lion-rk3368_defconfig                   | 1 +
 configs/sandbox64_defconfig                     | 1 +
 configs/sandbox_defconfig                       | 1 +
 5 files changed, 5 insertions(+)
configs/BSC9131RDB_SPIFLASH_SYSCLK100_defconfig +1 -0
index 2324158349..8ca800c830 100644
@@ -26,6 +26,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:1m(uboot),8m(kernel),512k(dtb),
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
+CONFIG_MTD=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=10000000
configs/BSC9131RDB_SPIFLASH_defconfig +1 -0
index 0e5a2dacf5..b2b5d1f8a1 100644
@@ -26,6 +26,7 @@ CONFIG_MTDPARTS_DEFAULT="mtdparts=ff800000.flash:1m(uboot),8m(kernel),512k(dtb),
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_FSL_CAAM=y
 # CONFIG_MMC is not set
+CONFIG_MTD=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=10000000
configs/lion-rk3368_defconfig +1 -0
index 1c87416980..cbabba80a6 100644
@@ -64,6 +64,7 @@ CONFIG_TPL_CLK=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MTD=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_WINBOND=y
configs/sandbox64_defconfig +1 -0
index 7aa2d38b7b..a99cee3889 100644
@@ -113,6 +113,7 @@ CONFIG_PWRSEQ=y
 CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SANDBOX=y
+CONFIG_MTD=y
 CONFIG_SPI_FLASH_SANDBOX=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
configs/sandbox_defconfig +1 -0
index f77b9e8a7d..770fa7b186 100644
@@ -133,6 +133,7 @@ CONFIG_PWRSEQ=y
 CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
 CONFIG_MMC_SANDBOX=y
+CONFIG_MTD=y
 CONFIG_SPI_FLASH_SANDBOX=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
Signature · 1 line
2.20.1
#26 lore raw

PATCH v5 13/26 mtd: ensure MTD is compiled when CMD_MTDPARTS is selected

Quoted 6 lines · Miquel Raynal

MTD support must be enabled when using mtdparts. Indeed, functions like get_mtd_info(), get_mtd_device() and put_mtd_device() are in drivers/mtd/mtd_uboot.c and are built only with CONFIG_MTD.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/db35fcc6/attachment.sig>
author maintainer
#27 lore raw

PATCH v5 14/26 configs: move CONFIG_MTD in defconfigs when set in arch includes

In reply to Miquel Raynal

Let's be consistent and always declare CONFIG_MTD from the defconfig file when needed.

---
 configs/socfpga_stratix10_defconfig       | 1 +
 configs/turris_mox_defconfig              | 1 +
 include/configs/mvebu_armada-37xx.h       | 1 -
 include/configs/socfpga_stratix10_socdk.h | 1 -
 4 files changed, 2 insertions(+), 2 deletions(-)
configs/socfpga_stratix10_defconfig +1 -0
index 5ae53a4db9..9d6108e386 100644
@@ -39,6 +39,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
+CONFIG_MTD=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0x2003
 CONFIG_SPI_FLASH_SPANSION=y
configs/turris_mox_defconfig +1 -0
index 25c4fc14b5..3669cae385 100644
@@ -46,6 +46,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_XENON=y
+CONFIG_MTD=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=20000000
include/configs/mvebu_armada-37xx.h +0 -1
index 3a890ab843..b7a8fae723 100644
@@ -56,7 +56,6 @@
  * SPI Flash configuration
  */
 
-#define CONFIG_MTD			/* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS		/* required for UBI partition support */
 
 /* Environment in SPI NOR flash */
include/configs/socfpga_stratix10_socdk.h +0 -1
index a1920caa9d..7b6ac6eda2 100644
@@ -71,7 +71,6 @@
 #endif /* CONFIG_ENV_IS_IN_SPI_FLASH */
 
 #ifndef CONFIG_SPL_BUILD
-#define CONFIG_MTD
 #define CONFIG_MTD_PARTITIONS
 #define MTDIDS_DEFAULT			"nor0=ff705000.spi.0"
 #endif /* CONFIG_SPL_BUILD */
Signature · 1 line
2.20.1
#28 lore raw

PATCH v5 14/26 configs: move CONFIG_MTD in defconfigs when set in arch includes

Quoted 5 lines · Miquel Raynal

Let's be consistent and always declare CONFIG_MTD from the defconfig file when needed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/775c9616/attachment.sig>
author maintainer
#29 lore raw

PATCH v5 15/26 configs: remove raw NAND core from k2g defconfigs

In reply to Miquel Raynal

Due to previous Makefile organization, the raw NAND subdirectory was not compiled in if CMD_NAND was not enabled. Because the Denali driver does not compile with these boards (undefined environment offset), remove the dependency within the defconfig over the controller driver (was ignored anyway in the past).

---
 configs/k2g_evm_defconfig    | 1 -
 configs/k2g_hs_evm_defconfig | 1 -
 2 files changed, 2 deletions(-)
configs/k2g_evm_defconfig +0 -1
index 0346558c69..a7230e66ff 100644
@@ -48,7 +48,6 @@ CONFIG_MTD=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
-CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
configs/k2g_hs_evm_defconfig +0 -1
index b28f4a7da9..3a0d9a2d52 100644
@@ -41,7 +41,6 @@ CONFIG_MTD=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_USE_FLASH_BBT=y
-CONFIG_NAND_DAVINCI=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_BUS=1
Signature · 1 line
2.20.1
#30 lore raw

PATCH v5 15/26 configs: remove raw NAND core from k2g defconfigs

Quoted 7 lines · Miquel Raynal

Due to previous Makefile organization, the raw NAND subdirectory was not compiled in if CMD_NAND was not enabled. Because the Denali driver does not compile with these boards (undefined environment offset), remove the dependency within the defconfig over the controller driver (was ignored anyway in the past).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/53e95531/attachment.sig>
author maintainer
#31 lore raw

PATCH v5 16/26 configs: remove MTD support from bcm11130 and M54418TWR defconfigs

In reply to Miquel Raynal

While the right Kconfig entries were selected, because of the missing CMD_NAND symbol the raw NAND core was never compiled. Remove it from the defconfigs otherwise the build will fail.

---
 configs/M54418TWR_nand_mii_defconfig          | 1 -
 configs/M54418TWR_nand_rmii_defconfig         | 1 -
 configs/M54418TWR_nand_rmii_lowfreq_defconfig | 1 -
 configs/bcm11130_nand_defconfig               | 2 --
 4 files changed, 5 deletions(-)
configs/M54418TWR_nand_mii_defconfig +0 -1
index 1b04860b5c..5eaece8dee 100644
@@ -21,7 +21,6 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_DEFAULT_DEVICE_TREE="M54418TWR_nand_mii"
 CONFIG_MTD=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_MII=y
configs/M54418TWR_nand_rmii_defconfig +0 -1
index b28c8067ce..b0a76e0558 100644
@@ -21,7 +21,6 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_DEFAULT_DEVICE_TREE="M54418TWR_nand_rmii"
 CONFIG_MTD=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_MII=y
configs/M54418TWR_nand_rmii_lowfreq_defconfig +0 -1
index b0af1dbf17..737c1be40b 100644
@@ -21,7 +21,6 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_DEFAULT_DEVICE_TREE="M54418TWR_nand_rmii_lowfreq"
 CONFIG_MTD=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_MII=y
configs/bcm11130_nand_defconfig +0 -2
index 9d98402992..0c9d27166b 100644
@@ -25,8 +25,6 @@ CONFIG_ENV_IS_IN_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_KONA=y
-CONFIG_MTD=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
Signature · 1 line
2.20.1
#32 lore raw

PATCH v5 16/26 configs: remove MTD support from bcm11130 and M54418TWR defconfigs

Quoted 5 lines · Miquel Raynal

While the right Kconfig entries were selected, because of the missing CMD_NAND symbol the raw NAND core was never compiled. Remove it from the defconfigs otherwise the build will fail.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/135ccf08/attachment.sig>
author maintainer
#33 lore raw

PATCH v5 17/26 configs: socfpga: mcvevk: Remove useless UBI infos

In reply to Miquel Raynal

There is no flash on this board, there is no reason to define MTD environment variables nor UBI. Drop them from the configuration file.

---
 configs/socfpga_mcvevk_defconfig | 3 ---
 1 file changed, 3 deletions(-)
configs/socfpga_mcvevk_defconfig +0 -3
index 39cc753888..15c9f7fdb0 100644
@@ -28,9 +28,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),- at 1536k(UBI)0"
-CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_mcvevk"
Signature · 1 line
2.20.1
#34 lore raw

PATCH v5 17/26 configs: socfpga: mcvevk: Remove useless UBI infos

Quoted 13 lines · Miquel Raynal

There is no flash on this board, there is no reason to define MTD environment variables nor UBI. Drop them from the configuration file.

---
 configs/socfpga_mcvevk_defconfig | 3 ---
 1 file changed, 3 deletions(-)
configs/socfpga_mcvevk_defconfig +0 -0
index 39cc753888..15c9f7fdb0 100644

configs/socfpga_mcvevk_defconfig CONFIG_CMD_USB=y · line 33

Quoted 9 lines
configs/socfpga_mcvevk_defconfig +0 -3
@@ -28,9 +28,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),- at 1536k(UBI)0"
-CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_mcvevk"

This board has SPI flash and so the MTDIDS/PARTS make sense there. I'm adding in the board maintainer for further comment about how UBI might be used, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191124/1498b786/attachment.sig>
#35 lore raw

PATCH v5 17/26 configs: socfpga: mcvevk: Remove useless UBI infos

Hello,

Am 24.11.19 um 16:13 schrieb Tom Rini:

Quoted 20 lines · Miquel Raynal
Quoted 19 lines

There is no flash on this board, there is no reason to define MTD environment variables nor UBI. Drop them from the configuration file.

---
 configs/socfpga_mcvevk_defconfig | 3 ---
 1 file changed, 3 deletions(-)
configs/socfpga_mcvevk_defconfig +0 -2
index 39cc753888..15c9f7fdb0 100644
@@ -28,9 +28,6 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),- at 1536k(UBI)0"
Quoted 8 lines

configs/socfpga_mcvevk_defconfig CONFIG_CMD_USB=y · line 33

Quoted 4 lines
configs/socfpga_mcvevk_defconfig +0 -1
-CONFIG_CMD_UBI=y
 # CONFIG_ISO_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_mcvevk"

This board has SPI flash and so the MTDIDS/PARTS make sense there. I'm adding in the board maintainer for further comment about how UBI might be used, thanks!

There is *no* SPI-FLash connected to the HPS on that module/board. Therefore these options can safely be removed. (There is a SPI-NOR connected to the FPGA for configuration purposes).

Miquel, feel free to add my:

Thanks,

Wolfgang

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191125/a453614d/attachment.sig>

#36 lore raw

PATCH v5 17/26 configs: socfpga: mcvevk: Remove useless UBI infos

In reply to Miquel Raynal
Quoted 5 lines · Miquel Raynal

There is no flash on this board, there is no reason to define MTD environment variables nor UBI. Drop them from the configuration file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/95657111/attachment.sig>
author maintainer
#37 lore raw

PATCH v5 18/26 configs: ls104x/ls108x/ls208x: Build the raw NAND core with TFABOOT

In reply to Miquel Raynal

Enabling TFABOOT configuration will compile-in a call to nand_read in the boot sequence. Handle the situation by also selecting officially the raw NAND core in this case.

---
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig | 1 +
 configs/ls1043aqds_tfa_defconfig             | 1 +
 configs/ls1043ardb_tfa_SECURE_BOOT_defconfig | 1 +
 configs/ls1043ardb_tfa_defconfig             | 1 +
 configs/ls1046afrwy_tfa_defconfig            | 2 ++
 configs/ls1046aqds_defconfig                 | 1 +
 configs/ls1046aqds_tfa_SECURE_BOOT_defconfig | 1 +
 configs/ls1046aqds_tfa_defconfig             | 1 +
 configs/ls1046ardb_tfa_SECURE_BOOT_defconfig | 2 ++
 configs/ls1046ardb_tfa_defconfig             | 2 ++
 configs/ls1088aqds_tfa_defconfig             | 1 +
 configs/ls1088ardb_tfa_SECURE_BOOT_defconfig | 2 ++
 configs/ls1088ardb_tfa_defconfig             | 2 ++
 13 files changed, 18 insertions(+)
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig +1 -0
index 3edc466e41..80d14be7eb 100644
@@ -37,6 +37,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1043aqds_tfa_defconfig +1 -0
index 1a51ba3826..58369dae4b 100644
@@ -43,6 +43,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1043ardb_tfa_SECURE_BOOT_defconfig +1 -0
index bdf2dc7d93..6a81c87299 100644
@@ -30,6 +30,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1043ardb_tfa_defconfig +1 -0
index 27b068c330..10294d47e5 100644
@@ -33,6 +33,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1046afrwy_tfa_defconfig +2 -0
index 1d27408762..5f72370571 100644
@@ -33,6 +33,8 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_STMICRO=y
configs/ls1046aqds_defconfig +1 -0
index ebbb3e3184..82ce0a6119 100644
@@ -37,6 +37,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1046aqds_tfa_SECURE_BOOT_defconfig +1 -0
index 7863c1ed0e..51bec73a17 100644
@@ -38,6 +38,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1046aqds_tfa_defconfig +1 -0
index 17d67c544a..625397c63d 100644
@@ -43,6 +43,7 @@ CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig +2 -0
index 9423d7db22..0d317ab149 100644
@@ -31,6 +31,8 @@ CONFIG_DM=y
 CONFIG_SATA_CEVA=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
configs/ls1046ardb_tfa_defconfig +2 -0
index 1aca8ef13e..104bc45e9b 100644
@@ -33,6 +33,8 @@ CONFIG_SATA_CEVA=y
 CONFIG_FSL_CAAM=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
configs/ls1088aqds_tfa_defconfig +1 -0
index 27f55a1025..49a8af5f08 100644
@@ -46,6 +46,7 @@ CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC=y
 CONFIG_MTD=y
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_SYS_FLASH_CFI=y
configs/ls1088ardb_tfa_SECURE_BOOT_defconfig +2 -0
index 45df1347fa..27640ead0a 100644
@@ -61,6 +61,8 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
 CONFIG_USB_XHCI_HCD=y
configs/ls1088ardb_tfa_defconfig +2 -0
index b7c40a4d6c..823ab7a6e9 100644
@@ -48,6 +48,8 @@ CONFIG_SPI_FLASH=y
 # CONFIG_SPI_FLASH_BAR is not set
 CONFIG_SPI_FLASH_SPANSION=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_E1000=y
 CONFIG_MII=y
 CONFIG_PCI=y
Signature · 1 line
2.20.1
#38 lore raw

PATCH v5 18/26 configs: ls104x/ls108x/ls208x: Build the raw NAND core with TFABOOT

Quoted 5 lines · Miquel Raynal

Enabling TFABOOT configuration will compile-in a call to nand_read in the boot sequence. Handle the situation by also selecting officially the raw NAND core in this case.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/0abb5ef5/attachment.sig>
author maintainer
#39 lore raw

PATCH v5 19/26 mtd: nand: add includes in NAND core to avoid warnings

In reply to Miquel Raynal

Because of the include's game, when some files are compiled for a SPI NAND device, no warning appears. But when it is for a raw NAND device, GCC complains. Fix these warning by including <common.h>.

---
 drivers/mtd/nand/bbt.c  | 1 +
 drivers/mtd/nand/core.c | 1 +
 2 files changed, 2 insertions(+)
drivers/mtd/nand/bbt.c +1 -0
index 7e0ad3190c..f3d05e6757 100644
@@ -9,6 +9,7 @@
 
 #define pr_fmt(fmt)	"nand-bbt: " fmt
 
+#include <common.h>
 #include <linux/mtd/nand.h>
 #ifndef __UBOOT__
 #include <linux/slab.h>
drivers/mtd/nand/core.c +1 -0
index 0b793695cc..3abaef23c5 100644
@@ -9,6 +9,7 @@
 
 #define pr_fmt(fmt)	"nand: " fmt
 
+#include <common.h>
 #ifndef __UBOOT__
 #include <linux/module.h>
 #endif
Signature · 1 line
2.20.1
#40 lore raw

PATCH v5 19/26 mtd: nand: add includes in NAND core to avoid warnings

Quoted 6 lines · Miquel Raynal

Because of the include's game, when some files are compiled for a SPI NAND device, no warning appears. But when it is for a raw NAND device, GCC complains. Fix these warning by including <common.h>.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/8dae1361/attachment.sig>
author maintainer
#41 lore raw

PATCH v5 20/26 dfu: add dependency on the raw NAND core

In reply to Miquel Raynal

CONFIG_DFU_NAND needs the raw NAND core being compiled.

Also fix the colibri_vf defconfig to reflect this dependency.

---
 configs/colibri_vf_defconfig | 1 +
 drivers/dfu/Kconfig          | 1 +
 2 files changed, 2 insertions(+)
configs/colibri_vf_defconfig +1 -0
index f657ccf659..63494b7509 100644
@@ -64,6 +64,7 @@ CONFIG_NAND_VF610_NFC=y
 CONFIG_NAND_VF610_NFC_DT=y
 CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES=y
 CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_PHYLIB=y
drivers/dfu/Kconfig +1 -0
index 4692736c9d..5ee260913c 100644
@@ -31,6 +31,7 @@ config DFU_MMC
 config DFU_NAND
 	bool "NAND back end for DFU"
 	depends on CMD_MTDPARTS
+	depends on MTD_RAW_NAND
 	help
 	  This option enables using DFU to read and write to NAND based
 	  storage.
Signature · 1 line
2.20.1
#42 lore raw

PATCH v5 20/26 dfu: add dependency on the raw NAND core

Quoted 6 lines · Miquel Raynal

CONFIG_DFU_NAND needs the raw NAND core being compiled.

Also fix the colibri_vf defconfig to reflect this dependency.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/7eeb7a9b/attachment.sig>
author maintainer
#43 lore raw

PATCH v5 21/26 mtd: nor: NOR flashes depend on MTD

In reply to Miquel Raynal

A NOR flash needs the MTD core, ensure this dependency is met by adding a "depends on" in Kconfig. This is fine since defconfigs have been fixed.

---
 drivers/mtd/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/Kconfig +1 -0
index 345046c2a6..0832f5b411 100644
@@ -19,6 +19,7 @@ config DM_MTD
 
 config MTD_NOR_FLASH
 	bool "Enable parallel NOR flash support"
+	depends on MTD
 	help
 	  Enable support for parallel NOR flash.
 
Signature · 1 line
2.20.1
#44 lore raw

PATCH v5 21/26 mtd: nor: NOR flashes depend on MTD

Quoted 5 lines · Miquel Raynal

A NOR flash needs the MTD core, ensure this dependency is met by adding a "depends on" in Kconfig. This is fine since defconfigs have been fixed.

This is not correct and has been dropped (same comment as before about mtdcore.o / mtd_uboot.o inclusion).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/53bbd785/attachment.sig>
author maintainer
#45 lore raw

PATCH v5 22/26 mtd: spi: SPI_FLASH_MTD depends on MTD

In reply to Miquel Raynal

It is already the case that all defconfigs with SPI_FLASH_MTD also declare using MTD, but let's make this consistent and enforce it in Kconfig. Most of the time SPI_FLASH_MTD is used in conjunction with UBI, which already depends on MTD.

---
 drivers/mtd/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/Kconfig +1 -1
index d3b007a731..c0f383ab4a 100644
@@ -186,7 +186,7 @@ config SPI_FLASH_DATAFLASH
 
 config SPI_FLASH_MTD
 	bool "SPI Flash MTD support"
-	depends on SPI_FLASH
+	depends on SPI_FLASH && MTD
 	help
           Enable the MTD support for spi flash layer, this adapter is for
 	  translating mtd_read/mtd_write commands into spi_flash_read/write
Signature · 1 line
2.20.1
#46 lore raw

PATCH v5 22/26 mtd: spi: SPI_FLASH_MTD depends on MTD

Quoted 7 lines · Miquel Raynal

It is already the case that all defconfigs with SPI_FLASH_MTD also declare using MTD, but let's make this consistent and enforce it in Kconfig. Most of the time SPI_FLASH_MTD is used in conjunction with UBI, which already depends on MTD.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/4918cd53/attachment.sig>
author maintainer
#47 lore raw

PATCH v5 23/26 cmd: mtdparts: Kconfig: join mtdparts command entry with its options

In reply to Miquel Raynal

Move the Kconfig entry of the option right after the entry of the mtdparts command.

---
 cmd/Kconfig | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
cmd/Kconfig +14 -14
index bcfbbb4fc6..33adf29a96 100644
@@ -1903,20 +1903,6 @@ config CMD_MTDPARTS
 	  declare the partitions in the mtdparts environment variable
 	  but better use the MTD stack and the 'mtd' command instead.
 
-config MTDIDS_DEFAULT
-	string "Default MTD IDs"
-	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
-	help
-	  Defines a default MTD IDs list for use with MTD partitions in the
-	  Linux MTD command line partitions format.
-
-config MTDPARTS_DEFAULT
-	string "Default MTD partition scheme"
-	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
-	help
-	  Defines a default MTD partitioning scheme in the Linux MTD command
-	  line partitions format
-
 config CMD_MTDPARTS_SPREAD
 	bool "Padd partition size to take account of bad blocks"
 	depends on CMD_MTDPARTS
@@ -1927,6 +1913,20 @@ config CMD_MTDPARTS_SPREAD
 	  at least as large as the size specified in the mtdparts variable and
 	  2) each partition starts on a good block.
 
+config MTDIDS_DEFAULT
+	string "Default MTD IDs"
+	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+	help
+	  Defines a default MTD IDs list for use with MTD partitions in the
+	  Linux MTD command line partitions format.
+
+config MTDPARTS_DEFAULT
+	string "Default MTD partition scheme"
+	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+	help
+	  Defines a default MTD partitioning scheme in the Linux MTD command
+	  line partitions format
+
 config CMD_REISER
 	bool "reiser - Access to reiserfs filesystems"
 	help
Signature · 1 line
2.20.1
#48 lore raw

PATCH v5 23/26 cmd: mtdparts: Kconfig: join mtdparts command entry with its options

Quoted 4 lines · Miquel Raynal

Move the Kconfig entry of the option right after the entry of the mtdparts command.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/36a59707/attachment.sig>
author maintainer
#49 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

In reply to Miquel Raynal

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------
 include/linux/mtd/mtd.h |  6 ---
 7 files changed, 120 insertions(+), 100 deletions(-)
 create mode 100644 cmd/legacy-mtd-utils.c
 create mode 100644 cmd/legacy-mtd-utils.h
cmd/Makefile +3 -0
index ac843b4b16..88b77c9f78 100644
@@ -97,6 +97,9 @@ obj-$(CONFIG_CMD_MMC) += mmc.o
 obj-$(CONFIG_MP) += mp.o
 obj-$(CONFIG_CMD_MTD) += mtd.o
 obj-$(CONFIG_CMD_MTDPARTS) += mtdparts.o
+ifneq ($(CONFIG_CMD_NAND)$(CONFIG_CMD_SF),)
+obj-y += legacy-mtd-utils.o
+endif
 obj-$(CONFIG_CMD_NAND) += nand.o
 obj-$(CONFIG_CMD_NET) += net.o
 obj-$(CONFIG_CMD_NVEDIT_EFI) += nvedit_efi.o
cmd/legacy-mtd-utils.c new file +99 -0

99 lines not on this page · raw message

cmd/legacy-mtd-utils.h new file +14 -0
new file mode 100644
index 0000000000..b31342bcb7
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef __LEGACY_MTD_UTILS_H
+#define __LEGACY_MTD_UTILS_H
+
+int get_part(const char *partname, int *idx, loff_t *off, loff_t *size,
+	     loff_t *maxsize, int devtype);
+int mtd_arg_off(const char *arg, int *idx, loff_t *off, loff_t *size,
+		loff_t *maxsize, int devtype, uint64_t chipsize);
+int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
+		     loff_t *size, loff_t *maxsize, int devtype,
+		     uint64_t chipsize);
+
+#endif /* LEGACY_MTD_UTILS_H */
cmd/nand.c +2 -0
index 27efef20bc..f40936cf68 100644
@@ -30,6 +30,8 @@
 #include <jffs2/jffs2.h>
 #include <nand.h>
 
+#include "legacy-mtd-utils.h"
+
 #if defined(CONFIG_CMD_MTDPARTS)
 
 /* partition handling routines */
cmd/sf.c +2 -0
index 6ccf98ae51..e993b3e5ad 100644
@@ -18,6 +18,8 @@
 #include <asm/io.h>
 #include <dm/device-internal.h>
 
+#include "legacy-mtd-utils.h"
+
 static struct spi_flash *flash;
 
 /*
drivers/mtd/mtd_uboot.c +0 -94

103 lines not on this page · raw message

include/linux/mtd/mtd.h +0 -6
index e3549f0a46..ceffd994de 100644
@@ -588,12 +588,6 @@ struct mtd_info *__mtd_next_device(int i);
 	     (mtd) != NULL;				\
 	     (mtd) = __mtd_next_device(mtd->index + 1))
 
-int mtd_arg_off(const char *arg, int *idx, loff_t *off, loff_t *size,
-		loff_t *maxsize, int devtype, uint64_t chipsize);
-int mtd_arg_off_size(int argc, char *const argv[], int *idx, loff_t *off,
-		     loff_t *size, loff_t *maxsize, int devtype,
-		     uint64_t chipsize);
-
 /* drivers/mtd/mtdcore.c */
 void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset,
 			  const uint64_t length, uint64_t *len_incl_bad,
Signature · 1 line
2.20.1
#50 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Quoted 12 lines · Miquel Raynal

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

Quoted 8 lines
---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

author maintainer
#51 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:44:38 +0530:

Quoted 22 lines · Miquel Raynal
Quoted 12 lines

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

Quoted 8 lines
---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------  
Quoted 2 lines

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

I don't understand what you mean. Can you please detail what you have in mind for this patch?

Is it something blocking for you? Or is it something that should be taken care of after?

Thanks,
Miquèl

#52 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Hi Miquel,

Quoted 28 lines · Miquel Raynal

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:44:38 +0530:

Quoted 22 lines · Miquel Raynal
Quoted 20 lines

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------
Quoted 8 lines
Quoted 2 lines

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

I don't understand what you mean. Can you please detail what you have in mind for this patch?

Is it something blocking for you? Or is it something that should be taken care of after?

I think it is simple rebase, this patch is moving code from mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm saying to make change on drivers/mtd/Makefile to drop SF, NAND dependency.

Jagan.

author maintainer
#53 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:57:36 +0530:

Quoted 37 lines

Hi Miquel,

Quoted 34 lines · Miquel Raynal

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:44:38 +0530:

Quoted 22 lines · Miquel Raynal
Quoted 12 lines

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

Quoted 8 lines
---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------  
Quoted 2 lines

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

I don't understand what you mean. Can you please detail what you have in mind for this patch?

Quoted 7 lines
Quoted 2 lines

Is it something blocking for you? Or is it something that should be taken care of after?

I think it is simple rebase, this patch is moving code from mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm saying to make change on drivers/mtd/Makefile to drop SF, NAND dependency.

What do you mean by "mtd_uboot still building"? Do you mean it is a problem? Or did I forgot something?

I don't see what CMD_SF/CMD_NAND dependency you are referring to. Can you please share a snippet of code?

Thanks,
Miquèl

#54 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Quoted 51 lines · Miquel Raynal

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:57:36 +0530:

Quoted 37 lines

Hi Miquel,

Quoted 34 lines · Miquel Raynal

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:44:38 +0530:

Quoted 22 lines · Miquel Raynal
Quoted 12 lines

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

Quoted 8 lines
---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------
Quoted 2 lines

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

I don't understand what you mean. Can you please detail what you have in mind for this patch?

Quoted 7 lines
Quoted 2 lines

Is it something blocking for you? Or is it something that should be taken care of after?

I think it is simple rebase, this patch is moving code from mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm saying to make change on drivers/mtd/Makefile to drop SF, NAND dependency.

Quoted 5 lines

What do you mean by "mtd_uboot still building"? Do you mean it is a problem? Or did I forgot something?

I don't see what CMD_SF/CMD_NAND dependency you are referring to. Can you please share a snippet of code?

-ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_SF)$(CONFIG_CMD_MTD))) +ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_MTD)))
obj-y += mtdcore.o mtd_uboot.o
endif
obj-$(CONFIG_MTD) += mtd-uclass.o

author maintainer
#55 lore raw

PATCH v5 24/26 cmd: nand/sf: isolate legacy code

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 15:16:38 +0530:

Quoted 58 lines · Miquel Raynal
Quoted 51 lines

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:57:36 +0530:

Quoted 37 lines

Hi Miquel,

Quoted 34 lines · Miquel Raynal

Hi Jagan,

Jagan Teki <[email protected]> wrote on Fri, 25 Oct 2019 14:44:38 +0530:

Quoted 22 lines · Miquel Raynal
Quoted 12 lines

The 'sf' command is not supposed to rely on the MTD stack, but both 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite their location, these functions do not depend at all on the MTD stack.

This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is selected, which is inconsistent with the current situation. Solve this by moving these three functions (which are only used by the above two commands) out of mtd_uboot.c and put them in a C file only compiled with cmd/sf.c and cmd/nand.c.

Quoted 8 lines
---
 cmd/Makefile            |  3 ++
 cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
 cmd/legacy-mtd-utils.h  | 14 ++++++
 cmd/nand.c              |  2 +
 cmd/sf.c                |  2 +
 drivers/mtd/mtd_uboot.c | 94 --------------------------------------  
Quoted 2 lines

Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build this file in this patch.

I don't understand what you mean. Can you please detail what you have in mind for this patch?

Quoted 7 lines
Quoted 2 lines

Is it something blocking for you? Or is it something that should be taken care of after?

I think it is simple rebase, this patch is moving code from mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm saying to make change on drivers/mtd/Makefile to drop SF, NAND dependency.

Quoted 5 lines

What do you mean by "mtd_uboot still building"? Do you mean it is a problem? Or did I forgot something?

I don't see what CMD_SF/CMD_NAND dependency you are referring to. Can you please share a snippet of code?

Quoted 7 lines

-ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_SF)$(CONFIG_CMD_MTD))) +ifneq (,$(findstring y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_MTD)))
obj-y += mtdcore.o mtd_uboot.o
endif
obj-$(CONFIG_MTD) += mtd-uclass.o

Indeed! Thanks for the clarification.
Please apply patches 1 to 23 of this series, I am resending 24-26 corrected.

Thanks,
Miquèl

author maintainer
#56 lore raw

PATCH v5 25/26 cmd: make MTD commands depend on MTD

In reply to Miquel Raynal

Defconfigs have been fixed, now we can add proper dependencies in Kconfig. SPI FLASH is still not dependent on MTD (deeper rework needed).

---
 cmd/Kconfig | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
cmd/Kconfig +7 -3
index 33adf29a96..01d4330e04 100644
@@ -799,6 +799,7 @@ config CMD_FDC
 config CMD_FLASH
 	bool "flinfo, erase, protect"
 	default y
+	depends on MTD
 	help
 	  NOR flash support.
 	    flinfo - print FLASH memory information
@@ -988,6 +989,7 @@ config CMD_MMC_SWRITE
 
 config CMD_MTD
 	bool "mtd"
+	depends on MTD
 	select MTD_PARTITIONS
 	help
 	  MTD commands support.
@@ -995,6 +997,7 @@ config CMD_MTD
 config CMD_NAND
 	bool "nand"
 	default y if NAND_SUNXI
+	depends on MTD_RAW_NAND
 	help
 	  NAND support.
 
@@ -1026,6 +1029,7 @@ config CMD_NVME
 
 config CMD_ONENAND
 	bool "onenand - access to onenand device"
+	depends on MTD
 	help
 	  OneNAND is a brand of NAND ('Not AND' gate) flash which provides
 	  various useful features. This command allows reading, writing,
@@ -1895,7 +1899,7 @@ config CMD_JFFS2
 
 config CMD_MTDPARTS
 	bool "MTD partition support"
-	select MTD if (CMD_NAND || NAND)
+	depends on MTD
 	help
 	  MTD partitioning tool support.
 	  It is strongly encouraged to avoid using this command
@@ -1915,14 +1919,14 @@ config CMD_MTDPARTS_SPREAD
 
 config MTDIDS_DEFAULT
 	string "Default MTD IDs"
-	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+	depends on MTD || SPI_FLASH
 	help
 	  Defines a default MTD IDs list for use with MTD partitions in the
 	  Linux MTD command line partitions format.
 
 config MTDPARTS_DEFAULT
 	string "Default MTD partition scheme"
-	depends on MTD_PARTITIONS || CMD_MTDPARTS || CMD_NAND || CMD_FLASH
+	depends on MTD || SPI_FLASH
 	help
 	  Defines a default MTD partitioning scheme in the Linux MTD command
 	  line partitions format
Signature · 1 line
2.20.1
author maintainer
#57 lore raw

PATCH v5 26/26 mtd: Makefile: deep cleanup

In reply to Miquel Raynal

Move MTD-related lines out of the root Makefile. Put them in their respective directories. Enclose some of these new lines to skip them when building the SPL. MTD core files and some MTD device drivers are compiled in a mtd.o object and included in the final object only if MTD support is required (there are two different symbols for that, one for U-Boot and one for the SPL).

Now that all defconfigs have been fixed, we can stop the logic where enabling a command selects the core files to compile. This logic is broken since selecting a symbol with a 'depends on' will not enforce this secondary dependency.

---
 Makefile                  |  5 ----
 drivers/Makefile          |  7 ++----
 drivers/mtd/Makefile      | 50 +++++++++++++++++++++++++++------------
 drivers/mtd/nand/Makefile |  5 ++++
 4 files changed, 42 insertions(+), 25 deletions(-)
Makefile +0 -5
index 1d9ade948b..e55c0b236e 100644
@@ -708,11 +708,6 @@ libs-y += drivers/
 libs-y += drivers/dma/
 libs-y += drivers/gpio/
 libs-y += drivers/i2c/
-libs-y += drivers/mtd/
-libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/
-libs-y += drivers/mtd/onenand/
-libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/
-libs-y += drivers/mtd/spi/
 libs-y += drivers/net/
 libs-y += drivers/net/phy/
 libs-y += drivers/power/ \
drivers/Makefile +2 -5
index a4bb5e4975..708aa2a1a7 100644
@@ -11,7 +11,7 @@ obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/
 obj-$(CONFIG_$(SPL_TPL_)INPUT) += input/
 obj-$(CONFIG_$(SPL_TPL_)LED) += led/
 obj-$(CONFIG_$(SPL_TPL_)MMC_SUPPORT) += mmc/
-obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += mtd/nand/raw/
+obj-y += mtd/
 obj-$(CONFIG_$(SPL_TPL_)PCH_SUPPORT) += pch/
 obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/
 obj-$(CONFIG_$(SPL_TPL_)PHY) += phy/
@@ -19,7 +19,6 @@ obj-$(CONFIG_$(SPL_TPL_)PINCTRL) += pinctrl/
 obj-$(CONFIG_$(SPL_TPL_)RAM) += ram/
 obj-$(CONFIG_$(SPL_TPL_)RTC_SUPPORT) += rtc/
 obj-$(CONFIG_$(SPL_TPL_)SERIAL_SUPPORT) += serial/
-obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPORT) += mtd/spi/
 obj-$(CONFIG_$(SPL_TPL_)SPI_SUPPORT) += spi/
 obj-$(CONFIG_$(SPL_TPL_)TIMER) += timer/
 obj-$(CONFIG_$(SPL_TPL_)VIRTIO) += virtio/
@@ -42,9 +41,6 @@ obj-$(CONFIG_SPL_POWER_SUPPORT) += power/ power/pmic/
 obj-$(CONFIG_SPL_POWER_SUPPORT) += power/regulator/
 obj-$(CONFIG_SPL_POWER_DOMAIN) += power/domain/
 obj-$(CONFIG_SPL_DM_RESET) += reset/
-obj-$(CONFIG_SPL_MTD_SUPPORT) += mtd/
-obj-$(CONFIG_SPL_ONENAND_SUPPORT) += mtd/onenand/
-obj-$(CONFIG_SPL_UBI) += mtd/ubispl/
 obj-$(CONFIG_SPL_DMA_SUPPORT) += dma/
 obj-$(CONFIG_SPL_ETH_SUPPORT) += net/
 obj-$(CONFIG_SPL_ETH_SUPPORT) += net/phy/
@@ -102,6 +98,7 @@ obj-$(CONFIG_QE) += qe/
 obj-$(CONFIG_U_QE) += qe/
 obj-y += mailbox/
 obj-y += memory/
+obj-y += mtd/
 obj-y += pwm/
 obj-y += reset/
 obj-y += input/
drivers/mtd/Makefile +35 -15

55 lines not on this page · raw message

drivers/mtd/nand/Makefile +5 -0
index a358bc680e..96e186600a 100644
@@ -1,5 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
 nandcore-objs := core.o bbt.o
 obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
+obj-$(CONFIG_MTD_RAW_NAND) += raw/
 obj-$(CONFIG_MTD_SPI_NAND) += spi/
+else
+obj-$(CONFIG_$(SPL_TPL_)NAND_SUPPORT) += raw/
+endif
Signature · 1 line
2.20.1
author maintainer
#58 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

In reply to Miquel Raynal

Hi Miquel,

Miquel Raynal <[email protected]> wrote on Thu, 3 Oct 2019 19:50:02 +0200:

Quoted 25 lines

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

Quoted 2 lines

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

And here is the missing link:

https://travis-ci.org/miquelraynal/u-boot/builds/592943849

Cheers,
Miquèl

author maintainer
#59 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

Hi Jagan,

Gentle ping.

As discussed half a year ago, please do not trash this series :)

Miquel Raynal <[email protected]> wrote on Thu, 3 Oct 2019 19:55:15 +0200:

Quoted 30 lines

Hi Miquel,

Miquel Raynal <[email protected]> wrote on Thu, 3 Oct 2019 19:50:02 +0200:

Quoted 25 lines

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

Quoted 7 lines
Quoted 2 lines

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

And here is the missing link:

https://travis-ci.org/miquelraynal/u-boot/builds/592943849

Thanks,
Miquèl

#60 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

Hi Miquel,

Quoted 6 lines · Miquel Raynal

Hi Jagan,

Gentle ping.

As discussed half a year ago, please do not trash this series :)

Please give us sometime, will update accordingly.

#61 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

Quoted 11 lines · Jagan Teki

Hi Miquel,

Quoted 6 lines · Miquel Raynal

Hi Jagan,

Gentle ping.

As discussed half a year ago, please do not trash this series :)

Please give us sometime, will update accordingly.

Would you object to me taking this and doing the size-check build and pushing if it's no-change? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191023/440ce2ae/attachment.sig>
#62 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

Quoted 8 lines · Tom Rini
Quoted 6 lines · Jagan Teki

Hi Miquel,

Quoted 3 lines · Miquel Raynal

Hi Jagan,

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Gentle ping.

As discussed half a year ago, please do not trash this series :)

Please give us sometime, will update accordingly.

Would you object to me taking this and doing the size-check build and pushing if it's no-change? Thanks!

Please wait till end of this weekend.

#63 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

In reply to Miquel Raynal
Quoted 114 lines · Miquel Raynal

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

Please note that the only red test fails because of timeout, not an actual error (at least I could not spot it). It is possible that this series will produce noticeable changes for the users. The only reason for that is because their configuration file was wrong. I have done my best to fix them one by one, but I am not omniscient.

Thanks,
Miquèl

Note: as the number of Cc:'ed people reached 184 with get_maintainers.pl I decided to trim the list to:
* People interested by the MTD subsystem.
* A few maintainers: I had to tweak some defconfigs after more digging than with other boards (k2g, bcm11130, M54418TWR, ls104/108/208). Maintainers of these platforms are Cc:'ed.

Changes since v4:
=================
* Rebased on top of v2019.10-rc4.
* Fixed tens of configurations that got broken since the last version of this series several months ago.
* Added a specific commit for ls104/108/208 configurations.

Changes since v3:
=================
* As suggested by Vignesh, SPI_FLASH_MTD depends on MTD. Enforce this in Kconfig with a new patch. There is no defconfig to fix, all defconfigs with SPI_FLASH_MTD already use MTD.
* s/coherent Makefile/appropriate Makefile/ in commit title of patch 1.
* s/Kconfig/Makefile in commit message of "mtd: nand: remove dependency on commands in Kconfig" and "mtd: ubi: remove dependency on command in Kconfig".
* Add Boris R-b tags.
* Correct typos pointed by Boris.
* Remove the if/endif in cmd/Kconfig about mtdparts, let the "depends on" that was already present.
* Use an if/endif block to compile legacy-mtd-utils.c (to avoid failures when both 'sf' and 'nand' commands are compiled-in).
* Merge all Makefile changes in one consistent commit as suggested by Boris.

Changes since v2:
=================
* Cleanup also applied to the SPL in an additional patch.
* NOR dependency on MTD extracted from the patch adding MTD dependencies on commands only to do it in a separate change.
* Typo s/copile/compile/ in "rename CONFIG_MTD_DEVICE..." commit log.
* No more MTD depencency on SPI_FLASH, only kept on SPI_FLASH_MTD.
* Same applies to the sf command.
* Avoid compiling the NAND core while it is not needed (not speaking about the raw NAND core, really what is in drivers/mtd/nand:).
* Last patch dropping CONFIG_MTD_PARTITIONS forgotten. We need them in order to reduce the final binary size.
* Additional fixes in cmd/Kconfig.

Changes since v1:
=================
* Squashed both patches from the first series and included them in "mtd: simplify Makefiles".
* Added all other patches.
* Renamed CONFIG_NAND into CONFIG_MTD_RAW_NAND as suggested.

Miquel Raynal (26):
mtd: rename CONFIG_NAND -> CONFIG_MTD_RAW_NAND
mtd: rename CONFIG_MTD -> CONFIG_DM_MTD
mtd: rename CONFIG_MTD_DEVICE -> CONFIG_MTD
mtd: ensure MTD is compiled when there is a NOR flash
mtd: ensure MTD/the raw NAND core are compiled when there is a NAND
flash
mtd: ensure MTD is compiled when there is a SPI NOR flash using MTD
mtd: ensure UBI is compiled when using fastmap
mtd: ensure MTD is compiled when UBI is used
mtd: ensure UBI is compiled when CMD_UBI is selected
mtd: ensure UBI is compiled when ENV_IS_IN_UBI is selected
mtd: ensure MTD_RAW_NAND is compiled when ENV_IS_IN_NAND is selected
mtd: ensure CMD_NAND is compiled when its options are selected
mtd: ensure MTD is compiled when CMD_MTDPARTS is selected
configs: move CONFIG_MTD in defconfigs when set in arch includes
configs: remove raw NAND core from k2g defconfigs
configs: remove MTD support from bcm11130 and M54418TWR defconfigs
configs: socfpga: mcvevk: Remove useless UBI infos
configs: ls104x/ls108x/ls208x: Build the raw NAND core with TFABOOT

Quoted 8 lines

mtd: nand: add includes in NAND core to avoid warnings
dfu: add dependency on the raw NAND core
mtd: nor: NOR flashes depend on MTD
mtd: spi: SPI_FLASH_MTD depends on MTD
cmd: mtdparts: Kconfig: join mtdparts command entry with its options
cmd: nand/sf: isolate legacy code
cmd: make MTD commands depend on MTD
mtd: Makefile: deep cleanup

Except 24/26 comments. all look fine to me.

#64 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

In reply to Miquel Raynal
Quoted 25 lines · Miquel Raynal

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

Quoted 8 lines

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

Please note that the only red test fails because of timeout, not an actual error (at least I could not spot it). It is possible that this series will produce noticeable changes for the users. The only reason for that is because their configuration file was wrong. I have done my best to fix them one by one, but I am not omniscient.

OK, so I want to grab this series, and I intend to do my best to do so. But the problem this exposes is just how complex the uses of CONFIG_NAND got and in turn symbol re-use, on PowerPC. This (+ v6) showed a few minor migration problems when I size compared, and those are easily fixed. What isn't so easily fixed is that it was also changing how/where the environment is found on some PowerPC boards. Fixing that in turn requires finally finishing off the migration of the main CONFIG_ENV_xxx symbols to Kconfig. I have this done outside of about 20 boards. I'm going to get that finished up as soon as I can and posted, then make this series depend on that. Thanks again for doing the hard work here, we really need this particular migration and clean up!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191030/0a5312ee/attachment.sig>
author maintainer
#65 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

Hi Tom,

Tom Rini <[email protected]> wrote on Wed, 30 Oct 2019 09:57:13 -0400:

Quoted 36 lines · Miquel Raynal
Quoted 26 lines

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

Quoted 8 lines

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

Please note that the only red test fails because of timeout, not an actual error (at least I could not spot it). It is possible that this series will produce noticeable changes for the users. The only reason for that is because their configuration file was wrong. I have done my best to fix them one by one, but I am not omniscient.

Quoted 12 lines

OK, so I want to grab this series, and I intend to do my best to do so. But the problem this exposes is just how complex the uses of CONFIG_NAND got and in turn symbol re-use, on PowerPC. This (+ v6) showed a few minor migration problems when I size compared, and those are easily fixed. What isn't so easily fixed is that it was also changing how/where the environment is found on some PowerPC boards. Fixing that in turn requires finally finishing off the migration of the main CONFIG_ENV_xxx symbols to Kconfig. I have this done outside of about 20 boards. I'm going to get that finished up as soon as I can and posted, then make this series depend on that. Thanks again for doing the hard work here, we really need this particular migration and clean up!

I see the problem, well, thanks for grabbing it, please keep us updated and do not hesitate if you need help.

Thanks,
Miquèl

#66 lore raw

v5 cover MTD defconfigs/Kconfigs/Makefiles heavy cleanup

In reply to Miquel Raynal
Quoted 113 lines · Miquel Raynal

Hello,

A year ago, while working on SPI-NAND support in U-Boot, I discovered when modifying Makefiles a confusing organization where:
* Sub-directories/files are compiled from the root Makefile
* Commands are at the root of everything

First I sent a series to move Makefile entries in their respective directories. Then, I decided to continue working on the clarification of the Makefile hierarchy in MTD and I sent four iterations of this series which did not got merge at that time. Anyway, I revived this series by rebasing all my work and updating everything that needed an update.

Here are the main points of the re-organization:
* Rename CONFIG_MTD into CONFIG_DM_MTD to reserve CONFIG_MTD to what is called today CONFIG_MTD_DEVICE.
* Fix build dependencies in defconfigs, like: "UBI and NAND depend on MTD".
* Fix the Kconfig files to reflect these dependencies (as defconfigs have been updated, nothing should break).
* Simplify the Makefiles: compiling the drivers/mtd/nand/raw/ sub-directory should just depend on MTD being compiled and the NAND core as well, there is absolutely no logic to make it depend on CMD_NAND.

The New green Travis CI build for the fifth version of this series is there (yes, 53 iterations):

Please note that the only red test fails because of timeout, not an actual error (at least I could not spot it). It is possible that this series will produce noticeable changes for the users. The only reason for that is because their configuration file was wrong. I have done my best to fix them one by one, but I am not omniscient.

Thanks,
Miquèl

Note: as the number of Cc:'ed people reached 184 with get_maintainers.pl I decided to trim the list to:
* People interested by the MTD subsystem.
* A few maintainers: I had to tweak some defconfigs after more digging than with other boards (k2g, bcm11130, M54418TWR, ls104/108/208). Maintainers of these platforms are Cc:'ed.

Changes since v4:
=================
* Rebased on top of v2019.10-rc4.
* Fixed tens of configurations that got broken since the last version of this series several months ago.
* Added a specific commit for ls104/108/208 configurations.

Changes since v3:
=================
* As suggested by Vignesh, SPI_FLASH_MTD depends on MTD. Enforce this in Kconfig with a new patch. There is no defconfig to fix, all defconfigs with SPI_FLASH_MTD already use MTD.
* s/coherent Makefile/appropriate Makefile/ in commit title of patch 1.
* s/Kconfig/Makefile in commit message of "mtd: nand: remove dependency on commands in Kconfig" and "mtd: ubi: remove dependency on command in Kconfig".
* Add Boris R-b tags.
* Correct typos pointed by Boris.
* Remove the if/endif in cmd/Kconfig about mtdparts, let the "depends on" that was already present.
* Use an if/endif block to compile legacy-mtd-utils.c (to avoid failures when both 'sf' and 'nand' commands are compiled-in).
* Merge all Makefile changes in one consistent commit as suggested by Boris.

Changes since v2:
=================
* Cleanup also applied to the SPL in an additional patch.
* NOR dependency on MTD extracted from the patch adding MTD dependencies on commands only to do it in a separate change.
* Typo s/copile/compile/ in "rename CONFIG_MTD_DEVICE..." commit log.
* No more MTD depencency on SPI_FLASH, only kept on SPI_FLASH_MTD.
* Same applies to the sf command.
* Avoid compiling the NAND core while it is not needed (not speaking about the raw NAND core, really what is in drivers/mtd/nand:).
* Last patch dropping CONFIG_MTD_PARTITIONS forgotten. We need them in order to reduce the final binary size.
* Additional fixes in cmd/Kconfig.

Changes since v1:
=================
* Squashed both patches from the first series and included them in "mtd: simplify Makefiles".
* Added all other patches.
* Renamed CONFIG_NAND into CONFIG_MTD_RAW_NAND as suggested.

Miquel Raynal (26):
mtd: rename CONFIG_NAND -> CONFIG_MTD_RAW_NAND
mtd: rename CONFIG_MTD -> CONFIG_DM_MTD
mtd: rename CONFIG_MTD_DEVICE -> CONFIG_MTD
mtd: ensure MTD is compiled when there is a NOR flash
mtd: ensure MTD/the raw NAND core are compiled when there is a NAND
flash
mtd: ensure MTD is compiled when there is a SPI NOR flash using MTD
mtd: ensure UBI is compiled when using fastmap
mtd: ensure MTD is compiled when UBI is used
mtd: ensure UBI is compiled when CMD_UBI is selected
mtd: ensure UBI is compiled when ENV_IS_IN_UBI is selected
mtd: ensure MTD_RAW_NAND is compiled when ENV_IS_IN_NAND is selected
mtd: ensure CMD_NAND is compiled when its options are selected
mtd: ensure MTD is compiled when CMD_MTDPARTS is selected
configs: move CONFIG_MTD in defconfigs when set in arch includes
configs: remove raw NAND core from k2g defconfigs
configs: remove MTD support from bcm11130 and M54418TWR defconfigs
configs: socfpga: mcvevk: Remove useless UBI infos
configs: ls104x/ls108x/ls208x: Build the raw NAND core with TFABOOT

Quoted 8 lines

mtd: nand: add includes in NAND core to avoid warnings
dfu: add dependency on the raw NAND core
mtd: nor: NOR flashes depend on MTD
mtd: spi: SPI_FLASH_MTD depends on MTD
cmd: mtdparts: Kconfig: join mtdparts command entry with its options
cmd: nand/sf: isolate legacy code
cmd: make MTD commands depend on MTD
mtd: Makefile: deep cleanup

So, a feature of this series is that it exposes a problem of the following PowerPC configurations:
P1022DS P1022DS_SDCARD P1022DS_SPIFLASH P1022DS_36BIT_SPIFLASH P1022DS_36BIT P1022DS_36BIT_SDCARD T4240QDS_SRIO_PCIE_BOOT T4240QDS_SDCARD T4160QDS_SECURE_BOOT T4160QDS T4240QDS T4160QDS_SDCARD T4240QDS_SECURE_BOOT B4860QDS_SECURE_BOOT T4160RDB B4420QDS B4860QDS B4860QDS_SRIO_PCIE_BOOT B4860QDS_SPIFLASH B4420QDS_SPIFLASH T4240RDB_SDCARD T4240RDB P1025RDB_SPIFLASH P1025RDB_SDCARD P1024RDB_SPIFLASH P1025RDB P1024RDB_SDCARD P1024RDB P1024RDB_36BIT P1025RDB_36BIT P5020DS_SECURE_BOOT P3041DS_SRIO_PCIE_BOOT P3041DS_SECURE_BOOT P5020DS_SDCARD P5020DS P5020DS_SRIO_PCIE_BOOT P5020DS_SPIFLASH P5040DS_SECURE_BOOT P2041RDB_SECURE_BOOT P2041RDB_SRIO_PCIE_BOOT P1021RDB-PC_SPIFLASH P1021RDB-PC P1021RDB-PC_SDCARD P1021RDB-PC_36BIT_SPIFLASH P1021RDB-PC_36BIT_SDCARD P1021RDB-PC_36BIT P1020RDB-PC_SDCARD P1020RDB-PC_SPIFLASH P1020RDB-PC P1020RDB-PC_36BIT_SPIFLASH P1020RDB-PC_36BIT_SDCARD P1020RDB-PC_36BIT P5040DS_SDCARD P3041DS_SPIFLASH P3041DS_SDCARD P5040DS P5040DS_SPIFLASH P2041RDB P2041RDB_SDCARD P2041RDB_SPIFLASH P3041DS P1020RDB-PD_SDCARD P2020RDB-PC_SPIFLASH P1020RDB-PD P2020RDB-PC P2020RDB-PC_SDCARD P1020RDB-PD_SPIFLASH P2020RDB-PC_36BIT P2020RDB-PC_36BIT_SPIFLASH P2020RDB-PC_36BIT_SDCARD C29XPCIE_NOR_SECBOOT C29XPCIE_SPIFLASH C29XPCIE_SPIFLASH_SECBOOT C29XPCIE BSC9132QDS_SDCARD_DDRCLK133_SECURE BSC9132QDS_NOR_DDRCLK133_SECURE BSC9132QDS_SDCARD_DDRCLK100_SECURE BSC9132QDS_NOR_DDRCLK100_SECURE BSC9132QDS_SPIFLASH_DDRCLK133_SECURE BSC9132QDS_SPIFLASH_DDRCLK100_SECURE BSC9132QDS_NOR_DDRCLK100 BSC9132QDS_SPIFLASH_DDRCLK133 BSC9132QDS_NAND_DDRCLK133_SECURE BSC9132QDS_NOR_DDRCLK133 BSC9132QDS_SDCARD_DDRCLK100 BSC9132QDS_SPIFLASH_DDRCLK100 BSC9132QDS_NAND_DDRCLK100_SECURE BSC9132QDS_SDCARD_DDRCLK133 P1010RDB-PA_SPIFLASH_SECBOOT P1010RDB-PA_NAND_SECBOOT P1010RDB-PA_SPIFLASH P1010RDB-PA_NOR P1010RDB-PA_SDCARD BSC9131RDB_SPIFLASH_SYSCLK100 BSC9131RDB_SPIFLASH P1010RDB-PA_36BIT_SPIFLASH P1010RDB-PA_36BIT_NOR_SECBOOT P1010RDB-PA_36BIT_NOR_SECBOOT P1010RDB-PA_36BIT_SPIFLASH_SECBOOT P1010RDB-PA_36BIT_SDCARD P1010RDB-PA_36BIT_NAND_SECBOOT T2081QDS_SRIO_PCIE_BOOT T2080RDB_SRIO_PCIE_BOOT T1024QDS_DDR4 T2081QDS T1042RDB T1040RDB_SDCARD T1040RDB T2081QDS_SPIFLASH T1042RDB_PI_SDCARD T1042D4RDB_SECURE_BOOT T1023RDB_SECURE_BOOT T1023RDB T1040RDB_SPIFLASH T1040D4RDB_SDCARD T1023RDB_SDCARD T1042RDB_PI T1040D4RDB T2081QDS_SDCARD T2080RDB_SECURE_BOOT T1042RDB_PI_SPIFLASH T1023RDB_SPIFLASH T1040D4RDB_SPIFLASH T1040QDS_SECURE_BOOT T1040QDS T1024QDS_DDR4_SECURE_BOOT T1040QDS_DDR4 T1024QDS_SDCARD T1024QDS T1024QDS_SECURE_BOOT T1024RDB_SECURE_BOOT T1040D4RDB_SECURE_BOOT T1040RDB_SECURE_BOOT T1042RDB_SECURE_BOOT T1024QDS_SPIFLASH T2080QDS_SRIO_PCIE_BOOT P1010RDB-PB_SPIFLASH_SECBOOT P1010RDB-PB_NOR_SECBOOT P1010RDB-PB_SDCARD P1010RDB-PB_NAND_SECBOOT P1010RDB-PB_SPIFLASH P1010RDB-PB_NOR P1010RDB-PB_36BIT_NOR P1010RDB-PB_36BIT_NAND_SECBOOT P1010RDB-PB_36BIT_SPIFLASH_SECBOOT P1010RDB-PB_36BIT_SDCARD P1010RDB-PB_36BIT_NOR_SECBOOT P1010RDB-PB_36BIT_SPIFLASH T2080QDS_SECURE_BOOT T1042D4RDB T1042D4RDB_SDCARD T2080RDB_SDCARD T2080RDB T1042D4RDB_SPIFLASH T2080RDB_SPIFLASH T1024RDB_SDCARD T1024RDB T1024RDB_SPIFLASH T2080QDS_SDCARD T2080QDS_SPIFLASH T2080QDS P1010RDB-PA_NOR_SECBOOT

And that is that before this series they do not fully enable NAND support normally but do enable it partially and do enable CMD_NAND. After this series they do not enable CMD_NAND. This is because if I do enable CMD_NAND instead we see a large number of other changes wrt things such as CONFIG_SYS_AMASK0/CONFIG_SYS_AMASK1 and change those configs from pointing at NOR to pointing at NAND and that seems the larger functional regression over removing the nand command. If the NAND command really should be on in these boards then we do need to figure out or otherwise rework the config files such that the rest of the board functions the intended way still.

Also note that while there are a few *_NAND_* configs in that list, investigation of the u-boot.cfg files shows that enabling CONFIG_MTD_RAW_NAND (formerly CONFIG_NAND) leads to the other functional changes noted above. My assumption currently is that those *_NAND_* boards above have a latent bug that is now exposed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20191204/9c8cc262/attachment.sig>