All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Kinard <kumba@gentoo.org>
To: Matt Turner <mattst88@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Linux MIPS List <linux-mips@linux-mips.org>
Subject: Re: [PATCH] MIPS: Add R16000 detection
Date: Mon, 19 Jan 2015 19:56:06 -0500	[thread overview]
Message-ID: <54BDA7A6.1040506@gentoo.org> (raw)
In-Reply-To: <CAEdQ38H=bHCYm21LrA=EoENRj8jwKU2jk3u36s+hqfzU0VYQSQ@mail.gmail.com>

On 01/19/2015 14:34, Matt Turner wrote:
> On Sun, Jan 18, 2015 at 5:30 PM, Joshua Kinard <kumba@gentoo.org> wrote:
>> From: Joshua Kinard <kumba@gentoo.org>
>>
>> This allows the kernel to correctly detect an R16000 MIPS CPU on systems that
>> have those.  Otherwise, such systems will detect the CPU as an R14000, due to
>> similarities in the CPU PRId value.
>>
>> Signed-off-by: Joshua Kinard <kumba@gentoo.org>
>> ---
>>  arch/mips/include/asm/cpu-type.h     |    1 +
>>  arch/mips/include/asm/cpu.h          |    6 +++---
>>  arch/mips/kernel/cpu-probe.c         |    9 +++++++--
>>  arch/mips/kernel/perf_event_mipsxx.c |    1 +
>>  arch/mips/mm/c-r4k.c                 |    4 ++++
>>  arch/mips/mm/page.c                  |    1 +
>>  arch/mips/mm/tlb-r4k.c               |    3 ++-
>>  arch/mips/mm/tlbex.c                 |    1 +
>>  arch/mips/oprofile/common.c          |    1 +
>>  arch/mips/oprofile/op_model_mipsxx.c |    1 +
>>  10 files changed, 22 insertions(+), 6 deletions(-)
>>
>> linux-mips-add-r16000-detection.patch
>> diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
>> index b4e2bd8..d85fc26 100644
>> --- a/arch/mips/include/asm/cpu-type.h
>> +++ b/arch/mips/include/asm/cpu-type.h
>> @@ -150,6 +150,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
>>         case CPU_R10000:
>>         case CPU_R12000:
>>         case CPU_R14000:
>> +       case CPU_R16000:
>>  #endif
>>  #ifdef CONFIG_SYS_HAS_CPU_RM7000
>>         case CPU_RM7000:
>> diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
>> index 33866fc..53acfce 100644
>> --- a/arch/mips/include/asm/cpu.h
>> +++ b/arch/mips/include/asm/cpu.h
>> @@ -67,7 +67,7 @@
>>  #define PRID_IMP_R4300         0x0b00
>>  #define PRID_IMP_VR41XX                0x0c00
>>  #define PRID_IMP_R12000                0x0e00
>> -#define PRID_IMP_R14000                0x0f00
>> +#define PRID_IMP_R14000                0x0f00          /* R14K && R16K */
>>  #define PRID_IMP_R8000         0x1000
>>  #define PRID_IMP_PR4450                0x1200
>>  #define PRID_IMP_R4600         0x2000
>> @@ -283,8 +283,8 @@ enum cpu_type_enum {
>>         CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310,
>>         CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650,
>>         CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R5432, CPU_R10000,
>> -       CPU_R12000, CPU_R14000, CPU_VR41XX, CPU_VR4111, CPU_VR4121, CPU_VR4122,
>> -       CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
>> +       CPU_R12000, CPU_R14000, CPU_R16000, CPU_VR41XX, CPU_VR4111, CPU_VR4121,
>> +       CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
>>         CPU_SR71000, CPU_TX49XX,
>>
>>         /*
>> diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
>> index 5342674..3f334a8 100644
>> --- a/arch/mips/kernel/cpu-probe.c
>> +++ b/arch/mips/kernel/cpu-probe.c
>> @@ -833,8 +833,13 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
>>                 c->tlbsize = 64;
>>                 break;
>>         case PRID_IMP_R14000:
>> -               c->cputype = CPU_R14000;
>> -               __cpu_name[cpu] = "R14000";
>> +               if (((c->processor_id >> 4) & 0x0f) > 2) {
>> +                       c->cputype = CPU_R16000;
>> +                       __cpu_name[cpu] = "R16000";
>> +               } else {
>> +                       c->cputype = CPU_R14000;
>> +                       __cpu_name[cpu] = "R14000";
>> +               }
> 
> It looks like this is the only hunk that has a functional change, and
> that is simply setting __cpu_name[cpu] to "R16000"
> 
> You can do that without adding CPU_R16000 to the enumeration. I don't
> see that adding it accomplishes anything.
> 

It mirrors what CPU_R14000 and CPU_R12000 do.  I won't rule out that, down the
road, something about the R16K might be different enough from the R14K to
require one of these other spots later on, so adding it now isn't going to
adversely affect things.  Only IP35 has R16K's anyways, which doesn't support
Linux just yet.  It's a "for the future" patch.  Last of the R-series anyways,
since the R18000 died before it ever became silicon.

--J

  reply	other threads:[~2015-01-20  0:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  1:30 [PATCH] MIPS: Add R16000 detection Joshua Kinard
2015-01-19 19:34 ` Matt Turner
2015-01-20  0:56   ` Joshua Kinard [this message]
2015-01-20  2:43     ` Matt Turner
2015-01-20  4:13       ` Joshua Kinard
2015-01-20  5:11         ` Matt Turner
2015-01-20  5:32           ` Joshua Kinard
2015-01-20 13:51             ` Ralf Baechle
2015-01-21 12:56 ` Joshua Kinard

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=54BDA7A6.1040506@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mattst88@gmail.com \
    --cc=ralf@linux-mips.org \
    /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.