Skip to content

Commit 1cb6ab4

Browse files
FlyGoattsbogend
authored andcommitted
MIPS: Loongson64: Set timer mode in cpu-probe
Loongson64 C and G processors have EXTIMER feature which is conflicting with CP0 counter. Although the processor resets in EXTIMER disabled & INTIMER enabled mode, which is compatible with MIPS CP0 compare, firmware may attempt to enable EXTIMER and interfere CP0 compare. Set timer mode back to MIPS compatible mode to fix booting on systems with such firmware before we have an actual driver for EXTIMER. Cc: [email protected] Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 8400291 commit 1cb6ab4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/mips/kernel/cpu-probe.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,12 +1724,16 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
17241724
c->ases |= (MIPS_ASE_LOONGSON_MMI | MIPS_ASE_LOONGSON_CAM |
17251725
MIPS_ASE_LOONGSON_EXT | MIPS_ASE_LOONGSON_EXT2);
17261726
c->ases &= ~MIPS_ASE_VZ; /* VZ of Loongson-3A2000/3000 is incomplete */
1727+
change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER,
1728+
LOONGSON_CONF6_INTIMER);
17271729
break;
17281730
case PRID_IMP_LOONGSON_64G:
17291731
__cpu_name[cpu] = "ICT Loongson-3";
17301732
set_elf_platform(cpu, "loongson3a");
17311733
set_isa(c, MIPS_CPU_ISA_M64R2);
17321734
decode_cpucfg(c);
1735+
change_c0_config6(LOONGSON_CONF6_EXTIMER | LOONGSON_CONF6_INTIMER,
1736+
LOONGSON_CONF6_INTIMER);
17331737
break;
17341738
default:
17351739
panic("Unknown Loongson Processor ID!");

0 commit comments

Comments
 (0)