diff options
Diffstat (limited to 'bsps/sparc/leon3/start/cpucounter.c')
-rw-r--r-- | bsps/sparc/leon3/start/cpucounter.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bsps/sparc/leon3/start/cpucounter.c b/bsps/sparc/leon3/start/cpucounter.c index df71914910..d325e7f65a 100644 --- a/bsps/sparc/leon3/start/cpucounter.c +++ b/bsps/sparc/leon3/start/cpucounter.c @@ -49,6 +49,7 @@ static void leon3_counter_use_irqamp_timestamp( } #endif +#if !defined(LEON3_HAS_ASR_22_23_UP_COUNTER) static void leon3_counter_use_gptimer(SPARC_Counter *counter, gptimer *gpt) { gptimer_timer *timer; @@ -69,19 +70,25 @@ static void leon3_counter_use_gptimer(SPARC_Counter *counter, gptimer *gpt) (grlib_load_32(&gpt->sreload) + 1); #endif } +#endif static void leon3_counter_initialize(void) { #if defined(LEON3_IRQAMP_PROBE_TIMESTAMP) irqamp_timestamp *irqmp_ts; #endif +#if !defined(LEON3_HAS_ASR_22_23_UP_COUNTER) gptimer *gpt; +#endif SPARC_Counter *counter; counter = &_SPARC_Counter_mutable; leon3_up_counter_enable(); +#if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) + leon3_counter_use_up_counter(counter); +#else /* LEON3_HAS_ASR_22_23_UP_COUNTER */ if (leon3_up_counter_is_available()) { /* Use the LEON4 up-counter if available */ leon3_counter_use_up_counter(counter); @@ -104,6 +111,7 @@ static void leon3_counter_initialize(void) /* Fall back to the first GPTIMER if available */ leon3_counter_use_gptimer(counter, gpt); } +#endif /* LEON3_HAS_ASR_22_23_UP_COUNTER */ } RTEMS_SYSINIT_ITEM( |