All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@gnu.org>
To: Robert Millan <rmh@gnu.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	wu zhangjin <wuzhangjin@gmail.com>,
	David Daney <ddaney@caviumnetworks.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH] Enable AT_PLATFORM for Loongson 2F CPU
Date: Tue, 16 Nov 2010 00:50:28 +0100	[thread overview]
Message-ID: <1289865028.9277.0@thorin> (raw)
In-Reply-To: <1289486855.14828.0@thorin> (from rmh@gnu.org on Thu Nov 11 15:47:35 2010)

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

El 11/11/10 15:47:35, en/na Robert Millan va escriure:
> -		__cpu_name[cpu] = "ICT Loongson-2";
> +		switch (c->processor_id & PRID_REV_MASK) {
> +		case PRID_REV_LOONGSON2E:
> +			__cpu_name[cpu] = "ICT Loongson-2E";

Actually, the V0.2 / V0.3 that follows in cpuinfo output
already indicates revision.  And I noticed that appending
the 'E' or 'F' breaks GCC's -march=native option (which
works by parsing /proc/cpuinfo).

Please use this patch instead.


[-- Attachment #2: loongson2f.diff --]
[-- Type: text/x-patch, Size: 1861 bytes --]


Signed-off-by: Robert Millan <rmh@gnu.org>

diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index fd1d39e..58844f6 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -344,6 +344,12 @@ extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *);
 #define ELF_PLATFORM  __elf_platform
 extern const char *__elf_platform;
 
+static inline void set_elf_platform(int cpu, const char *plat)
+{
+	if (cpu == 0)
+		__elf_platform = plat;
+}
+
 /*
  * See comments in asm-alpha/elf.h, this is the same thing
  * on the MIPS.
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 71620e1..accde65 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -614,6 +614,14 @@ 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 |
@@ -957,14 +965,12 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
 		c->cputype = CPU_CAVIUM_OCTEON_PLUS;
 		__cpu_name[cpu] = "Cavium Octeon+";
 platform:
-		if (cpu == 0)
-			__elf_platform = "octeon";
+		set_elf_platform(cpu, "octeon");
 		break;
 	case PRID_IMP_CAVIUM_CN63XX:
 		c->cputype = CPU_CAVIUM_OCTEON2;
 		__cpu_name[cpu] = "Cavium Octeon II";
-		if (cpu == 0)
-			__elf_platform = "octeon2";
+		set_elf_platform(cpu, "octeon2");
 		break;
 	default:
 		printk(KERN_INFO "Unknown Octeon chip!\n");


  reply	other threads:[~2010-11-15 23:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 12:18 [PATCH] Enable AT_PLATFORM for Loongson 2F CPU Robert Millan
2010-11-04 16:44 ` David Daney
2010-11-04 17:33   ` Aurelien Jarno
2010-11-04 18:43     ` Robert Millan
2010-11-04 19:11       ` David Daney
2010-11-04 19:29         ` Ralf Baechle
2010-11-07 12:30       ` Robert Millan
2010-11-08 19:13         ` David Daney
2010-11-08 22:27           ` Robert Millan
2010-11-08 22:50             ` David Daney
2010-11-08 23:02               ` Robert Millan
2010-11-09  9:48                 ` wu zhangjin
2010-11-09 12:24                   ` Robert Millan
2010-11-09 15:40                     ` Ralf Baechle
2010-11-11 14:47                       ` Robert Millan
2010-11-15 23:50                         ` Robert Millan [this message]
2010-11-15 23:59                           ` David Daney
2010-11-22 12:44                             ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289865028.9277.0@thorin \
    --to=rmh@gnu.org \
    --cc=aurelien@aurel32.net \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=wuzhangjin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.