Skip to content

Commit

Permalink
[manuf] add delay to OTP writes
Browse files Browse the repository at this point in the history
DO NOT MERGE; FOR TESTING ONLY

Allow charge pump to recover on real silicon.

Signed-off-by: Tim Trippel <[email protected]>
  • Loading branch information
timothytrippel committed Dec 18, 2024
1 parent 26f093b commit fc4d672
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions sw/device/lib/testing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ cc_library(
target_compatible_with = [OPENTITAN_CPU],
deps = [
"//sw/device/lib/dif:otp_ctrl",
"//sw/device/lib/runtime:hart",
"//sw/device/lib/runtime:ibex",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing/test_framework:check",
Expand Down
7 changes: 7 additions & 0 deletions sw/device/lib/testing/otp_ctrl_testutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "sw/device/lib/testing/otp_ctrl_testutils.h"

#include "sw/device/lib/dif/dif_otp_ctrl.h"
#include "sw/device/lib/runtime/hart.h"
#include "sw/device/lib/runtime/ibex.h"
#include "sw/device/lib/runtime/log.h"
#include "sw/device/lib/testing/test_framework/check.h"
Expand Down Expand Up @@ -173,6 +174,9 @@ status_t otp_ctrl_testutils_dai_write32(const dif_otp_ctrl_t *otp,
if (read_data != buffer[i]) {
return INTERNAL();
}

// Wait for charge pump to recover.
busy_spin_micros(10000); // 10ms
}
return OK_STATUS();
}
Expand All @@ -194,6 +198,9 @@ status_t otp_ctrl_testutils_dai_write64(const dif_otp_ctrl_t *otp,
if (read_data != buffer[i]) {
return INTERNAL();
}

// Wait for charge pump to recover.
busy_spin_micros(10000); // 10ms
}
return OK_STATUS();
}

0 comments on commit fc4d672

Please sign in to comment.