[U-Boot] [PATCH] cmd: fastboot: Kconfig: solve config issue

Patrick Delaunay patrick.delaunay at st.com
Thu Dec 7 17:26:17 UTC 2017


When FASTBOOT is activated, only one the supported device is supported in
code at the same time
- CONFIG_FASTBOOT_FLASH_MMC_DEV
- CONFIG_FASTBOOT_FLASH_NAND_DEV

But Today the choice is not exclusive in Kconfig
and that cause Kconfig issue when :
- CONFIG_FASTBOOT, CONFIG_MMC, CONFIG_NAND are activated
- CONFIG_FASTBOOT_FLASH_MMC_DEV = 0
- CONFIG_FASTBOOT_FLASH_NAND_DEV is not activated

The patch add a choice in Kconfig to select the FLASH provider
- CONFIG_FASTBOOT_FLASH_MMC
- CONFIG_FASTBOOT_FLASH_NAND

Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

I execute buildman execute on board with CONFIG_FASTBOOT
on label v2018.01-rc1
=> no new error

board list =
A13-OLinuXino A20-OLinuXino-Lime2 A20-OLinuXino-Lime2-eMMC
am335x_boneblack am335x_boneblack_vboot am335x_evm am335x_evm_norboot
am335x_evm_nor am335x_evm_spiboot am335x_evm_usbspl am57xx_evm
am57xx_evm_nodt am57xx_hs_evm bcm23550_w1d bcm28155_ap birdland_bav335a
birdland_bav335b cgtqmx6eval CHIP CHIP_pro chromebit_mickey
chromebook_jerry chromebook_minnie Cubietruck dra7xx_evm dra7xx_hs_evm
evb-rk3036 evb-rk3229 evb-rk3288 evb-rk3328 evb-rv1108 fennec-rk3288
firefly-rk3288 kc1 kylin-rk3036 miqi-rk3288 mx6qsabrelite
Nintendo_NES_Classic_Edition nitrogen6dl2g nitrogen6dl nitrogen6q2g
nitrogen6q nitrogen6s1g nitrogen6s omap3_beagle omap3_logic parrot_r16
phycore-rk3288 popmetal-rk3288 rock2 Sinlinx_SinA33 sniper stih410-b2260
stm32mp15_basic stm32mp15_fpga_basic stm32mp15_fpga_trusted
stm32mp15_trusted tinker-rk3288 xilinx_zynqmp_ep
xilinx_zynqmp_zc1751_xm015_dc1 xilinx_zynqmp_zc1751_xm016_dc2
xilinx_zynqmp_zcu102_revA xilinx_zynqmp_zcu102_revB


the modified configuration seems OK :
$> tools/buildman/buildman -sdeSK

A13-OLinuXino A20-OLinuXino-Lime2 A20-OLinuXino-Lime2-eMMC Cubietruck
Sinlinx_SinA33 am57xx_evm am57xx_hs_evm chromebit_mickey chromebook_jerry
chromebook_minnie dra7xx_evm dra7xx_hs_evm evb-rk3036 evb-rk3229
evb-rk3288 fennec-rk3288 firefly-rk3288 kc1 kylin-rk3036 miqi-rk3288
parrot_r16 phycore-rk3288 popmetal-rk3288 rock2 sniper tinker-rk3288
xilinx_zynqmp_ep xilinx_zynqmp_zc1751_xm015_dc1 xilinx_zynqmp_zcu102_revA
xilinx_zynqmp_zcu102_revB :
   + u-boot.cfg: CONFIG_FASTBOOT_FLASH_MMC=1
   + u-boot-spl.cfg: CONFIG_FASTBOOT_FLASH_MMC=1
   + all: CONFIG_FASTBOOT_FLASH_MMC=1
CHIP_pro xilinx_zynqmp_zc1751_xm016_dc2 :
   + u-boot.cfg: CONFIG_FASTBOOT_FLASH_NAND=1
   + u-boot-spl.cfg: CONFIG_FASTBOOT_FLASH_NAND=1
   + all: CONFIG_FASTBOOT_FLASH_NAND=1
bcm23550_w1d bcm28155_ap evb-rk3328 evb-rv1108 stih410-b2260 :
   + u-boot.cfg: CONFIG_FASTBOOT_FLASH_MMC=1
   + all: CONFIG_FASTBOOT_FLASH_MMC=1

and I test on my custom board (with MMC + NAND + FASTBOOT)
the .config is now OK, MMC is selected by default and
NAND_DEV is not requested


 cmd/fastboot/Kconfig | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig
index 4ce7a77..aaf3d78 100644
--- a/cmd/fastboot/Kconfig
+++ b/cmd/fastboot/Kconfig
@@ -71,9 +71,23 @@ config FASTBOOT_FLASH
 	  the downloaded image to a non-volatile storage device. Define
 	  this to enable the "fastboot flash" command.
 
+choice
+	prompt "Flash provider for FASTBOOT"
+	depends on FASTBOOT_FLASH
+
+config FASTBOOT_FLASH_MMC
+	bool "FASTBOOT on MMC"
+	depends on MMC
+
+config FASTBOOT_FLASH_NAND
+	bool "FASTBOOT on NAND"
+	depends on NAND
+
+endchoice
+
 config FASTBOOT_FLASH_MMC_DEV
 	int "Define FASTBOOT MMC FLASH default device"
-	depends on FASTBOOT_FLASH && MMC
+	depends on FASTBOOT_FLASH_MMC
 	default 0 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
 	default 1 if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
 	help
@@ -83,7 +97,7 @@ config FASTBOOT_FLASH_MMC_DEV
 
 config FASTBOOT_FLASH_NAND_DEV
 	int "Define FASTBOOT NAND FLASH default device"
-	depends on FASTBOOT_FLASH && NAND
+	depends on FASTBOOT_FLASH_NAND
 	depends on CMD_MTDPARTS
 	default 0 if ARCH_SUNXI && NAND_SUNXI
 	help
-- 
2.7.4



More information about the U-Boot mailing list