Skip to content

Commit ad82eef

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Fix wrong fpu version
According to the configuration information accessible by the CPUCFG instruction in LoongArch Reference Manual [1], FP_ver is stored in bit [5: 3] of CPUCFG2, the current code to get fpu version is wrong, use CPUCFG2_FPVERS to fix it. [1] https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html Fixes: 628c3bb ("LoongArch: Add boot and setup routines") Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 26808ce commit ad82eef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/kernel/cpu-probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void cpu_probe(void)
263263

264264
c->cputype = CPU_UNKNOWN;
265265
c->processor_id = read_cpucfg(LOONGARCH_CPUCFG0);
266-
c->fpu_vers = (read_cpucfg(LOONGARCH_CPUCFG2) >> 3) & 0x3;
266+
c->fpu_vers = (read_cpucfg(LOONGARCH_CPUCFG2) & CPUCFG2_FPVERS) >> 3;
267267

268268
c->fpu_csr0 = FPU_CSR_RN;
269269
c->fpu_mask = FPU_CSR_RSVD;

0 commit comments

Comments
 (0)