I am working on Zynq-7030 custom board, (software: Vivado 2019.1 → SDK 2019.1).
I have successfully accessed emmc (mmc1 in my case). Created partitions and made understanding of all emmc related commands. My board has two boot modes. One is for SD card and other is QSPI boot.
To load images from EMMC, I need to store bootloader at QSPI (since boot mode is QSPI), so that bootloader boots first and then proceeds to other images loading, that are placed at emmc.
I want to separately load boot.bin, kernel image, dtb and rootfs for each partition of emmc, based on whatever user selects at bootup. In simple words, there should be a user code that asks from user to select the partition to boot from. Say partition 3 is selected, the boot.bin , kernel image, dtb and rootfs corresponding that partition 3 will be booted up and others will not be booted.
I did research on this and found that BootROM allows FSBL to boot from QSPI to OCM. Now I am stuck in customizing FSBL to take user input and then load corresponding images. I made a simple design in Vivado and enabled only EMMC (mmc1/ sd1) and disabled SD (mmc0/sd0) then generated fsbl.elf from SDK. The fsbl.elf is generated by default method, so it does not take user input and then can load corresponding images according to that user input.
I need way out for this. I have beginner level expertise in embedded C so I need help in how to read the offset sector of EMMC to laod BOOT.bin (that was stored using dd command in the EMMC).
Is my understanding of this approach is correct or I need to adapt alternate for this? If it is correct then I will appreciate help in FSBL code customization.