File tree 1 file changed +14
-0
lines changed
sw/host/opentitanlib/src/transport/cw310 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,17 @@ impl Transport for CW310 {
216
216
usb. spi1_enable ( false ) ?;
217
217
usb. fpga_program ( & fpga_program. bitstream ) ?;
218
218
Ok ( None )
219
+ } else if let Some ( _set_pll) = action. downcast_ref :: < SetPll > ( ) {
220
+ const TARGET_FREQ : u32 = 100_000_000 ;
221
+ let usb = self . device . borrow ( ) ;
222
+ usb. pll_enable ( true ) ?;
223
+ usb. pll_out_freq_set ( 1 , TARGET_FREQ ) ?;
224
+ usb. pll_out_freq_set ( 2 , TARGET_FREQ ) ?;
225
+ usb. pll_out_enable ( 0 , false ) ?;
226
+ usb. pll_out_enable ( 1 , true ) ?;
227
+ usb. pll_out_enable ( 2 , false ) ?;
228
+ usb. pll_write_defaults ( ) ?;
229
+ Ok ( None )
219
230
} else {
220
231
Err ( TransportError :: UnsupportedOperation . into ( ) )
221
232
}
@@ -233,3 +244,6 @@ pub struct FpgaProgram {
233
244
/// How long to wait for the ROM to print its type and version.
234
245
pub rom_timeout : Duration ,
235
246
}
247
+
248
+ /// Command for Transport::dispatch().
249
+ pub struct SetPll { }
You can’t perform that action at this time.
0 commit comments