summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2019-04-12 12:20:07 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2021-03-11 17:35:27 +0100
commit9c00cc130128a32655b4bc109f4c3e124605c260 (patch)
treeb4e4bcb63b4c59448b31aba0d9b23688d975936d
parentb57436c8fcfc7747a35856e69d362d33802f0421 (diff)
downloadrtems-9c00cc130128a32655b4bc109f4c3e124605c260.tar.bz2
leon,ckinit: avoid assuming 1MHz timer pre-scaler clock
-rw-r--r--bsps/shared/grlib/btimer/tlib_ckinit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bsps/shared/grlib/btimer/tlib_ckinit.c b/bsps/shared/grlib/btimer/tlib_ckinit.c
index 5a34d97c00..bc52ff4fe9 100644
--- a/bsps/shared/grlib/btimer/tlib_ckinit.c
+++ b/bsps/shared/grlib/btimer/tlib_ckinit.c
@@ -209,15 +209,14 @@ static uint32_t simple_tlib_tc_get_timecount(struct timecounter *tc)
static rtems_device_driver simple_initialize_counter(void)
{
- uint64_t frequency;
- unsigned int tick_hz;
+ unsigned int tick_hz, frequency;
- frequency = 1000000;
+ tlib_get_freq(priv.tlib_tick, &frequency, NULL);
tick_hz = rtems_configuration_get_microseconds_per_tick();
rtems_timecounter_simple_install(
&priv.tc_simple,
- frequency,
+ (uint64_t)frequency,
tick_hz,
simple_tlib_tc_get_timecount
);