@@ -668,6 +668,8 @@ struct STM32F4xxUSBState {
668
668
#endif
669
669
bool debug ;
670
670
671
+ bool disable_sofi ;
672
+
671
673
bool is_device_mode ;
672
674
673
675
char cdc_in ;
@@ -932,7 +934,10 @@ static void STM32F4xx_sof(STM32F4xxUSBState *s)
932
934
s -> sof_time += s -> usb_frame_time ;
933
935
// trace_usb_stm_sof(s->sof_time);
934
936
STM32F4xx_eof_timer (s );
935
- STM32F4xx_raise_global_irq (s , GINTSTS_SOF );
937
+ if (!s -> disable_sofi )
938
+ {
939
+ STM32F4xx_raise_global_irq (s , GINTSTS_SOF );
940
+ }
936
941
}
937
942
938
943
/* Do frame processing on frame boundary */
@@ -3174,6 +3179,11 @@ static void STM32F4xx_realize(DeviceState *dev, Error **errp)
3174
3179
s -> cdc_timer = timer_new_us (QEMU_CLOCK_VIRTUAL , STM32F4xx_cdc_helper , s );
3175
3180
s -> async_bh = qemu_bh_new (STM32F4xx_work_bh , s );
3176
3181
3182
+ if (s -> disable_sofi )
3183
+ {
3184
+ printf ("USB SOF Int disabled.\n" );
3185
+ }
3186
+
3177
3187
sysbus_init_irq (sbd , & s -> irq );
3178
3188
3179
3189
qemu_chr_fe_set_handlers (& s -> cdc , f4xx_usb_cdc_can_receive , f4xx_usb_cdc_receive , NULL ,
@@ -3303,6 +3313,7 @@ static Property STM32F4xx_usb_properties[] = {
3303
3313
DEFINE_PROP_UINT32 ("usb_version" , STM32F4xxUSBState , usb_version , 2 ),
3304
3314
DEFINE_PROP_CHR ("chardev" , STM32F4xxUSBState , cdc ),
3305
3315
DEFINE_PROP_LINK ("system-memory" , STM32F4xxUSBState , cpu_mr , TYPE_MEMORY_REGION , MemoryRegion * ),
3316
+ DEFINE_PROP_BOOL ("disable_sof_interrupt" , STM32F4xxUSBState , disable_sofi , false),
3306
3317
DEFINE_PROP_END_OF_LIST (),
3307
3318
};
3308
3319
0 commit comments