Agilex™ 7 Hard Processor System Remote System Update User Guide
                    
                        ID
                        683184
                    
                
                
                    Date
                    5/01/2025
                
                
                    Public
                
            
                
                    
                        1. Overview
                    
                    
                
                    
                        2. Use Cases
                    
                    
                
                    
                        3. Quad SPI Flash Layout
                    
                    
                
                    
                        4. Quartus® Prime Software and Tool Support
                    
                    
                
                    
                        5. Software Support
                    
                    
                
                    
                        6. Flash Corruption - Detection and Recovery
                    
                    
                
                    
                    
                        7. Remote System Update Example
                    
                
                    
                        8. Version Compatibility Considerations
                    
                    
                
                    
                    
                        9. Agilex™ 7 Hard Processor System Remote System Update User Guide Archives
                    
                
                    
                    
                        10. Document Revision History for the Agilex™ 7 Hard Processor System Remote System Update User Guide
                    
                
                    
                        A. Configuration Flow Diagrams
                    
                    
                
                    
                    
                        B. RSU Status and Error Codes
                    
                
                    
                        C. U-Boot RSU Reference Information
                    
                    
                
                    
                        D. LIBRSU Reference Information
                    
                    
                
                    
                    
                        E. Combined Application Images
                    
                
            
        
                        
                        
                            
                            
                                2.1. Manufacturing
                            
                        
                            
                            
                                2.2. Application Image Boot
                            
                        
                            
                            
                                2.3. Factory Image Boot
                            
                        
                            
                            
                                2.4. Modifying the List of Application Images
                            
                        
                            
                            
                                2.5. Querying RSU Status
                            
                        
                            
                            
                                2.6. Loading a Specific Image
                            
                        
                            
                            
                                2.7. Protected Access to Flash
                            
                        
                            
                            
                                2.8. Remote System Update Watchdog
                            
                        
                            
                            
                                2.9. RSU Notify
                            
                        
                            
                            
                                2.10. Updating the Factory Image
                            
                        
                            
                            
                                2.11. Updating the Decision Firmware
                            
                        
                            
                            
                                2.12. Retrying when Configuration Fails
                            
                        
                            
                            
                                2.13. Querying the Decision Firmware Version
                            
                        
                            
                            
                                2.14. Booting from a Multi-QSPI Image
                            
                        
                    
                
                                    
                                    
                                        
                                        
                                            C.6.1. rsu_init
                                        
                                        
                                    
                                        
                                        
                                            C.6.2. rsu_exit
                                        
                                        
                                    
                                        
                                        
                                            C.6.3. rsu_slot_count
                                        
                                        
                                    
                                        
                                        
                                            C.6.4. rsu_slot_by_name
                                        
                                        
                                    
                                        
                                        
                                            C.6.5. rsu_slot_get_info
                                        
                                        
                                    
                                        
                                        
                                            C.6.6. rsu_slot_size
                                        
                                        
                                    
                                        
                                        
                                            C.6.7. rsu_slot_priority
                                        
                                        
                                    
                                        
                                        
                                            C.6.8. rsu_slot_erase
                                        
                                        
                                    
                                        
                                        
                                            C.6.9. rsu_slot_program_buf
                                        
                                        
                                    
                                        
                                        
                                            C.6.10. rsu_slot_program_factory_update_buf
                                        
                                        
                                    
                                        
                                        
                                            C.6.11. rsu_slot_program_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            C.6.12. rsu_slot_verify_buf
                                        
                                        
                                    
                                        
                                        
                                            C.6.13. rsu_slot_verify_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            C.6.14. rsu_slot_enable
                                        
                                        
                                    
                                        
                                        
                                            C.6.15. rsu_slot_disable
                                        
                                        
                                    
                                        
                                        
                                            C.6.16. rsu_slot_load
                                        
                                        
                                    
                                        
                                        
                                            C.6.17. rsu_slot_load_factory
                                        
                                        
                                    
                                        
                                        
                                            C.6.18. rsu_slot_rename
                                        
                                        
                                    
                                        
                                        
                                            C.6.19. rsu_slot_delete
                                        
                                        
                                    
                                        
                                        
                                            C.6.20. rsu_slot_create
                                        
                                        
                                    
                                        
                                        
                                            C.6.21. rsu_status_log
                                        
                                        
                                    
                                        
                                        
                                            C.6.22. rsu_notify
                                        
                                        
                                    
                                        
                                        
                                            C.6.23. rsu_clear_error_status
                                        
                                        
                                    
                                        
                                        
                                            C.6.24. rsu_reset_retry_counter
                                        
                                        
                                    
                                        
                                        
                                            C.6.25. rsu_dcmf_version
                                        
                                        
                                    
                                        
                                        
                                            C.6.26. rsu_max_retry
                                        
                                        
                                    
                                        
                                        
                                            C.6.27. rsu_dcmf_status
                                        
                                        
                                    
                                        
                                        
                                            C.6.28. rsu_create_empty_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.6.29. rsu_restore_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.6.30. rsu_save_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.6.31. rsu_restore_spt
                                        
                                        
                                    
                                        
                                        
                                            C.6.32. rsu_save_spt
                                        
                                        
                                    
                                        
                                        
                                            C.6.33. rsu_running_factory
                                        
                                        
                                    
                                
                            
                                    
                                    
                                        
                                        
                                            C.7.1. dtb
                                        
                                        
                                    
                                        
                                        
                                            C.7.2. list
                                        
                                        
                                    
                                        
                                        
                                            C.7.3. slot_by_name
                                        
                                        
                                    
                                        
                                        
                                            C.7.4. slot_count
                                        
                                        
                                    
                                        
                                        
                                            C.7.5. slot_disable
                                        
                                        
                                    
                                        
                                        
                                            C.7.6. slot_enable
                                        
                                        
                                    
                                        
                                        
                                            C.7.7. slot_erase
                                        
                                        
                                    
                                        
                                        
                                            C.7.8. slot_get_info
                                        
                                        
                                    
                                        
                                        
                                            C.7.9. slot_load
                                        
                                        
                                    
                                        
                                        
                                            C.7.10. slot_load_factory
                                        
                                        
                                    
                                        
                                        
                                            C.7.11. slot_priority
                                        
                                        
                                    
                                        
                                        
                                            C.7.12. slot_program_buf
                                        
                                        
                                    
                                        
                                        
                                            C.7.13. slot_program_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            C.7.14. slot_program_factory_update_buf
                                        
                                        
                                    
                                        
                                        
                                            C.7.15. slot_rename
                                        
                                        
                                    
                                        
                                        
                                            C.7.16. slot_delete
                                        
                                        
                                    
                                        
                                        
                                            C.7.17. slot_create
                                        
                                        
                                    
                                        
                                        
                                            C.7.18. slot_size
                                        
                                        
                                    
                                        
                                        
                                            C.7.19. slot_verify_buf
                                        
                                        
                                    
                                        
                                        
                                            C.7.20. slot_verify_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            C.7.21. status_log
                                        
                                        
                                    
                                        
                                        
                                            C.7.22. update
                                        
                                        
                                    
                                        
                                        
                                            C.7.23. notify
                                        
                                        
                                    
                                        
                                        
                                            C.7.24. clear_error_status
                                        
                                        
                                    
                                        
                                        
                                            C.7.25. reset_retry_counter
                                        
                                        
                                    
                                        
                                        
                                            C.7.26. display_dcmf_version
                                        
                                        
                                    
                                        
                                        
                                            C.7.27. display_dcmf_status
                                        
                                        
                                    
                                        
                                        
                                            C.7.28. display_max_retry
                                        
                                        
                                    
                                        
                                        
                                            C.7.29. restore_spt
                                        
                                        
                                    
                                        
                                        
                                            C.7.30. save_spt
                                        
                                        
                                    
                                        
                                        
                                            C.7.31. create_empty_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.7.32. restore_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.7.33. save_cpb
                                        
                                        
                                    
                                        
                                        
                                            C.7.34. check_running_factory
                                        
                                        
                                    
                                
                            
                                    
                                    
                                        
                                        
                                            D.6.1. librsu_init
                                        
                                        
                                    
                                        
                                        
                                            D.6.2. librsu_exit
                                        
                                        
                                    
                                        
                                        
                                            D.6.3. rsu_slot_count
                                        
                                        
                                    
                                        
                                        
                                            D.6.4. rsu_slot_by_name
                                        
                                        
                                    
                                        
                                        
                                            D.6.5. rsu_slot_get_info
                                        
                                        
                                    
                                        
                                        
                                            D.6.6. rsu_slot_size
                                        
                                        
                                    
                                        
                                        
                                            D.6.7. rsu_slot_priority
                                        
                                        
                                    
                                        
                                        
                                            D.6.8. rsu_slot_erase
                                        
                                        
                                    
                                        
                                        
                                            D.6.9. rsu_slot_program_buf
                                        
                                        
                                    
                                        
                                        
                                            D.6.10. rsu_slot_program_factory_update_buf
                                        
                                        
                                    
                                        
                                        
                                            D.6.11. rsu_slot_program_file
                                        
                                        
                                    
                                        
                                        
                                            D.6.12. rsu_slot_program_factory_update_file
                                        
                                        
                                    
                                        
                                        
                                            D.6.13. rsu_slot_program_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.14. rsu_slot_program_file_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.15. rsu_slot_verify_buf
                                        
                                        
                                    
                                        
                                        
                                            D.6.16. rsu_slot_verify_file
                                        
                                        
                                    
                                        
                                        
                                            D.6.17. rsu_slot_verify_buf_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.18. rsu_slot_verify_file_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.19. rsu_slot_program_callback
                                        
                                        
                                    
                                        
                                        
                                            D.6.20. rsu_slot_program_callback_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.21. rsu_slot_verify_callback
                                        
                                        
                                    
                                        
                                        
                                            D.6.22. rsu_slot_verify_callback_raw
                                        
                                        
                                    
                                        
                                        
                                            D.6.23. rsu_slot_copy_to_file
                                        
                                        
                                    
                                        
                                        
                                            D.6.24. rsu_slot_enable
                                        
                                        
                                    
                                        
                                        
                                            D.6.25. rsu_slot_disable
                                        
                                        
                                    
                                        
                                        
                                            D.6.26. rsu_slot_load_after_reboot
                                        
                                        
                                    
                                        
                                        
                                            D.6.27. rsu_slot_load_factory_after_reboot
                                        
                                        
                                    
                                        
                                        
                                            D.6.28. rsu_slot_rename
                                        
                                        
                                    
                                        
                                        
                                            D.6.29. rsu_slot_delete
                                        
                                        
                                    
                                        
                                        
                                            D.6.30. rsu_slot_create
                                        
                                        
                                    
                                        
                                        
                                            D.6.31. rsu_status_log
                                        
                                        
                                    
                                        
                                        
                                            D.6.32. rsu_notify
                                        
                                        
                                    
                                        
                                        
                                            D.6.33. rsu_clear_error_status
                                        
                                        
                                    
                                        
                                        
                                            D.6.34. rsu_reset_retry_counter
                                        
                                        
                                    
                                        
                                        
                                            D.6.35. rsu_dcmf_version
                                        
                                        
                                    
                                        
                                        
                                            D.6.36. rsu_max_retry
                                        
                                        
                                    
                                        
                                        
                                            D.6.37. rsu_dcmf_status
                                        
                                        
                                    
                                        
                                        
                                            D.6.38. rsu_save_spt
                                        
                                        
                                    
                                        
                                        
                                            D.6.39. rsu_restore_spt
                                        
                                        
                                    
                                        
                                        
                                            D.6.40. rsu_save_cpb
                                        
                                        
                                    
                                        
                                        
                                            D.6.41. rsu_create_empty_cpb
                                        
                                        
                                    
                                        
                                        
                                            D.6.42. rsu_restore_cpb
                                        
                                        
                                    
                                        
                                        
                                            D.6.43. rsu_running_factory
                                        
                                        
                                    
                                
                            
                                    
                                    
                                        
                                        
                                            D.7.1. count
                                        
                                        
                                    
                                        
                                        
                                            D.7.2. list
                                        
                                        
                                    
                                        
                                        
                                            D.7.3. size
                                        
                                        
                                    
                                        
                                        
                                            D.7.4. priority
                                        
                                        
                                    
                                        
                                        
                                            D.7.5. enable
                                        
                                        
                                    
                                        
                                        
                                            D.7.6. disable
                                        
                                        
                                    
                                        
                                        
                                            D.7.7. request
                                        
                                        
                                    
                                        
                                        
                                            D.7.8. request-factory
                                        
                                        
                                    
                                        
                                        
                                            D.7.9. erase
                                        
                                        
                                    
                                        
                                        
                                            D.7.10. add
                                        
                                        
                                    
                                        
                                        
                                            D.7.11. add-factory-update
                                        
                                        
                                    
                                        
                                        
                                            D.7.12. add-raw
                                        
                                        
                                    
                                        
                                        
                                            D.7.13. verify
                                        
                                        
                                    
                                        
                                        
                                            D.7.14. verify-raw
                                        
                                        
                                    
                                        
                                        
                                            D.7.15. copy
                                        
                                        
                                    
                                        
                                        
                                            D.7.16. log
                                        
                                        
                                    
                                        
                                        
                                            D.7.17. notify
                                        
                                        
                                    
                                        
                                        
                                            D.7.18. clear-error-status
                                        
                                        
                                    
                                        
                                        
                                            D.7.19. reset-retry-counter
                                        
                                        
                                    
                                        
                                        
                                            D.7.20. display-dcmf-version
                                        
                                        
                                    
                                        
                                        
                                            D.7.21. display-dcmf-status
                                        
                                        
                                    
                                        
                                        
                                            D.7.22. display-max-retry
                                        
                                        
                                    
                                        
                                        
                                            D.7.23. create-slot
                                        
                                        
                                    
                                        
                                        
                                            D.7.24. delete-slot
                                        
                                        
                                    
                                        
                                        
                                            D.7.25. restore-spt
                                        
                                        
                                    
                                        
                                        
                                            D.7.26. save-spt
                                        
                                        
                                    
                                        
                                        
                                            D.7.27. create-empty-cpb
                                        
                                        
                                    
                                        
                                        
                                            D.7.28. restore-cpb
                                        
                                        
                                    
                                        
                                        
                                            D.7.29. save-cpb
                                        
                                        
                                    
                                        
                                        
                                            D.7.30. check-running-factory
                                        
                                        
                                    
                                        
                                        
                                            D.7.31. help
                                        
                                        
                                    
                                
                            1.1. Features
    The remote system update solution: 
    
 
   - Provides support for creating the initial flash image for a system to support RSU. The image is created offline, before the device is deployed in the field.
