Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson: Add Loongson-3A R2.1 basic support

Loongson-3A R2.1 is the bugfix revision of Loongson-3A R2.

All Loongson-3 CPU family:

Code-name Brand-name PRId
Loongson-3A R1 Loongson-3A1000 0x6305
Loongson-3A R2 Loongson-3A2000 0x6308
Loongson-3A R2.1 Loongson-3A2000 0x630c
Loongson-3A R3 Loongson-3A3000 0x6309
Loongson-3A R3.1 Loongson-3A3000 0x630d
Loongson-3B R1 Loongson-3B1000 0x6306
Loongson-3B R2 Loongson-3B1500 0x6307

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21128/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <james.hogan@mips.com>
Cc: Steven J . Hill <Steven.Hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>

authored by

Huacai Chen and committed by
Paul Burton
f3ade253 1287533d

+14 -9
+2 -1
arch/mips/include/asm/cpu.h
··· 248 248 #define PRID_REV_LOONGSON3A_R1 0x0005 249 249 #define PRID_REV_LOONGSON3B_R1 0x0006 250 250 #define PRID_REV_LOONGSON3B_R2 0x0007 251 - #define PRID_REV_LOONGSON3A_R2 0x0008 251 + #define PRID_REV_LOONGSON3A_R2_0 0x0008 252 252 #define PRID_REV_LOONGSON3A_R3_0 0x0009 253 + #define PRID_REV_LOONGSON3A_R2_1 0x000c 253 254 #define PRID_REV_LOONGSON3A_R3_1 0x000d 254 255 255 256 /*
+2 -2
arch/mips/include/asm/mach-loongson64/kernel-entry-init.h
··· 31 31 /* Enable STFill Buffer */ 32 32 mfc0 t0, CP0_PRID 33 33 andi t0, (PRID_IMP_MASK | PRID_REV_MASK) 34 - slti t0, (PRID_IMP_LOONGSON_64 | PRID_REV_LOONGSON3A_R2) 34 + slti t0, (PRID_IMP_LOONGSON_64 | PRID_REV_LOONGSON3A_R2_0) 35 35 bnez t0, 1f 36 36 mfc0 t0, CP0_CONFIG6 37 37 or t0, 0x100 ··· 60 60 /* Enable STFill Buffer */ 61 61 mfc0 t0, CP0_PRID 62 62 andi t0, (PRID_IMP_MASK | PRID_REV_MASK) 63 - slti t0, (PRID_IMP_LOONGSON_64 | PRID_REV_LOONGSON3A_R2) 63 + slti t0, (PRID_IMP_LOONGSON_64 | PRID_REV_LOONGSON3A_R2_0) 64 64 bnez t0, 1f 65 65 mfc0 t0, CP0_CONFIG6 66 66 or t0, 0x100
+2 -1
arch/mips/kernel/cpu-probe.c
··· 1871 1871 switch (c->processor_id & PRID_IMP_MASK) { 1872 1872 case PRID_IMP_LOONGSON_64: /* Loongson-2/3 */ 1873 1873 switch (c->processor_id & PRID_REV_MASK) { 1874 - case PRID_REV_LOONGSON3A_R2: 1874 + case PRID_REV_LOONGSON3A_R2_0: 1875 + case PRID_REV_LOONGSON3A_R2_1: 1875 1876 c->cputype = CPU_LOONGSON3; 1876 1877 __cpu_name[cpu] = "ICT Loongson-3"; 1877 1878 set_elf_platform(cpu, "loongson3a");
+1 -1
arch/mips/kernel/idle.c
··· 184 184 cpu_wait = r4k_wait; 185 185 break; 186 186 case CPU_LOONGSON3: 187 - if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON3A_R2) 187 + if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON3A_R2_0) 188 188 cpu_wait = r4k_wait; 189 189 break; 190 190
+2 -1
arch/mips/loongson64/common/env.c
··· 197 197 cpu_clock_freq = 797000000; 198 198 break; 199 199 case PRID_REV_LOONGSON3A_R1: 200 - case PRID_REV_LOONGSON3A_R2: 200 + case PRID_REV_LOONGSON3A_R2_0: 201 + case PRID_REV_LOONGSON3A_R2_1: 201 202 case PRID_REV_LOONGSON3A_R3_0: 202 203 case PRID_REV_LOONGSON3A_R3_1: 203 204 cpu_clock_freq = 900000000;
+2 -1
arch/mips/loongson64/loongson-3/smp.c
··· 682 682 play_dead_at_ckseg1 = 683 683 (void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead); 684 684 break; 685 - case PRID_REV_LOONGSON3A_R2: 685 + case PRID_REV_LOONGSON3A_R2_0: 686 + case PRID_REV_LOONGSON3A_R2_1: 686 687 case PRID_REV_LOONGSON3A_R3_0: 687 688 case PRID_REV_LOONGSON3A_R3_1: 688 689 play_dead_at_ckseg1 =
+1 -1
arch/mips/mm/c-r4k.c
··· 1352 1352 c->dcache.ways * 1353 1353 c->dcache.linesz; 1354 1354 c->dcache.waybit = 0; 1355 - if ((prid & PRID_REV_MASK) >= PRID_REV_LOONGSON3A_R2) 1355 + if ((prid & PRID_REV_MASK) >= PRID_REV_LOONGSON3A_R2_0) 1356 1356 c->options |= MIPS_CPU_PREFETCH; 1357 1357 break; 1358 1358
+2 -1
drivers/platform/mips/cpu_hwmon.c
··· 25 25 case PRID_REV_LOONGSON3A_R1: 26 26 reg = (reg >> 8) & 0xff; 27 27 break; 28 - case PRID_REV_LOONGSON3A_R2: 29 28 case PRID_REV_LOONGSON3B_R1: 30 29 case PRID_REV_LOONGSON3B_R2: 30 + case PRID_REV_LOONGSON3A_R2_0: 31 + case PRID_REV_LOONGSON3A_R2_1: 31 32 reg = ((reg >> 8) & 0xff) - 100; 32 33 break; 33 34 case PRID_REV_LOONGSON3A_R3_0: