Re: [PATCH] Enable AT_PLATFORM for Loongson 2F CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 09/11/10 10:48:34, en/na wu zhangjin va escriure:
> Just rechecked this with a friend from Lemote, in reality, the
> revision id of Loongson-2F is 0x3, so, my old code should be a
> reference for you:
> 
> arch/mips/loongson/common/platform.c
> 
> PRID_REV_LOONGSON2F and PRID_REV_LOONGSON2E has already been defined
> in arch/mips/include/asm/cpu.h
> 
> So, the manual is buggy, perhaps the editors of the manuals did copy
> and paste for I have found the title of the 2F manual is the same as
> the 2E manual ;-)

Thank you!  Then I suppose this will do it.

Signed-off-by: Robert Millan <rmh@xxxxxxx>

diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 71620e1..4341950 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -613,7 +613,20 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
 		break;
 	case PRID_IMP_LOONGSON2:
 		c->cputype = CPU_LOONGSON2;
-		__cpu_name[cpu] = "ICT Loongson-2";
+		switch (c->processor_id & PRID_REV_MASK) {
+		case PRID_REV_LOONGSON2E:
+			__cpu_name[cpu] = "ICT Loongson-2E";
+			if (cpu == 0)
+				__elf_platform = "loongson2e";
+			break;
+		case PRID_REV_LOONGSON2F:
+			__cpu_name[cpu] = "ICT Loongson-2F";
+			if (cpu == 0)
+				__elf_platform = "loongson2f";
+			break;
+		default:
+			__cpu_name[cpu] = "ICT Loongson-2";
+		}
 		c->isa_level = MIPS_CPU_ISA_III;
 		c->options = R4K_OPTS |
 			     MIPS_CPU_FPU | MIPS_CPU_LLSC |


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux