summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/leon3/clock/ckinit.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-19 10:52:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-07-14 12:21:33 +0200
commitac9c55b01766b0998beba9a20d446461429c4c9e (patch)
tree0055f7b28f1770ff180f6e1f252756b5320911e5 /bsps/sparc/leon3/clock/ckinit.c
parentbsp/leon3: Add LEON3_APBUART_BASE (diff)
downloadrtems-ac9c55b01766b0998beba9a20d446461429c4c9e.tar.bz2
bsp/leon3: LEON3_PLB_FREQUENCY_DEFINED_BY_GPTIMER
Diffstat (limited to '')
-rw-r--r--bsps/sparc/leon3/clock/ckinit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bsps/sparc/leon3/clock/ckinit.c b/bsps/sparc/leon3/clock/ckinit.c
index 9f45d9814b..66a79a6a42 100644
--- a/bsps/sparc/leon3/clock/ckinit.c
+++ b/bsps/sparc/leon3/clock/ckinit.c
@@ -44,12 +44,15 @@
#include <bsp/irq.h>
#include <bsp/leon3.h>
#include <rtems/rtems/intr.h>
-#include <grlib/ambapp.h>
#include <grlib/irqamp.h>
#include <rtems/score/profiling.h>
#include <rtems/score/sparcimpl.h>
#include <rtems/timecounter.h>
+#if !defined(LEON3_PLB_FREQUENCY_DEFINED_BY_GPTIMER)
+#include <grlib/ambapp.h>
+#endif
+
/* The LEON3 BSP Timer driver can rely on the Driver Manager if the
* DrvMgr is initialized during startup. Otherwise the classic driver
* must be used.
@@ -218,7 +221,11 @@ static void leon3_clock_initialize(void)
} else if (irqmp_ts != NULL) {
/* Use the interrupt controller timestamp counter if available */
tc->tc_get_timecount = _SPARC_Get_timecount_up;
+#if defined(LEON3_PLB_FREQUENCY_DEFINED_BY_GPTIMER)
+ tc->tc_frequency = leon3_processor_local_bus_frequency();
+#else
tc->tc_frequency = ambapp_freq_get(ambapp_plb(), LEON3_Timer_Adev);
+#endif
leon3_tc_tick = leon3_tc_tick_irqmp_timestamp_init;