The next set of videos were centered around the Zynq-7000 boot process. In the previous labs, we programmed the PL & PS over JTAG, which requires an external master. Programming a bootloader to the non-volatile memory on the MiniZed allows it to boot-up and execute applications independently.
Chapter 6 Video - First Stage Bootloader
Zynq-7000 is a processor first solution: the PS boots first, and programs the PL.
When the PS boots up, CPU0 runs the initialization code in the factory programmed BootROM, which then decides the boot source (NAND, NOR, Quad-SPI or SD) of the FSBL (first stage boot loader) based on the state of the boot pins. The FSBL takes over and either executes from the on-chip memory, or in place from the flash. It initializes the PS, (PLL, MIO, memory controller), programs the PL if it detects a bitstream, and executes the application once it's done. The application could be a standalone application, or a second stage bootloader like U-boot. U-boot loads the OS kernel, which in turn can be sourced from multiple sources (NAND, NOR, QSPI, USB, GigE etc.)
Zynq supports secure & non-secure boot modes. If the FSBL is encrypted, the BootROM disables JTAG and makes use of the PL's AES-256 & HMAC engines.
These documents provide an overview of this entire process:
UltraFast Embedded Design Methodology Guide UG1046
Zynq-7000 All Programmable SoC Software Developers Guide UG821
Lab 6 - First Stage Boot Loader (FSBL)
Users can program their own FSBL by creating a new application in Xilinx SDK and using the FSBL template.
The lab instruction document then went over the contents of the main() function of the FSBL - which first calls the ps7_init() that initializes the PS, and later starts checking the boot mode pins and calls the appropriate function that loads the bootloader from the selected source.
Chapter 7 Video - Flash Programming and Boot-up
This video explained the boot process in a little more detail and briefly went over the tools in Xilinx SDK that create the boot image & program QSPI.
Lab 7 - Boot from Flash
In this lab, we used the previously created application [(t)est_Peripheral] & FSBL.
The Boot Image wizard packages the FSBL, bitstream and application, and generates a .mcs file (.mcs for QSPI, or .bin for SD card images)
The flash memory programming tool requires an image file (the .mcs file that was just created) and the FSBL's .elf file that can be would in the FSBL project directory
According to the instructions in the training document, once the flash is programmed, the device will automatically boot and run the 'Test Peripherals' application if the boot mode is set to Flash.
I did not program the flash as I didn't want to overwrite the demo application - though does Avnet provide instructions and files to restore the MiniZed.
Progress: