rockchip: puma-rk3399: fix boot_targets swap depending on U-Boot proper load medium
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Thu, 15 Sep 2022 09:14:21 +0000 (11:14 +0200)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 19 Oct 2022 11:30:48 +0000 (19:30 +0800)
commit12c84d59847140e52c2b8f4763ff6895c14e6f14
tree5eef831276c7f567393b1dc1300963d11eb89bb1
parent25e9a63a53d8c41a072ef165c21885c453815b4b
rockchip: puma-rk3399: fix boot_targets swap depending on U-Boot proper load medium

distroboot should try first on the same MMC medium as the one the SPL
loaded U-Boot proper from. This was the case when the introducing commit
was merged because the default order was eMMC first and then SD card.
The check was therefore made only on whether we booted from SD card,
because otherwise the order was the expected one.
However, in commit b212ad24a604 ("rockchip: Fix MMC boot order"), the
order was swapped. Meaning our simple check is now useless.

Let's fix that by accounting for all scenarii: default boot_targets has
mmc0 first but booting from SD Card, mmc1 first but booting from eMMC.

Fixes: b212ad24a604 ("rockchip: Fix MMC boot order")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
board/theobroma-systems/puma_rk3399/puma-rk3399.c