From de86fc3859f9c9ae26faed6f9d8fc115e1329b4f Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 23 Aug 2017 10:12:22 +0200 Subject: sunxi: Remove the MMC index hack The current code, if there's both an eMMC and an MMC slot available on the board, will swap the MMC indices based on whether we booted from the eMMC or the MMC. This way, the MMC we're supposed to boot on will always have the index 0. However, this causes various issues, for example when using other components that base their behaviour on the MMC index, such as fastboot. Let's remove that hack, and take the opposite approach. The MMC will always have the same index, but the bootcmd will pick the same device than the one we booted from. This is done through the introduction of the mmc_bootdev environment variable that will be filled by the board code based on the boot device informations we can get from the SoC. In order to not introduce regressions, we also need to adjust the fastboot MMC device and the environment device in order to set it to the eMMC, over the MMC, like it used to be the case. Tested-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard --- cmd/fastboot/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd/fastboot') diff --git a/cmd/fastboot/Kconfig b/cmd/fastboot/Kconfig index 7330da216a..214bbc23fc 100644 --- a/cmd/fastboot/Kconfig +++ b/cmd/fastboot/Kconfig @@ -74,6 +74,8 @@ config FASTBOOT_FLASH config FASTBOOT_FLASH_MMC_DEV int "Define FASTBOOT MMC FLASH default device" 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 The fastboot "flash" command requires additional information regarding the non-volatile storage device. Define this to -- cgit v1.2.3