Skip to content

Commit

Permalink
[ot] hw/opentitan: fix trace levels: not an error if try function fails
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
  • Loading branch information
rivos-eblot committed Aug 21, 2023
1 parent e57d046 commit 50b9fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hw/opentitan/ot_edn.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,15 @@ static void ot_edn_try_auto_instantiate(OtEDNState *s)

if (ot_fifo32_is_empty(&c->sw_cmd_fifo)) {
/* instantiate command not yet loaded into the SW_CMD_REQ */
xtrace_ot_edn_error(c->appid, "no SW cmd in FIFO");
xtrace_ot_edn_xinfo(c->appid, "no SW cmd in FIFO", 0);
return;
}

uint32_t command = ot_fifo32_peek(&c->sw_cmd_fifo);
uint32_t length = FIELD_EX32(command, OT_CSNRG_CMD, CLEN) + 1u;
if (ot_fifo32_num_used(&c->sw_cmd_fifo) < length) {
/* instantiate command not fully loaded into the SW_CMD_REQ */
xtrace_ot_edn_error(c->appid, "SW cmd FIFO incomplete");
xtrace_ot_edn_xinfo(c->appid, "SW cmd FIFO incomplete", 0);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion hw/opentitan/trace-events
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ot_entropy_src_info(const char *msg) "%s"
ot_entropy_src_init_ongoing(const char *state, int st) "entropy source still initializing in [%s:%u]"
ot_entropy_src_io_read_out(unsigned int addr, const char * regname, uint64_t val, uint64_t pc) "addr=0x%02x (%s), val=0x%" PRIx64 ", pc=0x%" PRIx64
ot_entropy_src_io_write(unsigned int addr, const char * regname, uint64_t val, uint64_t pc) "addr=0x%02x (%s), val=0x%" PRIx64 ", pc=0x%" PRIx64
ot_entropy_src_is_fips_capable(bool en, bool es_route, bool es_type, bool rng_bit_en, bool res) "en:%u rt:%u tp:%u rb:%u => %u"
ot_entropy_src_is_fips_capable(bool en, bool es_route, bool es_type, bool rng_bit_en, bool res) "en:%u rt:%u tp:%u !rb:%u => %u"
ot_entropy_src_no_entropy(unsigned count) "only %u words available"
ot_entropy_src_obs_fifo(unsigned level, unsigned thold) "level %u, threshold %u"
ot_entropy_src_otp_conf(bool fw_read, bool fw_over) "fw_read %u, fw_over %u"
Expand Down

0 comments on commit 50b9fc3

Please sign in to comment.