From 0a4992927d80716b1ef18dff07853a4eab8568e9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 18 Jan 2018 13:13:10 +0100 Subject: bsp/leon3: Fix interrupt timestamp timecounter --- c/src/lib/libbsp/sparc/leon3/clock/ckinit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c index b2ed5bf5c1..fd699a435d 100644 --- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c +++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c @@ -13,7 +13,7 @@ * COPYRIGHT (c) 2004. * Gaisler Research. * - * Copyright (c) 2014, 2016 embedded brains GmbH + * Copyright (c) 2014, 2018 embedded brains GmbH * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -229,6 +229,13 @@ static void leon3_clock_initialize(void) leon3_tc.tc.tc_frequency = ambapp_freq_get(&ambapp_plb, LEON3_Timer_Adev); leon3_tc.tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER; leon3_tc_tick = leon3_tc_tick_irqmp_timestamp_init; + + /* + * At least one TSISEL field must be non-zero to enable the timestamp + * counter. Use an arbitrary interrupt source. + */ + irqmp_ts->control = 0x1; + rtems_timecounter_install(&leon3_tc.tc); } else { #ifdef RTEMS_SMP -- cgit v1.2.3