You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/axi_recovery_flow.md
+20-11Lines changed: 20 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,34 @@ The transactions to the core may be filtered using the AXI ID field (see {doc}`a
14
14
15
15
The logic is implemented so that the recovery firmware in the Caliptra RoT ROM can operate without any changes.
16
16
17
+
In order to enable setting W1C fields in recovery registers over AXI, the AXI recovery mode introduces additional register - `REC_INTF_REG_W1C_ACCESS`.
18
+
17
19
### AXI-based recovery procedure
18
20
19
21
The Caliptra MCU RISC-V core is responsible for driving the data copied from an external memory (e.g. QSPI interface) to the recovery FIFOs.
20
22
The ROM running on the MCU core monitors the recovery block registers and performs the recovery flow.
21
23
During the boot procedure the ROM will have to follow the following procedure:
22
24
23
25
1. Set the I3C block to the "direct AXI" mode
24
-
2. Poll the `DEVICE_STATUS` register and wait for the recovery to be enabled by the Caliptra core
26
+
1. Set the `REC_INTF_BYPASS` bit in the `REC_INTF_CFG` register
27
+
2. Poll the `DEVICE_STATUS_0` register and wait for the recovery to be enabled by the Caliptra core
28
+
1. Poll `DEVICE_STATUS_0.DEV_STATUS` until it becomes `0x03` (Recovery mode - ready to accept recovery image)
25
29
3. Read the `RECOVERY_STATUS` register and check if the recovery flow started
26
-
4. Write to the `RECOVERY_CONTROL` register to set the recovery image configuration
27
-
5. Write to the `INDIRECT_FIFO_CTRL` register to set the recovery image size
28
-
6. Push the recovery image to the recovery interface FIFOs:
29
-
30
-
a. Read the `INDIRECT_FIFO_STATUS` register to determine remaining space in the indirect FIFO
31
-
b. If the indirect FIFO is not full, write a chunk of data to the `INDIRECT_FIFO_DATA` register
32
-
c. The above steps should be repeated until the whole recovery image is written to the FIFO
33
-
34
-
7. Activate the new image by writing to the `RECOVERY_CTRL` register
35
-
8. Read the `RECOVERY_STATUS` register to ensure the image has been activated
30
+
1. Check whether `RECOVERY_STATUS.DEV_REC_STATUS` is `0x1` (Awaiting recovery image)
31
+
4. Write to the `RECOVERY_CTRL` register to set the recovery image configuration
32
+
5. Write to the `INDIRECT_FIFO_CTRL_0` register to reset the FIFO
33
+
6. Write to the `INDIRECT_FIFO_CTRL_1` register to set the recovery image size
34
+
7. Push the recovery image to the recovery interface FIFOs:
35
+
1. Read the `INDIRECT_FIFO_STATUS` register to determine remaining space in the indirect FIFO
36
+
1. If the indirect FIFO is not full, write a chunk of data to the `TX_DATA_PORT` register
37
+
2. If the indirect FIFO is full, wait for the `INDIRECT_FIFO_STATUS_0.FULL` bit to clear
38
+
2. The above steps should be repeated until the whole recovery image is written to the FIFO
39
+
8. Notify the recovery handler that the final chunk has been sent
40
+
1. Set the `REC_PAYLOAD_DONE` bit in the `REC_INTF_CFG` register to raise the `payload_available` signal for the final time
41
+
9. Activate the new image
42
+
1. Write `0xf00` to the `REC_INTF_REG_W1C_ACCESS` register to update the `RECOVERY_CTRL` field
43
+
10. Read the `RECOVERY_STATUS` register to ensure the image has been activated
44
+
1. Poll `RECOVERY_STATUS.DEV_REC_STATUS` until it becomes `0x3` (Recovery successful); before the image is activated, this field will be `0x2` (Booting recovery image)
36
45
37
46
The recovery image will be written in chunks with length equal to or less than `Max transfer size` defined in the `INDIRECT_FIFO_STATUS` register.
38
47
Once the last data chunk is written to the FIFO, the Caliptra MCU ROM will write a CSR in the Secure Firmware Recovery register file indicating the transfer is complete.
0 commit comments