[PATCH] MIPS: Use PRID_REV_LOONGSON1ABC instead of the legacy macro

2016-08-22 Thread Yang Ling
Signed-off-by: Yang Ling 
---
 arch/mips/include/asm/cpu.h | 3 +--
 arch/mips/kernel/cpu-probe.c| 8 +++-
 arch/mips/loongson32/common/setup.c | 6 --
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 9a83724..76c0b56c3 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -239,8 +239,7 @@
 #define PRID_REV_VR4181A   0x0070  /* Same as VR4122 */
 #define PRID_REV_VR41300x0080
 #define PRID_REV_34K_V1_0_20x0022
-#define PRID_REV_LOONGSON1B0x0020
-#define PRID_REV_LOONGSON1C0x0020  /* Same as Loongson-1B */
+#define PRID_REV_LOONGSON1ABC  0x0020
 #define PRID_REV_LOONGSON2E0x0002
 #define PRID_REV_LOONGSON2F0x0003
 #define PRID_REV_LOONGSON3A_R1 0x0005
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a88d442..0afa4be 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1495,8 +1495,14 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips 
*c, unsigned int cpu)
c->cputype = CPU_LOONGSON1;
 
switch (c->processor_id & PRID_REV_MASK) {
-   case PRID_REV_LOONGSON1B:
+   case PRID_REV_LOONGSON1ABC:
+#if defined(CONFIG_CPU_LOONGSON1A)
+   __cpu_name[cpu] = "Loongson 1A";
+#elif defined(CONFIG_CPU_LOONGSON1B)
__cpu_name[cpu] = "Loongson 1B";
+#elif defined(CONFIG_CPU_LOONGSON1C)
+   __cpu_name[cpu] = "Loongson 1C";
+#endif
break;
}
 
diff --git a/arch/mips/loongson32/common/setup.c 
b/arch/mips/loongson32/common/setup.c
index 1640744..1c3324a 100644
--- a/arch/mips/loongson32/common/setup.c
+++ b/arch/mips/loongson32/common/setup.c
@@ -21,8 +21,10 @@ const char *get_system_type(void)
unsigned int processor_id = (_cpu_data)->processor_id;
 
switch (processor_id & PRID_REV_MASK) {
-   case PRID_REV_LOONGSON1B:
-#if defined(CONFIG_LOONGSON1_LS1B)
+   case PRID_REV_LOONGSON1ABC:
+#if defined(CONFIG_LOONGSON1_LS1A)
+   return "LOONGSON LS1A";
+#elif defined(CONFIG_LOONGSON1_LS1B)
return "LOONGSON LS1B";
 #elif defined(CONFIG_LOONGSON1_LS1C)
return "LOONGSON LS1C";
-- 
1.9.1



[PATCH] MIPS: Use PRID_REV_LOONGSON1ABC instead of the legacy macro

2016-08-22 Thread Yang Ling
Signed-off-by: Yang Ling 
---
 arch/mips/include/asm/cpu.h | 3 +--
 arch/mips/kernel/cpu-probe.c| 8 +++-
 arch/mips/loongson32/common/setup.c | 6 --
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 9a83724..76c0b56c3 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -239,8 +239,7 @@
 #define PRID_REV_VR4181A   0x0070  /* Same as VR4122 */
 #define PRID_REV_VR41300x0080
 #define PRID_REV_34K_V1_0_20x0022
-#define PRID_REV_LOONGSON1B0x0020
-#define PRID_REV_LOONGSON1C0x0020  /* Same as Loongson-1B */
+#define PRID_REV_LOONGSON1ABC  0x0020
 #define PRID_REV_LOONGSON2E0x0002
 #define PRID_REV_LOONGSON2F0x0003
 #define PRID_REV_LOONGSON3A_R1 0x0005
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a88d442..0afa4be 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1495,8 +1495,14 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips 
*c, unsigned int cpu)
c->cputype = CPU_LOONGSON1;
 
switch (c->processor_id & PRID_REV_MASK) {
-   case PRID_REV_LOONGSON1B:
+   case PRID_REV_LOONGSON1ABC:
+#if defined(CONFIG_CPU_LOONGSON1A)
+   __cpu_name[cpu] = "Loongson 1A";
+#elif defined(CONFIG_CPU_LOONGSON1B)
__cpu_name[cpu] = "Loongson 1B";
+#elif defined(CONFIG_CPU_LOONGSON1C)
+   __cpu_name[cpu] = "Loongson 1C";
+#endif
break;
}
 
diff --git a/arch/mips/loongson32/common/setup.c 
b/arch/mips/loongson32/common/setup.c
index 1640744..1c3324a 100644
--- a/arch/mips/loongson32/common/setup.c
+++ b/arch/mips/loongson32/common/setup.c
@@ -21,8 +21,10 @@ const char *get_system_type(void)
unsigned int processor_id = (_cpu_data)->processor_id;
 
switch (processor_id & PRID_REV_MASK) {
-   case PRID_REV_LOONGSON1B:
-#if defined(CONFIG_LOONGSON1_LS1B)
+   case PRID_REV_LOONGSON1ABC:
+#if defined(CONFIG_LOONGSON1_LS1A)
+   return "LOONGSON LS1A";
+#elif defined(CONFIG_LOONGSON1_LS1B)
return "LOONGSON LS1B";
 #elif defined(CONFIG_LOONGSON1_LS1C)
return "LOONGSON LS1C";
-- 
1.9.1