Skip to content

Commit eb1610d

Browse files
committed
[ot] hw/opentitan: ot_pwrmgr: ensure all traces emit the ot_id string
Signed-off-by: Emmanuel Blot <[email protected]>
1 parent 40b8b2f commit eb1610d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

hw/opentitan/ot_pwrmgr.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static void ot_pwrmgr_rst_req(void *opaque, int irq, int level)
556556
if (s->regs[R_RESET_STATUS]) {
557557
/* do nothing if a reset is already in progress */
558558
/* TODO: is it true for HW vs. SW request ?*/
559-
trace_ot_pwrmgr_ignore_req("reset on-going");
559+
trace_ot_pwrmgr_ignore_req(s->ot_id, "reset on-going");
560560
return;
561561
}
562562
s->regs[R_RESET_STATUS] |= rstbit;
@@ -593,7 +593,7 @@ static void ot_pwrmgr_sw_rst_req(void *opaque, int irq, int level)
593593

594594
if (s->regs[R_RESET_STATUS]) {
595595
/* do nothing if a reset is already in progress */
596-
trace_ot_pwrmgr_ignore_req("reset on-going");
596+
trace_ot_pwrmgr_ignore_req(s->ot_id, "reset on-going");
597597
return;
598598
}
599599

@@ -723,8 +723,9 @@ static void ot_pwrmgr_fast_fsm_tick(OtPwrMgrState *s)
723723
case OT_PWR_FAST_ST_NVM_IDLE_CHK:
724724
case OT_PWR_FAST_ST_LOW_POWER_PREP:
725725
case OT_PWR_FAST_ST_NVM_SHUT_DOWN:
726-
qemu_log_mask(LOG_UNIMP, "%s: low power modes are not implemented\n",
727-
__func__);
726+
qemu_log_mask(LOG_UNIMP,
727+
"%s: %s: low power modes are not implemented\n", __func__,
728+
s->ot_id);
728729
/* fallthrough */
729730
case OT_PWR_FAST_ST_RESET_PREP:
730731
PWR_CHANGE_FAST_STATE(s, RESET_WAIT);
@@ -816,7 +817,8 @@ static void ot_pwrmgr_holdon_fetch(void *opaque, int n, int level)
816817
static void ot_pwrmgr_parse_clocks(OtPwrMgrState *s, Error **errp)
817818
{
818819
if (!s->cfg_clocks) {
819-
error_setg(errp, "%s: clocks config not defined", __func__);
820+
error_setg(errp, "%s: %s: clocks config not defined", __func__,
821+
s->ot_id);
820822
return;
821823
}
822824

@@ -1072,7 +1074,8 @@ static void ot_pwrmgr_realize(DeviceState *dev, Error **errp)
10721074

10731075
if (s->num_rom) {
10741076
if (s->num_rom > 8u * sizeof(uint8_t)) {
1075-
error_setg(&error_fatal, "too many ROMs\n");
1077+
error_setg(&error_fatal, "%s: %s: too many ROMs\n", __func__,
1078+
s->ot_id);
10761079
g_assert_not_reached();
10771080
}
10781081
qdev_init_gpio_in_named(dev, &ot_pwrmgr_rom_good, OT_PWRMGR_ROM_GOOD,

hw/opentitan/trace-events

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ ot_pwrmgr_change_state(const char *id, int line, const char *type, const char *o
468468
ot_pwrmgr_clock_enable(const char *d, const char *clkname, bool enable) "%s: %s en:%u"
469469
ot_pwrmgr_escalate_rx(const char *id, bool level) "%s: level %u"
470470
ot_pwrmgr_go_idle(const char *id, const char *state) "%s: %s"
471-
ot_pwrmgr_ignore_req(const char *reason) "%s"
471+
ot_pwrmgr_ignore_req(const char *id, const char *reason) "%s: %s"
472472
ot_pwrmgr_io_read_out(const char *id, uint32_t addr, const char * regname, uint32_t val, uint32_t pc) "%s: addr=0x%02x (%s), val=0x%x, pc=0x%x"
473473
ot_pwrmgr_io_write(const char *id, uint32_t addr, const char * regname, uint32_t val, uint32_t pc) "%s: addr=0x%02x (%s), val=0x%x, pc=0x%x"
474474
ot_pwrmgr_reset(const char *id, const char *action) "%s: %s"

0 commit comments

Comments
 (0)