timer: arm: implement smp_timer_init

Implement smp_timer_init to initialize arch timer of secondary cores.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Peng Fan 2020-11-09 15:51:00 +08:00 committed by Anas Nashif
parent e6392301f8
commit db71e4dac7

View file

@ -135,3 +135,16 @@ void arch_busy_wait(uint32_t usec_to_wait)
}
}
#endif
#ifdef CONFIG_SMP
void smp_timer_init(void)
{
/*
* set the initial status of timer0 of each secondary core
*/
arm_arch_timer_set_compare(arm_arch_timer_count() + CYC_PER_TICK);
arm_arch_timer_enable(true);
irq_enable(ARM_ARCH_TIMER_IRQ);
arm_arch_timer_set_irq_mask(false);
}
#endif