summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/timer
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2013-09-10 13:46:29 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:20 +0200
commitacf7047e2ac7ece2ceba0a8e13b4df235851f7d0 (patch)
tree7c1ebe513097a4ce169f4d7d185c7b90cff720e6 /c/src/lib/libbsp/sparc/shared/timer
parentLEON PCI: host bridge driver support for probing dev0=AD16 (diff)
downloadrtems-acf7047e2ac7ece2ceba0a8e13b4df235851f7d0.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/timer')
-rw-r--r--c/src/lib/libbsp/sparc/shared/timer/gptimer.c4
1 files changed, 2 insertions, 2 deletions
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;