[U-Boot] [PATCH v4 10/25] mtd: ensure UBI is compiled when ENV_IS_IN_UBI is selected

Miquel Raynal miquel.raynal at bootlin.com
Sun Dec 9 18:07:32 UTC 2018


UBI must be enabled when the environment is in UBI.

Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon at bootlin.com>
---
 configs/CHIP_pro_defconfig | 2 ++
 env/Kconfig                | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index 7f8bd0f00e..5c2880c960 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -8,6 +8,7 @@ CONFIG_NR_DRAM_BANKS=1
 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"
@@ -17,6 +18,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
diff --git a/env/Kconfig b/env/Kconfig
index 9011109b47..71a14a0967 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -340,6 +340,8 @@ config ENV_IS_IN_SPI_FLASH
 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
-- 
2.19.1



More information about the U-Boot mailing list