diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-10 09:34:32 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-14 12:21:33 +0200 |
commit | 63626a5d2e32335bfd7c91385234c758f0ac41b1 (patch) | |
tree | 4db213ef93e5366b019053b76616de57bdd1beb8 | |
parent | dc167096976e6ca5701b9d2d9e7c39ba653eb95b (diff) |
bsp/leon3: Enable up-counter conditionally
-rw-r--r-- | bsps/sparc/leon3/clock/ckinit.c | 5 | ||||
-rw-r--r-- | bsps/sparc/leon3/start/cpucounter.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bsps/sparc/leon3/clock/ckinit.c b/bsps/sparc/leon3/clock/ckinit.c index b2d8a99e6a..60ef5d3ab6 100644 --- a/bsps/sparc/leon3/clock/ckinit.c +++ b/bsps/sparc/leon3/clock/ckinit.c @@ -291,12 +291,13 @@ static void leon3_clock_initialize(void) tc->tc_counter_mask = 0xffffffff; tc->tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER; - leon3_up_counter_enable(); - #if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) + leon3_up_counter_enable(); leon3_clock_use_up_counter(tc); #else /* LEON3_HAS_ASR_22_23_UP_COUNTER */ #if defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) + leon3_up_counter_enable(); + if (leon3_up_counter_is_available()) { /* Use the LEON4 up-counter if available */ leon3_clock_use_up_counter(tc); diff --git a/bsps/sparc/leon3/start/cpucounter.c b/bsps/sparc/leon3/start/cpucounter.c index 05ac62ace8..6af91f75e5 100644 --- a/bsps/sparc/leon3/start/cpucounter.c +++ b/bsps/sparc/leon3/start/cpucounter.c @@ -106,12 +106,13 @@ static void leon3_counter_initialize(void) counter = &_SPARC_Counter_mutable; - leon3_up_counter_enable(); - #if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) + leon3_up_counter_enable(); leon3_counter_use_up_counter(counter); #else /* LEON3_HAS_ASR_22_23_UP_COUNTER */ #if defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) + leon3_up_counter_enable(); + if (leon3_up_counter_is_available()) { /* Use the LEON4 up-counter if available */ leon3_counter_use_up_counter(counter); |