Skip to content

Commit 06b7206

Browse files
committed
[ot] Update CSRNG SW_CMD_STS.CMD_RDY
CMD_RDY is gated on CTRL.ENABLE since commit 042e0b9158. This change is needed to, for instance, make `csrng_send_app_cmd` progress when it loops waiting for the "status register to be ready to accept the next command." Signed-off-by: Luís Marques <luismarques@lowrisc.org>
1 parent a484863 commit 06b7206

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hw/opentitan/ot_csrng.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s)
908908
xtrace_ot_csrng_info("enable: no ES gen tracking", gennum);
909909
}
910910
s->enabled = true;
911+
s->regs[R_SW_CMD_STS] |= R_SW_CMD_STS_CMD_RDY_MASK;
911912
s->es_retry_count = ENTROPY_SRC_INITIAL_REQUEST_COUNT;
912913
s->entropy_gennum = gennum;
913914
}
@@ -934,6 +935,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s)
934935
}
935936
}
936937
s->enabled = false;
938+
s->regs[R_SW_CMD_STS] &= ~R_SW_CMD_STS_CMD_RDY_MASK;
937939
s->es_retry_count = 0;
938940
s->entropy_gennum = cls->get_random_generation(randif);
939941
xtrace_ot_csrng_info("disable: last RS generation", s->entropy_gennum);

0 commit comments

Comments
 (0)