forked from Imagelibrary/rtems
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user