[keymgr] Handle keymgr disable during reset -> init transition
Also handle keymgr disable during the initial arc.
Note however, it is possible for the operation to complete at the
same time keymgr_en dropping low. To the keymgr, this does not seem
like an error because the operation is "done".
Fixes #5922
Signed-off-by: Timothy Chen <timothytim@google.com>
diff --git a/hw/ip/keymgr/rtl/keymgr_ctrl.sv b/hw/ip/keymgr/rtl/keymgr_ctrl.sv
index 99ac245..9c10dfa 100644
--- a/hw/ip/keymgr/rtl/keymgr_ctrl.sv
+++ b/hw/ip/keymgr/rtl/keymgr_ctrl.sv
@@ -400,8 +400,9 @@
// reseed entropy
StCtrlEntropyReseed: begin
prng_reseed_req_o = 1'b1;
+
if (prng_reseed_ack_i) begin
- state_d = StCtrlRandom;
+ state_d = en_i ? StCtrlRandom : StCtrlWipe;
end
end
@@ -411,7 +412,7 @@
random_req = 1'b1;
if (random_ack) begin
- state_d = StCtrlRootKey;
+ state_d = en_i ? StCtrlRootKey : StCtrlWipe;
end
end