From acf7047e2ac7ece2ceba0a8e13b4df235851f7d0 Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Tue, 10 Sep 2013 13:46:29 +0200 Subject: GPTIMER: timer probing must not be on timer0 Timers are identical within one GPTIMER core. Probing only the first timer is sufficient, however the first timer was hardcoded to timer0 which is not correct in a multi-OS system like RTEMS AMP. This patch makes sure that probing is done on the first timer that can be used by this RTEMS instance. Without this patch RTEMS AMP is broken on systems (like the GR712RC) where there is only one GPTIMER core proviing multiple timers. Designs (like the NGMP/FP) where there are multiple GPTIMER cores are not affected. --- c/src/lib/libbsp/sparc/shared/timer/gptimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c index 6a7e835f74..2cc181ace8 100644 --- a/c/src/lib/libbsp/sparc/shared/timer/gptimer.c +++ b/c/src/lib/libbsp/sparc/shared/timer/gptimer.c @@ -272,8 +272,8 @@ int gptimer_init1(struct drvmgr_dev *dev) * timer has pending bit is cleared by writing a one to it, * whereas older versions it is cleared with a zero. */ - priv->regs->timer[0].ctrl = GPTIMER_CTRL_IP; - if ((priv->regs->timer[0].ctrl & GPTIMER_CTRL_IP) != 0) + priv->regs->timer[timer_start].ctrl = GPTIMER_CTRL_IP; + if ((priv->regs->timer[timer_start].ctrl & GPTIMER_CTRL_IP) != 0) irq_ack_mask = ~GPTIMER_CTRL_IP; else irq_ack_mask = ~0; -- cgit v1.2.3