Skip to content

Commit e98f2e6

Browse files
[otp_ctrl, doc] Explicit integrity/consistency check write order
In the otp_ctrl an integrity/consistency check is triggered as soon as either the `INTEGRITY_CHECK_PERIOD` or `CONSISTENCY_CHECK_PERIOD` registers are written. The following check, depending on the number of instantiated partitions, may last for hundreds of cycles. Writing a value into the `CHECK_TIMEOUT` register while the checks are still ongoing will trigger an unnecessary timeout error that transfers the otp_ctlr into an error state. This commit adjusts the documentation to make it clear that the `CHECK_TIMEOUT` register should be written before `INTEGRITY_CHECK_PERIOD` and `CONSISTENCY_CHECK_PERIOD`. Following the Programmer's Guide verbatim before may lead to implementations that trigger this unintended error condition. Signed-off-by: Andrea Caforio <[email protected]> (cherry picked from commit ebaf6b7)
1 parent 1396795 commit e98f2e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: hw/ip/otp_ctrl/doc/programmers_guide.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ The only initialization steps that SW should perform are:
1515

1616
1. Check that the OTP controller has successfully initialized by reading [`STATUS`](registers.md#status). I.e., make sure that none of the ERROR bits are set, and that the DAI is idle ([`STATUS.DAI_IDLE`](registers.md#status)).
1717
2. Set up the periodic background checks:
18-
- Choose whether to enable periodic [background checks](#partition-checks) by programming nonzero mask values to [`INTEGRITY_CHECK_PERIOD`](registers.md#integrity_check_period) and [`CONSISTENCY_CHECK_PERIOD`](registers.md#consistency_check_period).
19-
- Choose whether such checks shall be subject to a timeout by programming a nonzero timeout cycle count to [`CHECK_TIMEOUT`](registers.md#check_timeout).
18+
- Choose whether the periodic [background checks](#partition-checks) shall be subject to a timeout by programming a nonzero timeout cycle count to [`CHECK_TIMEOUT`](registers.md#check_timeout).
19+
In this case, the [`CHECK_TIMEOUT`](registers.md#check_timeout) register must be set before the [`INTEGRITY_CHECK_PERIOD`](registers.md#integrity_check_period) and [`CONSISTENCY_CHECK_PERIOD`](registers.md#consistency_check_period) registers (see next point).
20+
- Enable periodic [background checks](#partition-checks) by programming nonzero mask values to [`INTEGRITY_CHECK_PERIOD`](registers.md#integrity_check_period) and [`CONSISTENCY_CHECK_PERIOD`](registers.md#consistency_check_period).
2021
- It is recommended to lock down the background check registers via [`CHECK_REGWEN`](registers.md#check_regwen), once the background checks have been set up.
2122

2223
If needed, one-off integrity and consistency checks can be triggered via [`CHECK_TRIGGER`](registers.md#check_trigger).

0 commit comments

Comments
 (0)