3
3
//! Falcon microprocessor base support
4
4
5
5
use core:: ops:: Deref ;
6
- use core:: time:: Duration ;
7
6
use hal:: FalconHal ;
8
7
use kernel:: bindings;
9
8
use kernel:: device;
10
9
use kernel:: prelude:: * ;
10
+ use kernel:: time:: Delta ;
11
11
use kernel:: types:: ARef ;
12
12
13
13
use crate :: dma:: DmaObject ;
@@ -353,7 +353,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
353
353
/// Wait for memory scrubbing to complete.
354
354
fn reset_wait_mem_scrubbing ( & self , bar : & Bar0 ) -> Result {
355
355
// 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 ) , || {
357
357
if regs:: NV_PFALCON_FALCON_HWCFG2 :: read ( bar, E :: BASE ) . mem_scrubbing_done ( ) {
358
358
Some ( ( ) )
359
359
} else {
@@ -368,7 +368,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
368
368
369
369
// According to OpenRM's `kflcnPreResetWait_GA102` documentation, HW sometimes does not set
370
370
// 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 ) , || {
372
372
let r = regs:: NV_PFALCON_FALCON_HWCFG2 :: read ( bar, E :: BASE ) ;
373
373
if r. reset_ready ( ) {
374
374
Some ( ( ) )
@@ -381,7 +381,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
381
381
382
382
// TODO[DLAY]: replace with udelay() or equivalent once available.
383
383
// 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 ) ;
385
385
386
386
regs:: NV_PFALCON_FALCON_ENGINE :: alter ( bar, E :: BASE , |v| v. set_reset ( false ) ) ;
387
387
@@ -472,7 +472,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
472
472
// Wait for the transfer to complete.
473
473
// TIMEOUT: arbitrarily large value, no DMA transfer to the falcon's small memories
474
474
// should ever take that long.
475
- util:: wait_on ( Duration :: from_secs ( 2 ) , || {
475
+ util:: wait_on ( Delta :: from_secs ( 2 ) , || {
476
476
let r = regs:: NV_PFALCON_FALCON_DMATRFCMD :: read ( bar, E :: BASE ) ;
477
477
if r. idle ( ) {
478
478
Some ( ( ) )
@@ -542,7 +542,7 @@ impl<E: FalconEngine + 'static> Falcon<E> {
542
542
}
543
543
544
544
// 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 ) , || {
546
546
let r = regs:: NV_PFALCON_FALCON_CPUCTL :: read ( bar, E :: BASE ) ;
547
547
if r. halted ( ) {
548
548
Some ( ( ) )
0 commit comments