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?
https://rocketboards.org/foswiki/Documentation/AVGSRDPreloader
Link Copied
Hello,
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.
u32 spl_boot_device(void)
{
#if (CONFIG_PRELOADER_BOOT_FROM_QSPI == 1)
return BOOT_DEVICE_SPI;
#elif (CONFIG_PRELOADER_BOOT_FROM_RAM == 1)
return BOOT_DEVICE_RAM;
#elif (CONFIG_PRELOADER_BOOT_FROM_NAND == 1)
return BOOT_DEVICE_NAND;
#else
return BOOT_DEVICE_MMC1;
#endif
}
Hello,
I will investigate your request and let you know the feedback soon,
thanks
Hello,
Any update on my question?
Thanks!
Hello,
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.
u32 spl_boot_device(void)
{
#if (CONFIG_PRELOADER_BOOT_FROM_QSPI == 1)
return BOOT_DEVICE_SPI;
#elif (CONFIG_PRELOADER_BOOT_FROM_RAM == 1)
return BOOT_DEVICE_RAM;
#elif (CONFIG_PRELOADER_BOOT_FROM_NAND == 1)
return BOOT_DEVICE_NAND;
#else
return BOOT_DEVICE_MMC1;
#endif
}
For more complete information about compiler optimizations, see our Optimization Notice.