Skip to content

Commit 14346ff

Browse files
committed
[ot] hw/opentitan: ot_flash: Add trace on reset
This helps debugging races involving flash resets, so it is quite useful to have as a trace. Signed-off-by: Alex Jones <[email protected]>
1 parent b0c3eab commit 14346ff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

hw/opentitan/ot_flash.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,6 +3175,8 @@ static void ot_flash_reset_enter(Object *obj, ResetType type)
31753175
OtFlashClass *c = OT_FLASH_GET_CLASS(obj);
31763176
OtFlashState *s = OT_FLASH(obj);
31773177

3178+
trace_ot_flash_reset(s->ot_id, "enter");
3179+
31783180
if (c->parent_phases.enter) {
31793181
c->parent_phases.enter(obj, type);
31803182
}
@@ -3293,6 +3295,8 @@ static void ot_flash_reset_exit(Object *obj, ResetType type)
32933295
OtFlashClass *c = OT_FLASH_GET_CLASS(obj);
32943296
OtFlashState *s = OT_FLASH(obj);
32953297

3298+
trace_ot_flash_reset(s->ot_id, "exit");
3299+
32963300
if (c->parent_phases.exit) {
32973301
c->parent_phases.exit(obj, type);
32983302
}

hw/opentitan/trace-events

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ ot_flash_op_prog(const char* id, unsigned op_addr, unsigned count, unsigned rema
215215
ot_flash_op_start(const char* id, const char *op, bool hw) "%s: %s (hw=%u)"
216216
ot_flash_prog_word(const char* id, bool info_part, unsigned word_addr, uint32_t word) "%s: info_part %u word_addr %u word %u"
217217
ot_flash_read_keymgr_seed(const char* id, unsigned page, bool success) "%s: %u: %u"
218+
ot_flash_reset(const char *id, const char *phase) "%s: %s"
218219
ot_flash_reset_fifo(const char* id, const char *name) "%s: %s"
219220
ot_flash_set_error(const char* id, const char *op, bool hw, uint32_t err_code, uint32_t err_addr) "%s: %s (hw=%u): err=0x%08x at addr=0x%06x"
220221
ot_flash_update_alert(const char* id, int prev, int next) "%s: %d -> %d"

0 commit comments

Comments
 (0)