aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/patches-5.10/309-cevt-rtl9300-support.patch
blob: 6a0038d86bb22608dc32679dfffed1c286cae89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_CEVT_BCM1480)	+= cevt-bcm14
 obj-$(CONFIG_CEVT_R4K)		+= cevt-r4k.o
 obj-$(CONFIG_CEVT_DS1287)	+= cevt-ds1287.o
 obj-$(CONFIG_CEVT_GT641XX)	+= cevt-gt641xx.o
+obj-$(CONFIG_CEVT_RTL9300)	+= cevt-rtl9300.o
 obj-$(CONFIG_CEVT_SB1250)	+= cevt-sb1250.o
 obj-$(CONFIG_CEVT_TXX9)		+= cevt-txx9.o
 obj-$(CONFIG_CSRC_BCM1480)	+= csrc-bcm1480.o
--- a/arch/mips/include/asm/time.h
+++ b/arch/mips/include/asm/time.h
@@ -15,6 +15,8 @@
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
 
+extern void rtl9300_clockevent_init(void);
+
 extern spinlock_t rtc_lock;
 
 /*
@@ -43,6 +45,11 @@ extern int r4k_clockevent_init(void);
 
 static inline int mips_clockevent_init(void)
 {
+#ifdef CONFIG_CEVT_RTL9300
+	rtl9300_clockevent_init();
+	return 0;
+#endif
+
 #ifdef CONFIG_CEVT_R4K
 	return r4k_clockevent_init();
 #else
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -108,12 +108,18 @@ static void __init smvp_tc_init(unsigned
 static void vsmp_init_secondary(void)
 {
 	/* This is Malta specific: IPI,performance and timer interrupts */
+
+	/* RTL9300 Clear internal timer interrupt */
+	write_c0_compare(0);
+
 	if (mips_gic_present())
 		change_c0_status(ST0_IM, STATUSF_IP2 | STATUSF_IP3 |
 					 STATUSF_IP4 | STATUSF_IP5 |
 					 STATUSF_IP6 | STATUSF_IP7);
 	else
 		change_c0_status(ST0_IM, STATUSF_IP0 | STATUSF_IP1 |
+					 STATUSF_IP2 | STATUSF_IP3 |
+					 STATUSF_IP4 | STATUSF_IP5 |
 					 STATUSF_IP6 | STATUSF_IP7);
 }