Skip to content

Commit 04a357b

Browse files
committed
Merge tag 'mips_6.3_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull more MIPS updates from Thomas Bogendoerfer: "A few more cleanups and fixes" * tag 'mips_6.3_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Workaround clang inline compat branch issue mips: dts: ralink: mt7621: add phandle to system controller node for watchdog mips: dts: ralink: mt7621: rename watchdog node from 'wdt' into 'watchdog' mips: ralink: make SOC_MT7621 select PINCTRL mips: remove SYS_HAS_CPU_MIPS32_R1 from RALINK MIPS: cevt-r4k: Offset the value used to clear compare interrupt MIPS: smp-cps: Don't rely on CP0_CMGCRBASE MIPS: Remove DMA_PERDEV_COHERENT
2 parents 857f126 + 1a2c73f commit 04a357b

File tree

8 files changed

+31
-31
lines changed

8 files changed

+31
-31
lines changed

arch/mips/Kconfig

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ config RALINK
610610
select DMA_NONCOHERENT
611611
select IRQ_MIPS_CPU
612612
select USE_OF
613-
select SYS_HAS_CPU_MIPS32_R1
614613
select SYS_HAS_CPU_MIPS32_R2
615614
select SYS_SUPPORTS_32BIT_KERNEL
616615
select SYS_SUPPORTS_LITTLE_ENDIAN
@@ -1080,11 +1079,6 @@ config FW_CFE
10801079
config ARCH_SUPPORTS_UPROBES
10811080
bool
10821081

1083-
config DMA_PERDEV_COHERENT
1084-
bool
1085-
select ARCH_HAS_SETUP_DMA_OPS
1086-
select DMA_NONCOHERENT
1087-
10881082
config DMA_NONCOHERENT
10891083
bool
10901084
#
@@ -3206,6 +3200,10 @@ config CC_HAS_MNO_BRANCH_LIKELY
32063200
def_bool y
32073201
depends on $(cc-option,-mno-branch-likely)
32083202

3203+
# https://github.com/llvm/llvm-project/issues/61045
3204+
config CC_HAS_BROKEN_INLINE_COMPAT_BRANCH
3205+
def_bool y if CC_IS_CLANG
3206+
32093207
menu "Power management options"
32103208

32113209
config ARCH_HIBERNATION_POSSIBLE

arch/mips/boot/dts/ralink/mt7621.dtsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@
7070
"250m", "270m";
7171
};
7272

