linux-mips
[Top] [All Lists]

[PATCH 3/3] MIPS: Set ELF AT_PLATFORM string for Loongson2 processors

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 3/3] MIPS: Set ELF AT_PLATFORM string for Loongson2 processors
From: Kevin Cernekee <cernekee@gmail.com>
Date: Sat, 16 Apr 2011 11:29:29 -0700
Cc: Robert Millan <rmh@gnu.org>, David Daney <ddaney@caviumnetworks.com>, wu zhangjin <wuzhangjin@gmail.com>, Aurelien Jarno <aurelien@aurel32.net>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
In-reply-to: <f571cce5cf7793777f8303cea5e9628f@localhost>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <f571cce5cf7793777f8303cea5e9628f@localhost>
Sender: linux-mips-bounce@linux-mips.org
User-agent: vim 7.2
From: Robert Millan <rmh@gnu.org>

Signed-off-by: Robert Millan <rmh@gnu.org>
Acked-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/mips/kernel/cpu-probe.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index e3cf292..27ef0fc 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -614,6 +614,16 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips 
*c, unsigned int cpu)
        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:
+                       set_elf_platform(cpu, "loongson2e");
+                       break;
+               case PRID_REV_LOONGSON2F:
+                       set_elf_platform(cpu, "loongson2f");
+                       break;
+               }
+
                c->isa_level = MIPS_CPU_ISA_III;
                c->options = R4K_OPTS |
                             MIPS_CPU_FPU | MIPS_CPU_LLSC |
-- 
1.7.4.3


<Prev in Thread] Current Thread [Next in Thread>