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.5.3. Corrupted Configuration Pointer Block

This section uses U-Boot commands to demonstrate how configuration pointer block corruptions can be detected and recovered.
Note: The commands listed in this example assume the initial flash image (JIC) was written to flash, with no other changes.
  1. Power up board, stop at U-Boot prompt.
  2. Run the rsu list command to display a detailed status, including all the partitions, to determine the location of the SPTs:
    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
  3. Corrupt CPB0 by erasing the corresponding flash area:
    SOCFPGA # sf probe
    SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB
    SOCFPGA # sf erase 0x0920000 0x1000
    SF: 4096 bytes @ 0x920000 Erased: OK
  4. Power cycle the board, the stop to U-Boot prompt and query the RSU status:
    SOCFPGA # rsu status_log
    FW detects corrupted CPB0 but CPB1 is fine
    Restoring CPB0
    Current Image   : 0x01000000
    Last Fail Image : 0x00000000
    State           : 0xf004d010
    Version         : 0x0dcf0202
    Error location  : 0x00000000
    Error details   : 0x00000000
    Retry counter   : 0x00000000

    The State field has the special error code 0xf004d010 which indicates that CPB0 was corrupted. The Version field indicates that the error was reported by the decision firmware (0xDCF). The rsu_init function which is called first time an U-Boot RSU command is executed detected the CPB corruption and recovered CPB0 from CPB1.

  5. Save the CPB contents to a file, to be used later for recovery.
    SOCFPGA # rsu save_cpb ${loadaddr}
    4100 bytes CPB data saved
    SOCFPGA # fatwrite mmc 0:1 ${loadaddr} cpb-backup.bin ${filesize}
    4100 bytes written
  6. Corrupt both CPBs by erasing the flash at their location:
    SOCFPGA # sf probe
    SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB
    SOCFPGA # sf erase 0x0920000 0x1000
    SF: 4096 bytes @ 0x920000 Erased: OK
    SOCFPGA # sf erase 0x0928000 0x1000
    SF: 4096 bytes @ 0x928000 Erased: OK
  7. Power cycle the board, boot to U-Boot prompt and query RSU status:
    SOCFPGA # rsu status_log
    FW detects both CPBs corrupted
    Current Image   : 0x00210000
    Last Fail Image : 0x00000000
    State           : 0xf004d011
    Version         : 0x0dcf0202
    Error location  : 0x00000000
    Error details   : 0x00000000
    Retry counter   : 0x00000000

    The Current Image is reported as being the factory image, as expected. The State field has the special error code 0xf004d011 which indicates that both CPBs were corrupted. The Version field indicates that the error was reported by the decision firmware (0xDCF). The rsu_init function which is called first time an U-Boot RSU command is executed detected and reported that both CPBs are corrupted.

  8. Try to run a command which requires a valid CPB - it is rejected:
    SOCFPGA # rsu slot_get_info 0
    corrupted CPB --run rsu create_empty_cpb or rsu restore_cpb <address> first
  9. Restore the saved CPB from the backup file that we created:
    SOCFPGA # fatload mmc 0:1 ${loadaddr} cpb-backup.bin
    4100 bytes read in 3 ms (1.3 MiB/s)
    SOCFPGA # rsu restore_cpb ${loadaddr}
  10. Clear the errors reported by firmware, as the CPB was restored.
    SOCFPGA # rsu clear_error_status
    Alternatively you can also power cycle or assert nCONFIG to clear the errors reported by firmware.
  11. Try again to run a command which require a valid CPB - it succeeds:
    SOCFPGA # rsu slot_get_info 1
    NAME: P2
    OFFSET: 0x0000000002000000
    SIZE: 0x01000000
    PRIORITY: 1