summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2018-04-27 23:21:25 -0400
committerPaul Burton <paul.burton@mips.com>2018-07-23 20:53:34 -0400
commit7cff3f168999fd1de4a41c5971363f42d49e961f (patch)
treed92158ab49a5e4ade8080eaf5f68edd4022fa378
parentc6ea7e9747318e5a6774995f4f8e3e0f7c0fa8ba (diff)
MIPS: Loongson: Add Loongson-3A R3.1 basic support
Loongson-3A R3.1 is the bugfix revision of Loongson-3A R3. All Loongson-3 CPU family: Code-name Brand-name PRId Loongson-3A R1 Loongson-3A1000 0x6305 Loongson-3A R2 Loongson-3A2000 0x6308 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/19263/ Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <james.hogan@mips.com> Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang <zhangfx@lemote.com> Cc: Zhangjin Wu <wuzhangjin@gmail.com> Cc: Huacai Chen <chenhuacai@gmail.com>
-rw-r--r--arch/mips/include/asm/cpu.h51
-rw-r--r--arch/mips/kernel/cpu-probe.c3
-rw-r--r--arch/mips/loongson64/common/env.c3
-rw-r--r--arch/mips/loongson64/loongson-3/smp.c3
-rw-r--r--drivers/platform/mips/cpu_hwmon.c3
5 files changed, 34 insertions, 29 deletions
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 5b9d02ef4f60..dacbdb84516a 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -225,31 +225,32 @@
225 * Definitions for 7:0 on legacy processors 225 * Definitions for 7:0 on legacy processors
226 */ 226 */
227 227
228#define PRID_REV_TX4927 0x0022 228#define PRID_REV_TX4927 0x0022
229#define PRID_REV_TX4937 0x0030 229#define PRID_REV_TX4937 0x0030
230#define PRID_REV_R4400 0x0040 230#define PRID_REV_R4400 0x0040
231#define PRID_REV_R3000A 0x0030 231#define PRID_REV_R3000A 0x0030
232#define PRID_REV_R3000 0x0020 232#define PRID_REV_R3000 0x0020
233#define PRID_REV_R2000A 0x0010 233#define PRID_REV_R2000A 0x0010
234#define PRID_REV_TX3912 0x0010 234#define PRID_REV_TX3912 0x0010
235#define PRID_REV_TX3922 0x0030 235#define PRID_REV_TX3922 0x0030
236#define PRID_REV_TX3927 0x0040 236#define PRID_REV_TX3927 0x0040
237#define PRID_REV_VR4111 0x0050 237#define PRID_REV_VR4111 0x0050
238#define PRID_REV_VR4181 0x0050 /* Same as VR4111 */ 238#define PRID_REV_VR4181 0x0050 /* Same as VR4111 */
239#define PRID_REV_VR4121 0x0060 239#define PRID_REV_VR4121 0x0060
240#define PRID_REV_VR4122 0x0070 240#define PRID_REV_VR4122 0x0070
241#define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ 241#define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */
242#define PRID_REV_VR4130 0x0080 242#define PRID_REV_VR4130 0x0080
243#define PRID_REV_34K_V1_0_2 0x0022 243#define PRID_REV_34K_V1_0_2 0x0022
244#define PRID_REV_LOONGSON1B 0x0020 244#define PRID_REV_LOONGSON1B 0x0020
245#define PRID_REV_LOONGSON1C 0x0020 /* Same as Loongson-1B */ 245#define PRID_REV_LOONGSON1C 0x0020 /* Same as Loongson-1B */
246#define PRID_REV_LOONGSON2E 0x0002 246#define PRID_REV_LOONGSON2E 0x0002
247#define PRID_REV_LOONGSON2F 0x0003 247#define PRID_REV_LOONGSON2F 0x0003
248#define PRID_REV_LOONGSON3A_R1 0x0005 248#define PRID_REV_LOONGSON3A_R1 0x0005
249#define PRID_REV_LOONGSON3B_R1 0x0006 249#define PRID_REV_LOONGSON3B_R1 0x0006
250#define PRID_REV_LOONGSON3B_R2 0x0007 250#define PRID_REV_LOONGSON3B_R2 0x0007
251#define PRID_REV_LOONGSON3A_R2 0x0008 251#define PRID_REV_LOONGSON3A_R2 0x0008
252#define PRID_REV_LOONGSON3A_R3 0x0009 252#define PRID_REV_LOONGSON3A_R3_0 0x0009
253#define PRID_REV_LOONGSON3A_R3_1 0x000d
253 254
254/* 255/*
255 * Older processors used to encode processor version and revision in two 256 * Older processors used to encode processor version and revision in two
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index b2509c19cfb5..d535fc706a8b 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1849,7 +1849,8 @@ static inline void cpu_probe_loongson(struct cpuinfo_mips *c, unsigned int cpu)
1849 set_elf_platform(cpu, "loongson3a"); 1849 set_elf_platform(cpu, "loongson3a");
1850 set_isa(c, MIPS_CPU_ISA_M64R2); 1850 set_isa(c, MIPS_CPU_ISA_M64R2);
1851 break; 1851 break;
1852 case PRID_REV_LOONGSON3A_R3: 1852 case PRID_REV_LOONGSON3A_R3_0:
1853 case PRID_REV_LOONGSON3A_R3_1:
1853 c->cputype = CPU_LOONGSON3; 1854 c->cputype = CPU_LOONGSON3;
1854 __cpu_name[cpu] = "ICT Loongson-3"; 1855 __cpu_name[cpu] = "ICT Loongson-3";
1855 set_elf_platform(cpu, "loongson3a"); 1856 set_elf_platform(cpu, "loongson3a");
diff --git a/arch/mips/loongson64/common/env.c b/arch/mips/loongson64/common/env.c
index 1e8a955ae5a8..8f68ee02a8c2 100644
--- a/arch/mips/loongson64/common/env.c
+++ b/arch/mips/loongson64/common/env.c
@@ -198,7 +198,8 @@ void __init prom_init_env(void)
198 break; 198 break;
199 case PRID_REV_LOONGSON3A_R1: 199 case PRID_REV_LOONGSON3A_R1:
200 case PRID_REV_LOONGSON3A_R2: 200 case PRID_REV_LOONGSON3A_R2:
201 case PRID_REV_LOONGSON3A_R3: 201 case PRID_REV_LOONGSON3A_R3_0:
202 case PRID_REV_LOONGSON3A_R3_1:
202 cpu_clock_freq = 900000000; 203 cpu_clock_freq = 900000000;
203 break; 204 break;
204 case PRID_REV_LOONGSON3B_R1: 205 case PRID_REV_LOONGSON3B_R1:
diff --git a/arch/mips/loongson64/loongson-3/smp.c b/arch/mips/loongson64/loongson-3/smp.c
index 8501109bb0f0..fea95d003269 100644
--- a/arch/mips/loongson64/loongson-3/smp.c
+++ b/arch/mips/loongson64/loongson-3/smp.c
@@ -682,7 +682,8 @@ void play_dead(void)
682 (void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead); 682 (void *)CKSEG1ADDR((unsigned long)loongson3a_r1_play_dead);
683 break; 683 break;
684 case PRID_REV_LOONGSON3A_R2: 684 case PRID_REV_LOONGSON3A_R2:
685 case PRID_REV_LOONGSON3A_R3: 685 case PRID_REV_LOONGSON3A_R3_0:
686 case PRID_REV_LOONGSON3A_R3_1:
686 play_dead_at_ckseg1 = 687 play_dead_at_ckseg1 =
687 (void *)CKSEG1ADDR((unsigned long)loongson3a_r2r3_play_dead); 688 (void *)CKSEG1ADDR((unsigned long)loongson3a_r2r3_play_dead);
688 break; 689 break;
diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c
index 322de58eebaf..f66521c7f846 100644
--- a/drivers/platform/mips/cpu_hwmon.c
+++ b/drivers/platform/mips/cpu_hwmon.c
@@ -30,7 +30,8 @@ int loongson3_cpu_temp(int cpu)
30 case PRID_REV_LOONGSON3B_R2: 30 case PRID_REV_LOONGSON3B_R2:
31 reg = ((reg >> 8) & 0xff) - 100; 31 reg = ((reg >> 8) & 0xff) - 100;
32 break; 32 break;
33 case PRID_REV_LOONGSON3A_R3: 33 case PRID_REV_LOONGSON3A_R3_0:
34 case PRID_REV_LOONGSON3A_R3_1:
34 reg = (reg & 0xffff)*731/0x4000 - 273; 35 reg = (reg & 0xffff)*731/0x4000 - 273;
35 break; 36 break;
36 } 37 }