Visible to Intel only — GUID: dis1739228397888
Ixiasoft
Visible to Intel only — GUID: dis1739228397888
Ixiasoft
4.2.3.1.1. Creating Initial Flash Image for FPGA Configuration First
To create an initial flash image, you will need at least one of the input files shown in the following table.
Filename | Description |
---|---|
factory_design.sof | SOF for the factory image design |
factory_fsbl.hex | HPS FSBL hex file for the factory image |
application_design.sof | SOF for the application image design |
application_fsbl.hex | HPS FSBL hex file for application image |
- Start the Quartus® Prime Programming File Generator GUI by running the following command:
qpfgw &
- Select the Device family as Agilex™ 5 , and Configuration mode as Active Serial x4.
- Change the Name to “initial_image”.
- Select the output file type as JTAG Indirect Configuration File (. jic), which is the format used by the Quartus® Prime Programmer tool for writing to the QSPI flash.
- Select the optional Memory Map File (.map) file so that it is also generated. The .map file contains information about the resulting flash layout.
- Select the optional Raw Programming Data File (.rpd) file so that it is also generated. This file contains the binary flash content, without anything else added.
The window now looks similar to this:
Figure 10. Select Files in the Output Files Tab - Click the Raw Programming Data File (.rpd) file to select it. Then click the Edit... button and select the Bitswap option to be On. This enables the RPD file to be usable by HPS software like U-Boot and Linux if needed.
- Once the output type was selected, click the Input Files tab.
- In the Input Files tab click the Add Bitstream button, then browse to and select the factory_design.sof file, and then click Open. This is the initial factory image. Repeat these steps for the application_design.sof file. This is the initial application image. The tab now looks similar to this:
Figure 11. Select Files in the Input Files Tab
- Click the factory_design.sof file, then click the Properties button on the right side. This opens the window to browse for the FSBL and selection of the authentication and encryption settings.
Figure 12. Input File Properties
- Click the Bootloader… (Browse) button and select the file factory_fsbl.hex, click Open and then OK.
- Click the application_design.sof file and add the application_fsbl.hex file to it. The Input Files tab now looks similar to this:
Figure 13. Select Bootloader Files in the Input Files Tab
- Click the Configuration Device tab. Note that the tab is only enabled once at least one input file was added in the Input Files tab.
Because more than one input file was added in the Input Files tab, it displays the options for remote system update. Otherwise, it only enables the standard configuration flow.
- In the Configuration Device tab, click Add Device, select the desired QSPI device in the dialog box window (QSPI02G in the example below, this is the device with storage capacity of 2Gbits or 256 MB), then click OK. Once that is done, the window displays the default initial partitioning for RSU:
Figure 14. Add Device in the Configuration Device Tab
- You can optionally change the size of all SPTs and CPBs from the default 32KB to 64KB if needed. This might be useful for configuring the 64KB erase granularity in U-Boot, Linux, or both to achieve more efficient operation. To do this, select any of the SPTs or CPBs, click Edit, choose the 64KB option, and press OK:
Figure 15. Edit Partition SizesNote: This option applies for all CPBs and SPTs. They are all either 32KB or 64KB in size at the same time.
- Optionally, you can enable the direct factory image fallback option. To do this, click the BOOT_INFO partition, click the Edit button, change the Direct factory image fallback option from Off to On, and press OK.
Figure 16. Enable the Direct Factory Image Fallback Option in the Edit BOOT_INFO WindowNote: When this option is enabled, any image failure causes the factory image to be load, ignoring the rest of the images in the configuration pointer block.
- Select the FACTORY_IMAGE entry, and click the Edit… button. The Edit Partition window appears. Select the Bitstream_1 (factory_design.sof) as the input file. Change the Address Mode to Block to ensure enough space for the largest anticipated factory image. Set the End Address to accommodate the factory image and allow for future expansion if needed. In the example below, the End Address is set to 0x0090FFFF to reserve 7MB for the factory image. This end address was calculated by adding 7MB to the end of the BOOT_INFO partition. Click OK.
Figure 17. Edit the FACTORY_IMAGE Properties in the Edit Partition WindowNote: The Page property for FACTORY_IMAGE partition must always be set to 0. This ensures that the FACTORY_IMAGE is tried only after all the application images failed.
- Select the flash device in the Configuration Device tab by clicking it, then click the Add Partition… button to open the Add Partition window. Leave the Name as P1 (or select whatever name you want) and select the Input file as Bitstream_2 (application_design.sof). Select the Page as 1. Select the Address Mode as Block and allocate enough space for the application image and its projected expansion in the future. In the example below we allocate 16MB of data by setting Start Address = 0x01000000 and End Address = 0x01FFFFFF. Since this is the first partition defined, this becomes the initial application image to be loaded and has the highest priority of all application images that may be defined later.
The actual priority in which an application in a partition is loaded is defined based on the order in which the partition is defined when creating the initial flash image as shown above in this step.
The Programming File Generator issues an error if there are multiple partitions with the same page number, or if there are any “gaps” as in having a Page=1 then a Page=3, without a Page=2 for example.
Only up to seven partitions can contain application images at initial flash image creation time. This limitation does not have adverse effects, as typically at creation time it is expected to have just a factory image and one application image.
- Create more empty application partitions as needed. In the example below we add two more partitions P2 and P3 using the same procedure as for the previous step, except set the Input file to None, leave Page unchanged (it does not matter for empty partitions) and set the start and end addresses as follows:
- P2: Start Address = 0x02000000 and End Address = 0x02FFFFFF
- P3: Start Address = 0x03000000 and End Address = 0x03FFFFFF
Note: Ensure that all application partitions fit within the appropriate QSPI partition or partitions defined in the device's corresponding device tree in U-Boot and Linux. For Linux, also verify that the QSPI partition or partitions defined in the device tree for storing application partitions are included in the qspi.rc file in LIBRSU. - Click Select … to select the Flashloader. The flash loader becomes part of the JIC file and is used by the Flash Programmer tool. Select the desired Device family and Device name similar to the example shown below (in this case it was A5ED065BB32AR0):
Figure 18. Use the Select Devices Window to Select the Device Family and Device Name
The Configuration Device tab now looks similar to this:
Figure 19. Configuration Device Settings - Click File > Save As .. and save the file as initial_image.pfg. This file can be useful later, if you wanted to re-generate the initial image by using the command:
quartus_pfg -c initial_image.pfg
Note: The created .pfg file is actually an XML file which can be manually edited to replace the absolute file paths with relative file paths. You cannot directly edit the .pfg file for other purposes. The .pfg file can be opened from the Programming File Generator, if changes are needed. - Click the Generate button to generate the initial flash image as initial_image.jic and the map file as initial_image_jic.map. A dialog box opens indicating the files were generated successfully.