1 Index: linux-4.9.37/arch/mips/kernel/smp-cmp.c
2 ===================================================================
3 --- linux-4.9.37.orig/arch/mips/kernel/smp-cmp.c
4 +++ linux-4.9.37/arch/mips/kernel/smp-cmp.c
5 @@ -43,6 +43,10 @@ static void cmp_init_secondary(void)
7 struct cpuinfo_mips *c __maybe_unused = ¤t_cpu_data;
9 + printk("%s:%s[%d]%x\n", __FILE__, __func__, __LINE__, c->core);
10 + c->core = (read_c0_ebase() & 0x3ff) >> (fls(smp_num_siblings)-1);
11 + printk("%s:%s[%d]%x\n", __FILE__, __func__, __LINE__, c->core);
13 /* Assume GIC is present */
14 change_c0_status(ST0_IM, STATUSF_IP2 | STATUSF_IP3 | STATUSF_IP4 |
15 STATUSF_IP5 | STATUSF_IP6 | STATUSF_IP7);
16 Index: linux-4.9.37/arch/mips/ralink/mt7621.c
17 ===================================================================
18 --- linux-4.9.37.orig/arch/mips/ralink/mt7621.c
19 +++ linux-4.9.37/arch/mips/ralink/mt7621.c
21 #include <asm/mach-ralink/ralink_regs.h>
22 #include <asm/mach-ralink/mt7621.h>
23 #include <asm/mips-boards/launch.h>
24 +#include <asm/delay.h>
28 @@ -179,6 +180,58 @@ bool plat_cpu_core_present(int core)
34 +* Re-calibration lpj(loop-per-jiffy).
35 +* (derived from kernel/calibrate.c)
37 +static int udelay_recal(void)
39 + unsigned int i, lpj = 0;
40 + unsigned long ticks, loopbit;
41 + int lps_precision = LPS_PREC;
45 + while ((lpj <<= 1) != 0) {
46 + /* wait for "start of" clock tick */
48 + while (ticks == jiffies)
54 + ticks = jiffies - ticks;
60 + * Do a binary approximation to get lpj set to
61 + * equal one clock (up to lps_precision bits)
65 + while (lps_precision-- && (loopbit >>= 1)) {
68 + while (ticks == jiffies)
72 + if (jiffies != ticks) /* longer than 1 tick */
75 + printk(KERN_INFO "%d CPUs re-calibrate udelay(lpj = %d)\n", NR_CPUS, lpj);
77 + for(i=0; i< NR_CPUS; i++)
78 + cpu_data[i].udelay_val = lpj;
82 +device_initcall(udelay_recal);
84 void prom_soc_init(struct ralink_soc_info *soc_info)
86 void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
87 Index: linux-4.9.37/arch/mips/ralink/Kconfig
88 ===================================================================
89 --- linux-4.9.37.orig/arch/mips/ralink/Kconfig
90 +++ linux-4.9.37/arch/mips/ralink/Kconfig
91 @@ -56,6 +56,7 @@ choice
93 select CLKSRC_MIPS_GIC
95 + select GENERIC_CLOCKEVENTS_BROADCAST
99 Index: linux-4.9.37/arch/mips/ralink/timer-gic.c
100 ===================================================================
101 --- linux-4.9.37.orig/arch/mips/ralink/timer-gic.c
102 +++ linux-4.9.37/arch/mips/ralink/timer-gic.c
104 #include <linux/of.h>
105 #include <linux/clk-provider.h>
106 #include <linux/clocksource.h>
107 +#include <asm/time.h>
111 @@ -19,6 +20,8 @@ void __init plat_time_init(void)
115 + mips_hpt_frequency = 880000000 / 2;