Intel Agilex® 7 Hard Processor System Remote System Update User Guide

ID 683184
Date 2/23/2024
Public
Document Table of Contents

4.2.3.1.1. Creating Initial Flash Image for FPGA First

To create an initial flash image, you will need at least the following input files:

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
  1. Start the Quartus Programming File Generator GUI by running the following command:
    qpfgw &
  2. Select the Device family as Intel Agilex® 7 , and Configuration mode as Active Serial x4.
  3. Change the Name to “initial_image”.
  4. Select the output file type as JTAG Indirect Configuration File (. jic ), which is the format used by the Intel Quartus Prime Programmer tool for writing to the QSPI flash.
  5. Select the optional Memory Map File (.map ) file so that it is also generated. The .map file contains information about the resulted flash layout.
  6. 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:

  7. 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.
  8. Once the output type was selected, click the Input Files tab.
  9. In the Input Files tab click the Add Bitstream button, then browse to and select the file factory_design.sof, and then click Open. This is the initial factory image. Do the same for the application_design.sof. This is the initial application image. The tab now looks similar to this:
  10. 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 select authentication and encryption settings.
  11. Click the Bootloader … (Browse) button and select the file factory_fsbl.hex, then click OK.
  12. Click the application_design.sof file and add the application_fsbl.hex file to it. The Input Files tab now looks similar to this:
  13. 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.

  14. In the Configuration Device tab, click Add Device, select the desired QSPI device in the dialog box window (MT25QU02G in the example below), then click OK. Once that is done, the window displays the default initial partitioning for RSU:
  15. Optionally change the size of all SPTs and CPBs from the default 32KB to the optional 64KB if you need it. You may do that for example to be able to have the 64KB erase granularity configured in U-Boot and/or Linux for a more efficient operation. This is done by clicking any of the SPTs or CPBs to select it, then clicking Edit, then selecting the 64KB option and pressing OK:
    Note: This option applies for all CPBs and SPTs. They are all either 32KB or 64KB in size at the same time.
  16. Optionally, enable the direct factory image fallback option, by clicking the BOOT_INFO partition to select it, then click the Edit button and then changing the Direct factory image fallback option from Off to On and pressing OK.

    Factory Image Fallback

    Note: When this option is enabled, the failure of any image causes the factory image to be loaded, ignoring the rest of the images in the configuration pointer block.
  17. Select the FACTORY_IMAGE entry, and click the Edit… button. The Edit Partition window pops up. Select the Input file as Bitstream_1 (factory_design.sof). Change Address Mode to Block because you want to make sure you are leaving enough space for the biggest factory image you anticipate using. Set the End Address to something that will fit the factory image, and also leave some space for future expansion if needed. In the example below the End Address is set to 0x0090FFFF in order 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
    Note: The Page property for FACTORY_IMAGE partition must always be set to 0. This means that the FACTORY_IMAGE will be tried after all the application images failed.
  18. 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). This becomes the initial application image. Select the Page as 1 – this means it has the highest priority of all application images. 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.

    The Page property is used by the Programming File Generator to determine the order in which images appear initially in the configuration pointer block. The highest priority is the one with Page=1, then the one with Page=2, and so on. 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.

  19. 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.
  20. Click Select … to select the Flash loader. 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:

    The Configuration Device tab now looks similar to this:

  21. 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 Programming File Generator, if changes are needed.
  22. 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.