I am working on Cyclone V board and we have both SD and QSPI on the board. We want the preloader to load the bootloader from SD, if that fails we want to pass on another address from SD to preloader and if that doesn't work, it should look in QSPI.
I am using following tutorial from rocketboard for the same.
Question is, will the preloader look for backup images of bootloader at given addresses just by passing addresses to SDMMC_NEXT_BOOT_IMAGE and QSPI_NEXT_BOOT_IMAGE? Does the preloader automatically starts looking for QSPI too, even though the preloader itself is located in SD?
Based on the old U-Boot codes, this function spl_boot_device at arch/arm/cpu/armv7/socfpga/spl.c, tells that you only can boot once at a time, and with ordering starting from QSPI to MMC. That means if you enable both QSPI and MMC, then QSPI would be booted instead of MMC. But one good thing is if you enable both QSPI and SDMMC, the SPL can access both QSPI and SDMMC,. However, this is not for the use case to boot backup image when the 1st boot device image corrupted.
You might need to modify the source code for the recovery mechanism use case, which we cannot support.
#if (CONFIG_PRELOADER_BOOT_FROM_QSPI == 1)
#elif (CONFIG_PRELOADER_BOOT_FROM_RAM == 1)
#elif (CONFIG_PRELOADER_BOOT_FROM_NAND == 1)