33//! Falcon microprocessor base support
44
55use core:: ops:: Deref ;
6- use core:: time:: Duration ;
76use hal:: FalconHal ;
87use kernel:: bindings;
98use kernel:: device;
109use kernel:: prelude:: * ;
10+ use kernel:: time:: Delta ;
1111use kernel:: types:: ARef ;
1212
1313use crate :: dma:: DmaObject ;
@@ -353,7 +353,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
353353 /// Wait for memory scrubbing to complete.
354354 fn reset_wait_mem_scrubbing ( & self , bar : & Bar0 ) -> Result {
355355 // TIMEOUT: memory scrubbing should complete in less than 20ms.
356- util:: wait_on ( Duration :: from_millis ( 20 ) , || {
356+ util:: wait_on ( Delta :: from_millis ( 20 ) , || {
357357 if regs:: NV_PFALCON_FALCON_HWCFG2 :: read ( bar, E :: BASE ) . mem_scrubbing_done ( ) {
358358 Some ( ( ) )
359359 } else {
@@ -368,7 +368,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
368368
369369 // According to OpenRM's `kflcnPreResetWait_GA102` documentation, HW sometimes does not set
370370 // RESET_READY so a non-failing timeout is used.
371- let _ = util:: wait_on ( Duration :: from_micros ( 150 ) , || {
371+ let _ = util:: wait_on ( Delta :: from_micros ( 150 ) , || {
372372 let r = regs:: NV_PFALCON_FALCON_HWCFG2 :: read ( bar, E :: BASE ) ;
373373 if r. reset_ready ( ) {
374374 Some ( ( ) )
@@ -381,7 +381,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
381381
382382 // TODO[DLAY]: replace with udelay() or equivalent once available.
383383 // TIMEOUT: falcon engine should not take more than 10us to reset.
384- let _: Result = util:: wait_on ( Duration :: from_micros ( 10 ) , || None ) ;
384+ let _: Result = util:: wait_on ( Delta :: from_micros ( 10 ) , || None ) ;
385385
386386 regs:: NV_PFALCON_FALCON_ENGINE :: alter ( bar, E :: BASE , |v| v. set_reset ( false ) ) ;
387387
@@ -472,7 +472,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
472472 // Wait for the transfer to complete.
473473 // TIMEOUT: arbitrarily large value, no DMA transfer to the falcon's small memories
474474 // should ever take that long.
475- util:: wait_on ( Duration :: from_secs ( 2 ) , || {
475+ util:: wait_on ( Delta :: from_secs ( 2 ) , || {
476476 let r = regs:: NV_PFALCON_FALCON_DMATRFCMD :: read ( bar, E :: BASE ) ;
477477 if r. idle ( ) {
478478 Some ( ( ) )
@@ -542,7 +542,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
542542 }
543543
544544 // TIMEOUT: arbitrarily large value, firmwares should complete in less than 2 seconds.
545- util:: wait_on ( Duration :: from_secs ( 2 ) , || {
545+ util:: wait_on ( Delta :: from_secs ( 2 ) , || {
546546 let r = regs:: NV_PFALCON_FALCON_CPUCTL :: read ( bar, E :: BASE ) ;
547547 if r. halted ( ) {
548548 Some ( ( ) )
0 commit comments