43
43
#include "hw/riscv/ibex_common.h"
44
44
#include "hw/riscv/ibex_irq.h"
45
45
#include "hw/sysbus.h"
46
- #include "sysemu/hw_accel.h"
47
46
#include "sysemu/runstate.h"
48
47
#include "trace.h"
49
48
@@ -147,6 +146,7 @@ struct OtRstMgrState {
147
146
SysBusDevice parent_obj ;
148
147
149
148
MemoryRegion mmio ;
149
+ IbexIRQ soc_reset ;
150
150
IbexIRQ sw_reset ;
151
151
IbexIRQ alerts [PARAM_NUM_ALERTS ];
152
152
QEMUBH * bus_reset_bh ;
@@ -228,12 +228,7 @@ static void ot_rstmgr_reset_bus(void *opaque)
228
228
}
229
229
qemu_notify_event ();
230
230
231
- cpu_synchronize_state (s -> cpu );
232
- /* Reset all OpenTitan devices connected to RSTMGR parent bus */
233
- bus_cold_reset (s -> parent_obj .parent_obj .parent_bus );
234
- cpu_synchronize_post_reset (s -> cpu );
235
-
236
- /* TODO: manage reset tree (depending on power domains, etc.) */
231
+ ibex_irq_raise (& s -> soc_reset );
237
232
}
238
233
239
234
static int ot_rstmgr_sw_rst_walker (DeviceState * dev , void * opaque )
@@ -393,7 +388,7 @@ static void ot_rstmgr_regs_write(void *opaque, hwaddr addr, uint64_t val64,
393
388
* "Upon completion of reset, this bit is automatically cleared by
394
389
* hardware."
395
390
*/
396
- ibex_irq_set (& s -> sw_reset , ( int )true );
391
+ ibex_irq_raise (& s -> sw_reset );
397
392
if (s -> fatal_reset ) {
398
393
s -> fatal_reset -- ;
399
394
if (!s -> fatal_reset ) {
@@ -544,7 +539,8 @@ static void ot_rstmgr_reset(DeviceState *dev)
544
539
s -> regs [R_SW_RST_CTRL_N_0 + ix ] = 0x1u ;
545
540
}
546
541
547
- ibex_irq_set (& s -> sw_reset , 0 );
542
+ ibex_irq_lower (& s -> soc_reset );
543
+ ibex_irq_lower (& s -> sw_reset );
548
544
ot_rstmgr_update_alerts (s );
549
545
}
550
546
@@ -558,6 +554,7 @@ static void ot_rstmgr_init(Object *obj)
558
554
559
555
s -> regs = g_new0 (uint32_t , REGS_COUNT );
560
556
557
+ ibex_qdev_init_irq (obj , & s -> soc_reset , OT_RSTMGR_SOC_RST );
561
558
ibex_qdev_init_irq (obj , & s -> sw_reset , OT_RSTMGR_SW_RST );
562
559
ibex_qdev_init_irqs (obj , s -> alerts , OT_DEVICE_ALERT , PARAM_NUM_ALERTS );
563
560
0 commit comments