diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-03 19:50:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-14 12:21:33 +0200 |
commit | 1d1c0e5d9a27f01571e7a80542170d581b9f7f25 (patch) | |
tree | c0aa085ae35f9c6db6e6ec9e3cf68b0b9831a8f1 /bsps | |
parent | 3773a63b2ac208b9e1d4ae743ceedd8e679cd156 (diff) |
bsp/leon3: Add LEON3_PROBE_ASR_22_23_UP_COUNTER
Diffstat (limited to 'bsps')
-rw-r--r-- | bsps/sparc/leon3/clock/ckinit.c | 5 | ||||
-rw-r--r-- | bsps/sparc/leon3/start/cpucounter.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bsps/sparc/leon3/clock/ckinit.c b/bsps/sparc/leon3/clock/ckinit.c index bb66ccaa59..b2d8a99e6a 100644 --- a/bsps/sparc/leon3/clock/ckinit.c +++ b/bsps/sparc/leon3/clock/ckinit.c @@ -187,6 +187,8 @@ static void bsp_clock_handler_install(rtems_interrupt_handler isr) #define Clock_driver_support_set_interrupt_affinity(online_processors) \ bsp_interrupt_set_affinity(clkirq, online_processors) +#if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) || \ + defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) static void leon3_clock_use_up_counter(struct timecounter *tc) { tc->tc_get_timecount = _SPARC_Get_timecount_asr23; @@ -202,6 +204,7 @@ static void leon3_clock_use_up_counter(struct timecounter *tc) rtems_timecounter_install(tc); } +#endif #if defined(LEON3_IRQAMP_PROBE_TIMESTAMP) static void leon3_clock_use_irqamp_timestamp( @@ -293,11 +296,13 @@ static void leon3_clock_initialize(void) #if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) leon3_clock_use_up_counter(tc); #else /* LEON3_HAS_ASR_22_23_UP_COUNTER */ +#if defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) if (leon3_up_counter_is_available()) { /* Use the LEON4 up-counter if available */ leon3_clock_use_up_counter(tc); return; } +#endif #if defined(LEON3_IRQAMP_PROBE_TIMESTAMP) irqmp_ts = irqamp_get_timestamp_registers(LEON3_IrqCtrl_Regs); diff --git a/bsps/sparc/leon3/start/cpucounter.c b/bsps/sparc/leon3/start/cpucounter.c index d09dbe651b..46e0b304e5 100644 --- a/bsps/sparc/leon3/start/cpucounter.c +++ b/bsps/sparc/leon3/start/cpucounter.c @@ -39,6 +39,8 @@ uint32_t _CPU_Counter_frequency(void) return leon3_counter_frequency; } +#if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) || \ + defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) static void leon3_counter_use_up_counter(SPARC_Counter *counter) { counter->read_isr_disabled = _SPARC_Counter_read_asr23; @@ -46,6 +48,7 @@ static void leon3_counter_use_up_counter(SPARC_Counter *counter) leon3_counter_frequency = leon3_up_counter_frequency(); } +#endif #if defined(LEON3_IRQAMP_PROBE_TIMESTAMP) static void leon3_counter_use_irqamp_timestamp( @@ -108,11 +111,13 @@ static void leon3_counter_initialize(void) #if defined(LEON3_HAS_ASR_22_23_UP_COUNTER) leon3_counter_use_up_counter(counter); #else /* LEON3_HAS_ASR_22_23_UP_COUNTER */ +#if defined(LEON3_PROBE_ASR_22_23_UP_COUNTER) if (leon3_up_counter_is_available()) { /* Use the LEON4 up-counter if available */ leon3_counter_use_up_counter(counter); return; } +#endif #if defined(LEON3_IRQAMP_PROBE_TIMESTAMP) irqmp_ts = irqamp_get_timestamp_registers(LEON3_IrqCtrl_Regs); |