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

ID 683184
Date 6/09/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.3.1. Using U-Boot to Perform Basic Operations

This section demonstrates how to use U-Boot to perform the following basic operations:
  • Querying the RSU status.
  • Querying the number of slots and the information about them.
  • Adding a new application image.
  • Verifying that an application image was written correctly.
  • Requesting a specific application image to be loaded.
Note: This section assumes that the flash contains the initial RSU image. If that is not true, you need to re-flash the initial image, as shown in the Flashing the Initial RSU Image to QSPI.
  1. Power cycle the board and press any key when prompted, to get to the U-Boot command prompt:
    U-Boot 2021.01-12712-ge59d8e9eaa-dirty (Jun 30 2021 - 10:40:17 -0500)socfpga_agilex
    
    CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-A53)
    Model: SoCFPGA Agilex SoCDK
    DRAM:  8 GiB
    WDT:   Started with servicing (10s timeout)
    MMC:   dwmmc0@ff808000: 0
    Loading Environment from MMC... *** Warning - bad CRC, using default environment
    
    In:    serial0@ffc02000
    Out:   serial0@ffc02000
    Err:   serial0@ffc02000
    Net:   
    Warning: ethernet@ff800000 (eth0) using random MAC address - 62:08:b9:b7:79:2d
    eth0: ethernet@ff800000
    Hit any key to stop autoboot:  5 
    
     0 
    SOCFPGA #
  2. Run the rsu command without parameters, to display its help message, and usage options:
    SOCFPGA # rsu
    rsu - Agilex SoC Remote System Update
    
    Usage:
    rsu dtb   - Update Linux DTB qspi-boot parition offset with spt0 value
    list  - List down the available bitstreams in flash
    slot_by_name <name> - find slot by name and display the slot number
    slot_count - display the slot count
    slot_disable <slot> - remove slot from CPB
    slot_enable <slot> - make slot the highest priority
    slot_erase <slot> - erase slot
    slot_get_info <slot> - display slot information
    slot_load <slot> - load slot immediately
    slot_load_factory - load factory immediately
    slot_priority <slot> - display slot priority
    slot_program_buf <slot> <buffer> <size> - program buffer into slot, and make it highest priority
    slot_program_buf_raw <slot> <buffer> <size> - program raw buffer into slot
    slot_program_factory_update_buf <slot> <buffer> <size> - program factory update buffer into slot, and make it highest priority
    slot_rename <slot> <name> - rename slot
    slot_size <slot> - display slot size
    slot_verify_buf <slot> <buffer> <size> - verify slot contents against buffer
    slot_verify_buf_raw <slot> <buffer> <size> - verify slot contents against raw buffer
    status_log - display RSU status
    update <flash_offset> - Initiate firmware to load bitstream as specified by flash_offset
    notify <value> - Let SDM know the current state of HPS software
    clear_error_status - clear the RSU error status
    reset_retry_counter - reset the RSU retry counter
    display_dcmf_version - display DCMF versions and store them for SMC handler usage 
    display_dcmf_status - display DCMF status and store it for SMC handler usage
    display_max_retry - display max_retry parameter, and store it for SMC handler usage
    restore_spt <address> - restore SPT from an address
    save_spt <address> - save SPT to an address
    create_empty_cpb - create a empty CPB
    restore_cpb <address> - restore CPB from an address
    save_cpb <address> - save CPB to an address
    check_running_factory - check if currently running the factory image
  3. Run the rsu list command to display the RSU partitions, CPBs, the currently running image and the status:
    SOCFPGA # rsu list
    RSU: Remote System Update Status
    Current Image    : 0x01000000
    Last Fail Image  : 0x00000000
    State            : 0x00000000
    Version          : 0x00000202
    Error location   : 0x00000000
    Error details    : 0x00000000
    Retry counter    : 0x00000000
    RSU: Sub-partition table 0 offset 0x00910000
    RSU: Sub-partition table 1 offset 0x00918000
    SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB
    RSU: Sub-partition table content
           BOOT_INFO	Offset: 0x0000000000000000	Length: 0x00210000	Flag : 0x00000003
       FACTORY_IMAGE	Offset: 0x0000000000210000	Length: 0x00700000	Flag : 0x00000003
                  P1	Offset: 0x0000000001000000	Length: 0x01000000	Flag : 0x00000000
                SPT0	Offset: 0x0000000000910000	Length: 0x00008000	Flag : 0x00000001
                SPT1	Offset: 0x0000000000918000	Length: 0x00008000	Flag : 0x00000001
                CPB0	Offset: 0x0000000000920000	Length: 0x00008000	Flag : 0x00000001
                CPB1	Offset: 0x0000000000928000	Length: 0x00008000	Flag : 0x00000001
                  P2	Offset: 0x0000000002000000	Length: 0x01000000	Flag : 0x00000000
                  P3	Offset: 0x0000000003000000	Length: 0x01000000	Flag : 0x00000000
    RSU: CMF pointer block offset 0x00920000
    RSU: CMF pointer block's image pointer list
    Priority 1 Offset: 0x0000000001000000 nslot: 0
    Note: The rsu list U-Boot command does not have a RSU client equivalent. Instead, the same information can be retrieved using other commands, as shown next.
  4. Run the rsu status_log command to display the RSU status:
    SOCFPGA # rsu status_log
    Current Image   : 0x01000000
    Last Fail Image : 0x00000000
    State           : 0x00000000
    Version         : 0x00000202
    Error location  : 0x00000000
    Error details   : 0x00000000
    Retry counter   : 0x00000000

    Application image P1 is loaded, as it is the highest priority in the CPB. There are no errors.

  5. Run the rsu display_dcmf_version to query and display the decision firmware versions:
    SOCFPGA # rsu display_dcmf_version
    DCMF0 version = 22.1.0
    DCMF1 version = 22.1.0
    DCMF2 version = 22.1.0
    DCMF3 version = 22.1.0
  6. Display information about the slots:
    SOCFPGA # rsu slot_count
    Number of slots = 3.
    SOCFPGA # rsu slot_get_info 0
    NAME: P1
    OFFSET: 0x0000000001000000
    SIZE: 0x01000000
    PRIORITY: 1
    SOCFPGA # rsu slot_get_info 1
    NAME: P2
    OFFSET: 0x0000000002000000
    SIZE: 0x01000000
    PRIORITY: [disabled]
    SOCFPGA # rsu slot_get_info 2
    NAME: P3
    OFFSET: 0x0000000003000000
    SIZE: 0x01000000
    PRIORITY: [disabled]
    SOCFPGA # rsu slot_size 0
    Slot 0 size = 16777216.
    SOCFPGA # rsu slot_size 1
    Slot 1 size = 16777216.
    SOCFPGA # rsu slot_size 2
    Slot 2 size = 16777216.
  7. Erase slot 1 and add the application2.rpd image to slot 1:
    SOCFPGA # rsu slot_erase 1
    Slot 1 erased
    SOCFPGA # load mmc 0:1 $loadaddr application2.rpd
    3358720 bytes read in 153 ms (20.9 MiB/s)
    SOCFPGA # rsu slot_program_buf 1 $loadaddr $filesize
    Slot 1 was programmed with buffer=0x0000000002000000 size=3358720.
  8. Verify that the application image was written correctly:
    SOCFPGA # rsu slot_verify_buf 1 $loadaddr $filesize
    Slot 1 was verified with buffer=0x0000000002000000 size=3358720.
  9. Confirm that slot 1 (partition P2) contains now the highest priority image:
    SOCFPGA # rsu slot_get_info 1
    NAME: P2
    OFFSET: 0x0000000002000000
    SIZE: 0x01000000
    PRIORITY: 1
  10. Power-cycle the board, stop U-Boot and check the RSU status log:
    SOCFPGA # rsu status_log         
    Current Image   : 0x02000000
    Last Fail Image : 0x00000000
    State           : 0x00000000
    Version         : 0x00000202
    Error location  : 0x00000000
    Error details   : 0x00000000
    Retry counter   : 0x00000000

    The application image from slot 1 (partition P2) was loaded, because it is marked as the highest priority in the CPB.

  11. Load the application image from slot 0 (partition P1) by running any of the following two commands:
    SOCFPGA # rsu update 0x01000000
    RSU: RSU update to 0x0000000001000000

    or

    SOCFPGA # rsu slot_load 0
  12. Load the newly requested image. Stop at U-Boot prompt and check the status log to confirm it:
    SOCFPGA # rsu status_log
    Current Image   : 0x01000000
    Last Fail Image : 0x00000000
    State           : 0x00000000
    Version         : 0x00000202
    Error location  : 0x00000000
    Error details   : 0x00000000
    Retry counter   : 0x00000000
    Note: In U-Boot, the effect of requesting a specific image is immediate. On Linux, it only takes effect on the next reboot command.