Visible to Intel only — GUID: lgs1606327240051
Ixiasoft
Visible to Intel only — GUID: lgs1606327240051
Ixiasoft
7.4.5.4. Corrupted Sub-Partition Table
- Power up the board, boot up to the U-Boot prompt and query 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
The highest priority image is running, and there are no errors.
- Corrupt SPT0 file by erasing the flash at its location:
SOCFPGA # sf probe SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB SOCFPGA # sf erase 0x0910000 0x1000 SF: 4096 bytes @ 0x910000 Erased: OK
- Power cycle the board, stop to U-Boot prompt and query RSU status:
SOCFPGA # rsu status_log SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB Bad SPT0 magic number 0xFFFFFFFF Restoring SPT0 Current Image : 0x01000000 Last Fail Image : 0x00000000 State : 0x00000000 Version : 0x00000202 Error location : 0x00000000 Error details : 0x00000000 Retry counter : 0x00000000
The decision firmware loads the higest priority image, and it does not look at the SPTs. The rsu_init function is called when the first RSU U-Boot command is executed, it detects that the SPT0 is corrupted, and it recovers it from SPT1.
- Save the currently used SPT to a file for backup purposes:
SOCFPGA # rsu save_spt ${loadaddr} 4100 bytes SPT data saved SOCFPGA # fatwrite mmc 0:1 ${loadaddr} spt-backup.bin ${filesize} 4100 bytes written
- Corrupt both SPTs by erasing the flash at their locations:
SOCFPGA # sf probe SF: Detected mt25qu02g with page size 256 Bytes, erase size 4 KiB, total 256 MiB SOCFPGA # sf erase 0x910000 0x1000 SF: 4096 bytes @ 0x910000 Erased: OK SOCFPGA # sf erase 0x918000 0x1000 SF: 4096 bytes @ 0x918000 Erased: OK
- Power cycle the board, stop to U-Boot prompt and query RSU status:
SOCFPGA # rsu status_log Bad SPT1 magic number 0xFFFFFFFF Bad SPT0 magic number 0xFFFFFFFF no valid SPT0 and SPT1 found Current Image : 0x01000000 Last Fail Image : 0x00000000 State : 0x00000000 Version : 0x00000202 Error location : 0x00000000 Error details : 0x00000000 Retry counter : 0x00000000
The decision firmware loads the higest priority image, and it does not look at the SPTs. The rsu_init function is called when the first RSU U-Boot command is executed and it detects that both SPTs are corrupted.
- Try to run an RSU command which requires a valid SPT - it fails:
SOCFPGA # rsu slot_count corrupted SPT --run rsu restore_spt <address> first
- Restore the SPT from the backup copy that we have created:
SOCFPGA # fatload mmc 0:1 ${loadaddr} spt-backup.bin 4100 bytes read in 2 ms (2 MiB/s) SOCFPGA # rsu restore_spt ${loadaddr}
- Power cycle the board, the highest priority image loads, and all functionality is available. This power cycle is needed to cause the rsu_init function to be called in U-Boot, as it is only called once when the first RSU command is called.