Forum Discussion

Ozzuu's avatar
Ozzuu
Icon for New Contributor rankNew Contributor
6 years ago
Solved

Does the preloader generated using BSP Generator automatically jump to NEXT_BOOT_IMAGE?

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 ...
  • FawazJ_Altera's avatar
    6 years ago

    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

    }