1 Index: linux-4.9.44/arch/mips/ralink/mt7621.c
2 ===================================================================
3 --- linux-4.9.44.orig/arch/mips/ralink/mt7621.c
4 +++ linux-4.9.44/arch/mips/ralink/mt7621.c
6 #include <asm/mach-ralink/ralink_regs.h>
7 #include <asm/mach-ralink/mt7621.h>
8 #include <asm/mips-boards/launch.h>
9 +#include <asm/delay.h>
13 @@ -179,6 +180,58 @@ bool plat_cpu_core_present(int core)
19 +* Re-calibration lpj(loop-per-jiffy).
20 +* (derived from kernel/calibrate.c)
22 +static int udelay_recal(void)
24 + unsigned int i, lpj = 0;
25 + unsigned long ticks, loopbit;
26 + int lps_precision = LPS_PREC;
30 + while ((lpj <<= 1) != 0) {
31 + /* wait for "start of" clock tick */
33 + while (ticks == jiffies)
39 + ticks = jiffies - ticks;
45 + * Do a binary approximation to get lpj set to
46 + * equal one clock (up to lps_precision bits)
50 + while (lps_precision-- && (loopbit >>= 1)) {
53 + while (ticks == jiffies)
57 + if (jiffies != ticks) /* longer than 1 tick */
60 + printk(KERN_INFO "%d CPUs re-calibrate udelay(lpj = %d)\n", NR_CPUS, lpj);
62 + for(i=0; i< NR_CPUS; i++)
63 + cpu_data[i].udelay_val = lpj;
67 +device_initcall(udelay_recal);
69 void prom_soc_init(struct ralink_soc_info *soc_info)
71 void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
72 Index: linux-4.9.44/arch/mips/ralink/Kconfig
73 ===================================================================
74 --- linux-4.9.44.orig/arch/mips/ralink/Kconfig
75 +++ linux-4.9.44/arch/mips/ralink/Kconfig
76 @@ -57,6 +57,7 @@ choice
77 select CLKSRC_MIPS_GIC
79 select WEAK_REORDERING_BEYOND_LLSC
80 + select GENERIC_CLOCKEVENTS_BROADCAST
84 Index: linux-4.9.44/arch/mips/ralink/timer-gic.c
85 ===================================================================
86 --- linux-4.9.44.orig/arch/mips/ralink/timer-gic.c
87 +++ linux-4.9.44/arch/mips/ralink/timer-gic.c
90 #include <linux/clk-provider.h>
91 #include <linux/clocksource.h>
92 +#include <asm/time.h>
96 @@ -19,6 +20,8 @@ void __init plat_time_init(void)
100 + mips_hpt_frequency = 880000000 / 2;