From 7b3560cf4c38905e7985437cfd0b43b0c1e3c8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Marques?= Date: Fri, 29 Nov 2024 12:02:44 +0000 Subject: [PATCH] [ot] Update CSRNG SW_CMD_STS.CMD_RDY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- hw/opentitan/ot_csrng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/opentitan/ot_csrng.c b/hw/opentitan/ot_csrng.c index 6384d43e3e914..16d2ab36c57a9 100644 --- a/hw/opentitan/ot_csrng.c +++ b/hw/opentitan/ot_csrng.c @@ -908,6 +908,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s) xtrace_ot_csrng_info("enable: no ES gen tracking", gennum); } s->enabled = true; + s->regs[R_SW_CMD_STS] |= R_SW_CMD_STS_CMD_RDY_MASK; s->es_retry_count = ENTROPY_SRC_INITIAL_REQUEST_COUNT; s->entropy_gennum = gennum; } @@ -934,6 +935,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s) } } s->enabled = false; + s->regs[R_SW_CMD_STS] &= R_SW_CMD_STS_CMD_RDY_MASK; s->es_retry_count = 0; s->entropy_gennum = cls->get_random_generation(randif); xtrace_ot_csrng_info("disable: last RS generation", s->entropy_gennum);