summaryrefslogtreecommitdiff
path: root/arch/arm/mach-zynqmp/spl.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2019-12-09 15:00:57 +0300
committerMichal Simek <michal.simek@xilinx.com>2020-01-14 11:05:53 +0300
commitde79ca951255deba6d303a1fd3668072b24e81ab (patch)
tree0cd4a6747b173d33e518c9d4f50d82befa6510cf /arch/arm/mach-zynqmp/spl.c
parent594254e7fed524860f858c16631b0e7079f74274 (diff)
downloadu-boot-de79ca951255deba6d303a1fd3668072b24e81ab.tar.xz
arm64: zynqmp: Add board_boot_order for MMC boot extension
In past SPL_ZYNQMP_TWO_SDHCI symbol was introduced to handle boards with two sdhci controllers. The problem was that U-Boot is registering controllers based on aliases in DT but bootmode targets specific controller ID. That's why on boards with one "second" sdhci controller bootmode was pointing to second controller(MMC2) but alias was setup to mmc0 (the first controller). And SPL requires to point to mmc0 in this case. Long time ago commit f101e4bd3703 ("spl: add support for alternative boot device") added support for handling multiple bootmodes in SPL. Use this functionality and setup second sdhci controller as backup boot device. Below is table with behavior: HW/bootmode bootorder sd0/sd0 mmc0/mmc1 (mmc1 never called) sd1/sd1 mmc1/mmc0 (mmc0 fails and mmc1 is called) sd0+sd1/sd0 mmc0/mmc1 (mmc1 never called) sd0+sd1/sd1 mmc1/mmc0 (mmc0 never called) All other bootmodes are not affected but order can be extended to cover advance boot flows. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/arm/mach-zynqmp/spl.c')
-rw-r--r--arch/arm/mach-zynqmp/spl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
index 527646875a..c0398b9116 100644
--- a/arch/arm/mach-zynqmp/spl.c
+++ b/arch/arm/mach-zynqmp/spl.c
@@ -58,6 +58,16 @@ void spl_board_init(void)
}
#endif
+void board_boot_order(u32 *spl_boot_list)
+{
+ spl_boot_list[0] = spl_boot_device();
+
+ if (spl_boot_list[0] == BOOT_DEVICE_MMC1)
+ spl_boot_list[1] = BOOT_DEVICE_MMC2;
+ if (spl_boot_list[0] == BOOT_DEVICE_MMC2)
+ spl_boot_list[1] = BOOT_DEVICE_MMC1;
+}
+
u32 spl_boot_device(void)
{
u32 reg = 0;
@@ -81,11 +91,7 @@ u32 spl_boot_device(void)
#ifdef CONFIG_SPL_MMC_SUPPORT
case SD_MODE1:
case SD1_LSHFT_MODE: /* not working on silicon v1 */
-/* if both controllers enabled, then these two are the second controller */
-#ifdef CONFIG_SPL_ZYNQMP_TWO_SDHCI
return BOOT_DEVICE_MMC2;
-/* else, fall through, the one SDHCI controller that is enabled is number 1 */
-#endif
case SD_MODE:
case EMMC_MODE:
return BOOT_DEVICE_MMC1;