bsp/leon3: Enable up-counter conditionally

This commit is contained in:
Sebastian Huber
2021-08-10 09:34:32 +02:00
parent dc16709697
commit 63626a5d2e
2 changed files with 6 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);