Skip to content

Commit b463b6f

Browse files
committed
Merge tag 'mips_fixes_5.9_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Thomas Bogendoerfer: - fixed FP register access on Loongsoon-3 - added missing 1074 cpu handling - fixed Loongson2ef build error * tag 'mips_fixes_5.9_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: BCM47XX: Remove the needless check with the 1074K MIPS: Add the missing 'CPU_1074K' into __get_cpu_type() MIPS: Loongson2ef: Disable Loongson MMI instructions MIPS: Loongson-3: Fix fp register access if MSA enabled
2 parents 782d122 + be090fa commit b463b6f

4 files changed

Lines changed: 14 additions & 17 deletions

File tree

arch/mips/bcm47xx/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void __init plat_mem_setup(void)
148148
{
149149
struct cpuinfo_mips *c = &current_cpu_data;
150150

151-
if ((c->cputype == CPU_74K) || (c->cputype == CPU_1074K)) {
151+
if (c->cputype == CPU_74K) {
152152
pr_info("Using bcma bus\n");
153153
#ifdef CONFIG_BCM47XX_BCMA
154154
bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA;

arch/mips/include/asm/cpu-type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
4747
case CPU_34K:
4848
case CPU_1004K:
4949
case CPU_74K:
50+
case CPU_1074K:
5051
case CPU_M14KC:
5152
case CPU_M14KEC:
5253
case CPU_INTERAPTIV:

arch/mips/loongson2ef/Platform

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
4444
endif
4545
endif
4646

47+
# Some -march= flags enable MMI instructions, and GCC complains about that
48+
# support being enabled alongside -msoft-float. Thus explicitly disable MMI.
49+
cflags-y += $(call cc-option,-mno-loongson-mmi)
50+
4751
#
4852
# Loongson Machines' Support
4953
#

arch/mips/loongson64/cop2-ex.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
9595
if (res)
9696
goto fault;
9797

98-
set_fpr64(current->thread.fpu.fpr,
99-
insn.loongson3_lswc2_format.rt, value);
100-
set_fpr64(current->thread.fpu.fpr,
101-
insn.loongson3_lswc2_format.rq, value_next);
98+
set_fpr64(&current->thread.fpu.fpr[insn.loongson3_lswc2_format.rt], 0, value);
99+
set_fpr64(&current->thread.fpu.fpr[insn.loongson3_lswc2_format.rq], 0, value_next);
102100
compute_return_epc(regs);
103101
own_fpu(1);
104102
}
@@ -130,15 +128,13 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
130128
goto sigbus;
131129

132130
lose_fpu(1);
133-
value_next = get_fpr64(current->thread.fpu.fpr,
134-
insn.loongson3_lswc2_format.rq);
131+
value_next = get_fpr64(&current->thread.fpu.fpr[insn.loongson3_lswc2_format.rq], 0);
135132

136133
StoreDW(addr + 8, value_next, res);
137134
if (res)
138135
goto fault;
139136

140-
value = get_fpr64(current->thread.fpu.fpr,
141-
insn.loongson3_lswc2_format.rt);
137+
value = get_fpr64(&current->thread.fpu.fpr[insn.loongson3_lswc2_format.rt], 0);
142138

143139
StoreDW(addr, value, res);
144140
if (res)
@@ -204,8 +200,7 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
204200
if (res)
205201
goto fault;
206202

207-
set_fpr64(current->thread.fpu.fpr,
208-
insn.loongson3_lsdc2_format.rt, value);
203+
set_fpr64(&current->thread.fpu.fpr[insn.loongson3_lsdc2_format.rt], 0, value);
209204
compute_return_epc(regs);
210205
own_fpu(1);
211206

@@ -221,8 +216,7 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
221216
if (res)
222217
goto fault;
223218

224-
set_fpr64(current->thread.fpu.fpr,
225-
insn.loongson3_lsdc2_format.rt, value);
219+
set_fpr64(&current->thread.fpu.fpr[insn.loongson3_lsdc2_format.rt], 0, value);
226220
compute_return_epc(regs);
227221
own_fpu(1);
228222
break;
@@ -286,8 +280,7 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
286280
goto sigbus;
287281

288282
lose_fpu(1);
289-
value = get_fpr64(current->thread.fpu.fpr,
290-
insn.loongson3_lsdc2_format.rt);
283+
value = get_fpr64(&current->thread.fpu.fpr[insn.loongson3_lsdc2_format.rt], 0);
291284

292285
StoreW(addr, value, res);
293286
if (res)
@@ -305,8 +298,7 @@ static int loongson_cu2_call(struct notifier_block *nfb, unsigned long action,
305298
goto sigbus;
306299

307300
lose_fpu(1);
308-
value = get_fpr64(current->thread.fpu.fpr,
309-
insn.loongson3_lsdc2_format.rt);
301+
value = get_fpr64(&current->thread.fpu.fpr[insn.loongson3_lsdc2_format.rt], 0);
310302

311303
StoreDW(addr, value, res);
312304
if (res)

0 commit comments

Comments
 (0)