73-
wdt: wdt@100 {
73+
wdt: watchdog@100 {
7474
compatible = "mediatek,mt7621-wdt";
7575
reg = <0x100 0x100>;
76+
mediatek,sysctl = <&sysc>;
7677
};
7778

7879
gpio: gpio@600 {

arch/mips/include/asm/asm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ symbol = value
336336
*/
337337
#ifdef CONFIG_WAR_R10000_LLSC
338338
# define SC_BEQZ beqzl
339-
#elif MIPS_ISA_REV >= 6
339+
#elif !defined(CONFIG_CC_HAS_BROKEN_INLINE_COMPAT_BRANCH) && MIPS_ISA_REV >= 6
340340
# define SC_BEQZ beqzc
341341
#else
342342
# define SC_BEQZ beqz

arch/mips/include/asm/smp-cps.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef __MIPS_ASM_SMP_CPS_H__
88
#define __MIPS_ASM_SMP_CPS_H__
99

10+
#define CPS_ENTRY_PATCH_INSNS 6
11+
1012
#ifndef __ASSEMBLY__
1113

1214
struct vpe_boot_config {
@@ -30,6 +32,8 @@ extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe);
3032
extern void mips_cps_pm_save(void);
3133
extern void mips_cps_pm_restore(void);
3234

35+
extern void *mips_cps_core_entry_patch_end;
36+
3337
#ifdef CONFIG_MIPS_CPS
3438

3539
extern bool mips_cps_smp_in_use(void);

arch/mips/kernel/cevt-r4k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ int c0_compare_int_usable(void)
200200
*/
201201
if (c0_compare_int_pending()) {
202202
cnt = read_c0_count();
203-
write_c0_compare(cnt);
203+
write_c0_compare(cnt - 1);
204204
back_to_back_c0_hazard();
205205
while (read_c0_count() < (cnt + COMPARE_INT_SEEN_TICKS))
206206
if (!c0_compare_int_pending())
@@ -228,7 +228,7 @@ int c0_compare_int_usable(void)
228228
if (!c0_compare_int_pending())
229229
return 0;
230230
cnt = read_c0_count();
231-
write_c0_compare(cnt);
231+
write_c0_compare(cnt - 1);
232232
back_to_back_c0_hazard();
233233
while (read_c0_count() < (cnt + COMPARE_INT_SEEN_TICKS))
234234
if (!c0_compare_int_pending())

arch/mips/kernel/cps-vec.S

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <asm/mipsregs.h>
1414
#include <asm/mipsmtregs.h>
1515
#include <asm/pm.h>
16+
#include <asm/smp-cps.h>
1617

1718
#define GCR_CPC_BASE_OFS 0x0088
1819
#define GCR_CL_COHERENCE_OFS 0x2008
@@ -80,25 +81,20 @@
8081
nop
8182
.endm
8283

83-
/* Calculate an uncached address for the CM GCRs */
84-
.macro cmgcrb dest
85-
.set push
86-
.set noat
87-
MFC0 $1, CP0_CMGCRBASE
88-
PTR_SLL $1, $1, 4
89-
PTR_LI \dest, UNCAC_BASE
90-
PTR_ADDU \dest, \dest, $1
91-
.set pop
92-
.endm
9384

9485
.balign 0x1000
9586

9687
LEAF(mips_cps_core_entry)
9788
/*
98-
* These first 4 bytes will be patched by cps_smp_setup to load the
99-
* CCA to use into register s0.
89+
* These first several instructions will be patched by cps_smp_setup to load the
90+
* CCA to use into register s0 and GCR base address to register s1.
10091
*/
101-
.word 0
92+
.rept CPS_ENTRY_PATCH_INSNS
93+
nop
94+
.endr
95+
96+
.global mips_cps_core_entry_patch_end
97+
mips_cps_core_entry_patch_end:
10298

10399
/* Check whether we're here due to an NMI */
104100
mfc0 k0, CP0_STATUS
@@ -121,8 +117,7 @@ not_nmi:
121117
mtc0 t0, CP0_STATUS
122118

123119
/* Skip cache & coherence setup if we're already coherent */
124-
cmgcrb v1
125-
lw s7, GCR_CL_COHERENCE_OFS(v1)
120+
lw s7, GCR_CL_COHERENCE_OFS(s1)
126121
bnez s7, 1f
127122
nop
128123

@@ -132,7 +127,7 @@ not_nmi:
132127

133128
/* Enter the coherent domain */
134129
li t0, 0xff
135-
sw t0, GCR_CL_COHERENCE_OFS(v1)
130+
sw t0, GCR_CL_COHERENCE_OFS(s1)
136131
ehb
137132

138133
/* Set Kseg0 CCA to that in s0 */
@@ -305,8 +300,7 @@ LEAF(mips_cps_core_init)
305300
*/
306301
LEAF(mips_cps_get_bootcfg)
307302
/* Calculate a pointer to this cores struct core_boot_config */
308-
cmgcrb t0
309-
lw t0, GCR_CL_ID_OFS(t0)
303+
lw t0, GCR_CL_ID_OFS(s1)
310304
li t1, COREBOOTCFG_SIZE
311305
mul t0, t0, t1
312306
PTR_LA t1, mips_cps_core_bootcfg
@@ -366,8 +360,9 @@ LEAF(mips_cps_boot_vpes)
366360
has_vp t0, 5f
367361

368362
/* Find base address of CPC */
369-
cmgcrb t3
370-
PTR_L t1, GCR_CPC_BASE_OFS(t3)
363+
PTR_LA t1, mips_gcr_base
364+
PTR_L t1, 0(t1)
365+
PTR_L t1, GCR_CPC_BASE_OFS(t1)
371366
PTR_LI t2, ~0x7fff
372367
and t1, t1, t2
373368
PTR_LI t2, UNCAC_BASE

arch/mips/kernel/smp-cps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
162162
*/
163163
entry_code = (u32 *)&mips_cps_core_entry;
164164
uasm_i_addiu(&entry_code, 16, 0, cca);
165+
UASM_i_LA(&entry_code, 17, (long)mips_gcr_base);
166+
BUG_ON((void *)entry_code > (void *)&mips_cps_core_entry_patch_end);
165167
blast_dcache_range((unsigned long)&mips_cps_core_entry,
166168
(unsigned long)entry_code);
167169
bc_wback_inv((unsigned long)&mips_cps_core_entry,

arch/mips/ralink/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ choice
5454
select HAVE_PCI
5555
select PCI_DRIVERS_GENERIC
5656
select SOC_BUS
57-
select PINCTRL_MT7621
57+
select PINCTRL
5858

5959
help
6060
The MT7621 system-on-a-chip includes an 880 MHz MIPS1004Kc

0 commit comments

Comments
 (0)