- Provides the ability to load a specific application image or the factory image.2
- Allows a set of application images to be tried in a specific order until one is successful.3 4
- Loads a factory image if no application image is available, or all application images failed.5
- Provides the direct factory image fallback option. When enabled, the factory image is loaded after an application image configuration is unsuccessful, instead of trying the next application image in the list.
- Provides a pin to force load the factory image instead of the highest priority application image if asserted during a configuration caused by a POR or nCONFIG event.
- Provides the ability to add and remove application images.
- Provides the ability to change the order in which the application images are initially loaded.
- Provides information about the image that is currently running, and errors that the RSU has encountered.
- Provides the RSU Notify feature, which allows a 16-bit value reported by HPS software to survive when the current image fails due to a watchdog timeout. The value can then be queried from HPS software after the next image is loaded.
- Provides the max retry option, which allows each application image and the factory image the option to be tried up to three times. For more information, refer to the Retrying when Configuration Fails section.
- Provides a flow to update the factory image.
- Provides a flow for updating the decision firmware.
- Fully supports both FPGA configuration first and HPS boots first use cases. The HPS boots first case produce smaller configuration bitstreams, which can enable a smaller QSPI device to be used.
- Provides multi-QSPI support which allows you to extend the non-volatile memory area to store the QSPI initial image.
For a description of the image selection flow that occurs when the RSU enabled device is configured as a result of a power-up or nCONFIG event, refer to the Configuration Flow Diagrams appendix.
For more information about the watchdog timer, refer to the Remote System Update Watchdog and Enabling HPS Watchdog to Trigger RSU sections.
  2 The factory and application images are also called bitstreams and typically contain the FPGA fabric configuration, the SDM firmware, and the HPS First Stage Bootloader.  Note: For HPS first mode, the FPGA fabric configuration is omitted. 
 
 
 
  3 When configuration succeeds, the HPS First Stage Bootloader is loaded and the HPS is taken out of reset (or just the HPS and HPS EMIF I/Os when in HPS first mode). Optionally, an HPS watchdog timeout can be treated as a RSU failure too. 
 
 
 
  4 A maximum of seven application images can be specified at image creation time, but more can be added later. The maximum number of application images is 126; but typically only a few are used because flash memory size is limited. 
 
 
 
  5 If the factory image also fails to configure, the SDM clears the FPGA and HPS and the device remains not configured.