Skip to content

Commit f3ade25

Browse files
chenhuacaipaulburton
authored andcommitted
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>
1 parent 1287533 commit f3ade25

8 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎arch/mips/include/asm/cpu.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@
248248
#define PRID_REV_LOONGSON3A_R1 0x0005
249249
#define PRID_REV_LOONGSON3B_R1 0x0006
250250
#define PRID_REV_LOONGSON3B_R2 0x0007
251-
#define PRID_REV_LOONGSON3A_R2 0x0008
251+
#define PRID_REV_LOONGSON3A_R2_0 0x0008
252252
#define PRID_REV_LOONGSON3A_R3_0 0x0009
253+
#define PRID_REV_LOONGSON3A_R2_1 0x000c
253254
#define PRID_REV_LOONGSON3A_R3_1 0x000d
254255

255256
/*

‎arch/mips/include/asm/mach-loongson64/kernel-entry-init.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/* Enable STFill Buffer */
3232
mfc0 t0, CP0_PRID
3333
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)
3535
bnez t0, 1f
3636
mfc0 t0, CP0_CONFIG6
3737
or t0, 0x100
@@ -60,7 +60,7 @@
6060
/* Enable STFill Buffer */
6161
mfc0 t0, CP0_PRID
6262
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)
6464
bnez t0, 1f
6565
mfc0 t0, CP0_CONFIG6
6666
or t0, 0x100

‎arch/mips/kernel/cpu-probe.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
18711871
switch (c->processor_id & PRID_IMP_MASK) {
18721872
case PRID_IMP_LOONGSON_64: /* Loongson-2/3 */
18731873
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:
18751876
c->cputype = CPU_LOONGSON3;
18761877
__cpu_name[cpu] = "ICT Loongson-3";
18771878
set_elf_platform(cpu, "loongson3a");

‎arch/mips/kernel/idle.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void __init check_wait(void)
184184
cpu_wait = r4k_wait;
185185
break;
186186
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)
188188
cpu_wait = r4k_wait;
189189
break;
190190

‎arch/mips/loongson64/common/env.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ void __init prom_init_env(void)
197197
cpu_clock_freq = 797000000;
198198
break;
199199
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:
201202
case PRID_REV_LOONGSON3A_R3_0:
202203
case PRID_REV_LOONGSON3A_R3_1:
203204
cpu_clock_freq = 900000000;

‎arch/mips/loongson64/loongson-3/smp.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ void play_dead(void)
682682
play_dead_at_ckseg1 =
683683
(void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead);
684684
break;
685-
case PRID_REV_LOONGSON3A_R2:
685+
case PRID_REV_LOONGSON3A_R2_0:
686+
case PRID_REV_LOONGSON3A_R2_1:
686687
case PRID_REV_LOONGSON3A_R3_0:
687688
case PRID_REV_LOONGSON3A_R3_1:
688689
play_dead_at_ckseg1 =

‎arch/mips/mm/c-r4k.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ static void probe_pcache(void)
13521352
c->dcache.ways *
13531353
c->dcache.linesz;
13541354
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)
13561356
c->options |= MIPS_CPU_PREFETCH;
13571357
break;
13581358

‎drivers/platform/mips/cpu_hwmon.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ int loongson3_cpu_temp(int cpu)
2525
case PRID_REV_LOONGSON3A_R1:
2626
reg = (reg >> 8) & 0xff;
2727
break;
28-
case PRID_REV_LOONGSON3A_R2:
2928
case PRID_REV_LOONGSON3B_R1:
3029
case PRID_REV_LOONGSON3B_R2:
30+
case PRID_REV_LOONGSON3A_R2_0:
31+
case PRID_REV_LOONGSON3A_R2_1:
3132
reg = ((reg >> 8) & 0xff) - 100;
3233
break;
3334
case PRID_REV_LOONGSON3A_R3_0:

0 commit comments

Comments
 (0)