Skip to content

Commit 92ef7c0

Browse files
jwnrtpamaury
authored andcommitted
[dice_chain] Handle flash_ctrl_recov_err in modif_digest
This test intentionally trigger recoverable errors. These lead to alerts which we acknowledge in this commit. Signed-off-by: James Wainwright <[email protected]> (partially cherry picked from commit fc0b671)
1 parent e1286db commit 92ef7c0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sw/device/silicon_creator/rom_ext/e2e/dice_chain/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ opentitan_binary(
148148
],
149149
deps = [
150150
"//hw/top:flash_ctrl_c_regs",
151+
"//hw/top/dt",
151152
"//sw/device/lib/base:status",
152153
"//sw/device/lib/runtime:log",
154+
"//sw/device/lib/testing/test_framework:ottf_alerts",
153155
"//sw/device/lib/testing/test_framework:ottf_main",
154156
"//sw/device/silicon_creator/lib/drivers:flash_ctrl",
155157
"//sw/device/silicon_creator/lib/drivers:hmac",

sw/device/silicon_creator/rom_ext/e2e/dice_chain/modify_digest.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
#include "sw/device/lib/base/status.h"
66
#include "sw/device/lib/runtime/log.h"
7+
#include "sw/device/lib/testing/test_framework/ottf_alerts.h"
78
#include "sw/device/lib/testing/test_framework/ottf_main.h"
89
#include "sw/device/silicon_creator/lib/drivers/flash_ctrl.h"
910
#include "sw/device/silicon_creator/lib/drivers/hmac.h"
1011

1112
#include "hw/top/flash_ctrl_regs.h"
13+
#include "hw/top/dt/flash_ctrl.h"
1214

1315
OTTF_DEFINE_TEST_CONFIG();
1416

@@ -41,6 +43,12 @@ static status_t modify_digest_test(void) {
4143
}
4244

4345
bool test_main(void) {
46+
// This test intentionally creates an invalid digest triggering recoverable
47+
// errors. Ignore the alert in OTTF.
48+
CHECK_STATUS_OK(
49+
ottf_alerts_expect_alert_start(dt_flash_ctrl_alert_to_alert_id(
50+
kDtFlashCtrlFirst, kDtFlashCtrlAlertRecovErr)));
51+
4452
status_t sts = modify_digest_test();
4553
if (status_err(sts)) {
4654
LOG_ERROR("modify_digest_test: %r", sts);

0 commit comments

Comments
 (0)