@@ -133,6 +133,7 @@ struct OtSramCtrlState {
133
133
uint32_t init_chunk_words ; /* init chunk size in words */
134
134
bool ifetch ; /* only used when no otp_ctrl is defined */
135
135
bool noinit ; /* discard initialization emulation feature */
136
+ bool noswitch ; /* do not switch to performance/host RAM after init */
136
137
};
137
138
138
139
#ifdef OT_SRAM_CTRL_DEBUG
@@ -224,10 +225,14 @@ static bool ot_sram_ctrl_initialize(OtSramCtrlState *s, unsigned count,
224
225
225
226
s -> init_slot_bm = g_new0 (uint64_t , s -> init_slot_count );
226
227
227
- /* switch memory to SRAM */
228
- trace_ot_sram_ctrl_initialization_complete (s -> ot_id , "ctrl" );
229
-
230
- qemu_bh_schedule (s -> switch_mr_bh );
228
+ if (!s -> noswitch ) {
229
+ /* switch memory to SRAM */
230
+ trace_ot_sram_ctrl_initialization_complete (s -> ot_id , "ctrl" );
231
+ qemu_bh_schedule (s -> switch_mr_bh );
232
+ } else {
233
+ trace_ot_sram_ctrl_initialization_complete (s -> ot_id ,
234
+ "ctrl/noswitch" );
235
+ }
231
236
232
237
return true;
233
238
}
@@ -592,14 +597,22 @@ static MemTxResult ot_sram_ctrl_mem_init_write_with_attrs(
592
597
593
598
if (!s -> init_slot_bm [slot ]) {
594
599
if (ot_sram_ctrl_mem_is_fully_initialized (s )) {
600
+ if (!s -> noswitch ) {
601
+ /*
602
+ * perform the memory switch in a BH so that the current mr
603
+ * is not in use when switching
604
+ */
605
+ trace_ot_sram_ctrl_initialization_complete (s -> ot_id ,
606
+ "write" );
607
+
608
+ qemu_bh_schedule (s -> switch_mr_bh );
609
+ } else {
610
+ if (!s -> initialized ) {
611
+ trace_ot_sram_ctrl_initialization_complete (
612
+ s -> ot_id , "write/noswitch" );
613
+ }
614
+ }
595
615
s -> initialized = true;
596
- /*
597
- * perform the memory switch in a BH so that the current mr
598
- * is not in use when switching
599
- */
600
- trace_ot_sram_ctrl_initialization_complete (s -> ot_id , "write" );
601
-
602
- qemu_bh_schedule (s -> switch_mr_bh );
603
616
}
604
617
}
605
618
}
@@ -615,6 +628,7 @@ static Property ot_sram_ctrl_properties[] = {
615
628
DEFINE_PROP_UINT32 ("wci_size" , OtSramCtrlState , init_chunk_words , 0u ),
616
629
DEFINE_PROP_BOOL ("ifetch" , OtSramCtrlState , ifetch , false),
617
630
DEFINE_PROP_BOOL ("noinit" , OtSramCtrlState , noinit , false),
631
+ DEFINE_PROP_BOOL ("noswitch" , OtSramCtrlState , noswitch , false),
618
632
DEFINE_PROP_END_OF_LIST (),
619
633
};
620
634
0 commit comments