Skip to content

Commit cce2368

Browse files
committed
[ot] hw/opentitan: ot_flash: Re-enable flash memory region on reset
Although the `DIS` disablement register was being reset on reset, the flash mmio `mem` memory region's enablement was not being reset. This caused some difficult to debug issues due to QEMU's non-determinism where resets could occur before or after SW disables the flash, essentially permanently locking Earlgrey out of its flash. Signed-off-by: Alex Jones <[email protected]>
1 parent 14346ff commit cce2368

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hw/opentitan/ot_flash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,6 +3268,9 @@ static void ot_flash_reset_enter(Object *obj, ResetType type)
32683268

32693269
s->csrs[R_CSR0_REGWEN] = 0x1u;
32703270

3271+
/* restore flash memory region enablement if previously disabled */
3272+
memory_region_set_enabled(&s->mmio.mem, true);
3273+
32713274
s->latched_alerts = 0u;
32723275

32733276
s->lc_broadcast.incoming_signal_bm = 0u;

0 commit comments

Comments
 (0)