Skip to contentSkip to conversation

rockchip: Fix MMC boot order

PATCH In review Alex Bee 2 participants 2 messages Jun 17, 2021 – Jun 18, 2021 Arm Rockchip

lore
Share & tools
lore

Alex Bee

author
#0 lore raw

PATCH 1/1 rockchip: Fix MMC boot order

Basically all, i.e. rk3036.dtsi, rk3128.dtsi, rk3xxx.dtsi, rk322x.dtsi, rk3288.dtsi, rk3308-u-boot.dtsi, rk3328-u-boot.dtsi, rk3399-u-boot.dtsi and px30-u-boot.dtsi Rockchip SoC devicetrees which have mmc indexes are defining eMMC as mmc0 and sdmmc as mmc1.
This means that the rule to try to boot from the SD card first is ignored, which as per comment is what we want and is important for distros, which rely on that.

Fix this by setting the correct mmc index, i.e. first from mmc1 (SD card), second from mmc0 (eMMC).

---
 include/configs/rockchip-common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/configs/rockchip-common.h +3 -3
index 0b9e24d1db..ba7061a287 100644
@@ -14,11 +14,11 @@
 
 #ifndef CONFIG_SPL_BUILD
 
-/* First try to boot from SD (index 0), then eMMC (index 1) */
+/* First try to boot from SD (index 1), then eMMC (index 0) */
 #if CONFIG_IS_ENABLED(CMD_MMC)
 	#define BOOT_TARGET_MMC(func) \
-		func(MMC, mmc, 0) \
-		func(MMC, mmc, 1)
+		func(MMC, mmc, 1) \
+		func(MMC, mmc, 0)
 #else
 	#define BOOT_TARGET_MMC(func)
 #endif
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Alex Bee

Basically all, i.e. rk3036.dtsi, rk3128.dtsi, rk3xxx.dtsi, rk322x.dtsi, rk3288.dtsi, rk3308-u-boot.dtsi, rk3328-u-boot.dtsi, rk3399-u-boot.dtsi and px30-u-boot.dtsi Rockchip SoC devicetrees which have mmc indexes are defining eMMC as mmc0 and sdmmc as mmc1.
This means that the rule to try to boot from the SD card first is ignored, which as per comment is what we want and is important for distros, which rely on that.

Quoted 4 lines

Fix this by setting the correct mmc index, i.e. first from mmc1 (SD card), second from mmc0 (eMMC).

Thanks,
- Kever

Quoted 23 lines
---
  include/configs/rockchip-common.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
include/configs/rockchip-common.h +3 -3
index 0b9e24d1db..ba7061a287 100644
@@ -14,11 +14,11 @@
 
  #ifndef CONFIG_SPL_BUILD
 
-/* First try to boot from SD (index 0), then eMMC (index 1) */
+/* First try to boot from SD (index 1), then eMMC (index 0) */
  #if CONFIG_IS_ENABLED(CMD_MMC)
  	#define BOOT_TARGET_MMC(func) \
-		func(MMC, mmc, 0) \
-		func(MMC, mmc, 1)
+		func(MMC, mmc, 1) \
+		func(MMC, mmc, 0)
  #else
  	#define BOOT_TARGET_MMC(func)
  #endif