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.
This commit is contained in:
Daniel Hellstrom
2013-09-10 13:46:29 +02:00
parent 51347053b8
commit acf7047e2a

View File

@@ -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;