openrisc: add tick timer multi-core sync logic

In case timers are not in sync when cpus start (i.e. hot plug / offset
resets) we need to synchronize the secondary cpus internal timer with
the main cpu.  This is needed as in OpenRISC SMP there is only one
clocksource registered which reads from the same ttcr register on each
cpu.

This synchronization routine heavily borrows from mips implementation that
does something similar.

Signed-off-by: Stafford Horne <shorne@gmail.com>
This commit is contained in:
Stafford Horne
2017-07-07 06:06:30 +09:00
parent 78cdfb5cf1
commit 4553474d97
5 changed files with 145 additions and 3 deletions

View File

@@ -12,4 +12,12 @@
extern void openrisc_clockevent_init(void);
extern void openrisc_timer_set(unsigned long count);
extern void openrisc_timer_set_next(unsigned long delta);
#ifdef CONFIG_SMP
extern void synchronise_count_master(int cpu);
extern void synchronise_count_slave(int cpu);
#endif
#endif /* __ASM_OR1K_TIME_H */