From: Aurelien Jarno <aurelien@aurel32.net>
To: Huacai Chen <chenhc@lemote.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
John Crispin <john@phrozen.org>,
"Steven J. Hill" <Steven.Hill@imgtec.com>,
linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
Hongliang Tao <taohl@lemote.com>, Hua Yan <yanh@lemote.com>,
Aaro Koskinen <aaro.koskinen@iki.fi>
Subject: Re: [PATCH V16 02/12] MIPS: Loongson: Add basic Loongson-3 CPU support
Date: Sun, 12 Jan 2014 10:57:52 +0100 [thread overview]
Message-ID: <20140112095752.GA14181@ohm.rr44.fr> (raw)
In-Reply-To: <CAAhV-H7+XDYi3i7bp7q0t0oszi8tmAVGtTeAkP+t9VZ6sD3b1w@mail.gmail.com>
On Sun, Jan 12, 2014 at 05:03:51PM +0800, Huacai Chen wrote:
> On Fri, Jan 10, 2014 at 5:36 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > On Thu, Jan 09, 2014 at 04:30:54PM +0800, Huacai Chen wrote:
> >> On Thu, Jan 9, 2014 at 3:58 AM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> >>
> >> > On Wed, Jan 08, 2014 at 10:44:18AM +0800, Huacai Chen wrote:
> >> > > Basic Loongson-3 CPU support include CPU probing and TLB/cache
> >> > > initializing.
> >> > >
> >> > > Signed-off-by: Huacai Chen <chenhc@lemote.com>
> >> > > Signed-off-by: Hongliang Tao <taohl@lemote.com>
> >> > > Signed-off-by: Hua Yan <yanh@lemote.com>
> >> > > ---
> >> > > arch/mips/include/asm/cpu-type.h | 4 ++
> >> > > arch/mips/kernel/cpu-probe.c | 14 ++++++--
> >> > > arch/mips/mm/c-r4k.c | 59
> >> > ++++++++++++++++++++++++++++++++++++++
> >> > > arch/mips/mm/tlb-r4k.c | 5 ++-
> >> > > arch/mips/mm/tlbex.c | 1 +
> >> > > 5 files changed, 77 insertions(+), 6 deletions(-)
> >> > >
> >> > > diff --git a/arch/mips/include/asm/cpu-type.h
> >> > b/arch/mips/include/asm/cpu-type.h
> >> > > index 4a402cc..a591e63 100644
> >> > > --- a/arch/mips/include/asm/cpu-type.h
> >> > > +++ b/arch/mips/include/asm/cpu-type.h
> >> > > @@ -20,6 +20,10 @@ static inline int __pure __get_cpu_type(const int
> >> > cpu_type)
> >> > > case CPU_LOONGSON2:
> >> > > #endif
> >> > >
> >> > > +#ifdef CONFIG_SYS_HAS_CPU_LOONGSON3
> >> > > + case CPU_LOONGSON3:
> >> > > +#endif
> >> > > +
> >> > > #ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B
> >> > > case CPU_LOONGSON1:
> >> > > #endif
> >> > > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> >> > > index c814287..4bc81b2 100644
> >> > > --- a/arch/mips/kernel/cpu-probe.c
> >> > > +++ b/arch/mips/kernel/cpu-probe.c
> >> > > @@ -639,17 +639,23 @@ static inline void cpu_probe_legacy(struct
> >> > cpuinfo_mips *c, unsigned int cpu)
> >> > > MIPS_CPU_LLSC;
> >> > > c->tlbsize = 64;
> >> > > break;
> >> > > - case PRID_IMP_LOONGSON2:
> >> > > - c->cputype = CPU_LOONGSON2;
> >> > > - __cpu_name[cpu] = "ICT Loongson-2";
> >> > > -
> >> > > + case PRID_IMP_LOONGSON2: /* Loongson-2/3 have the same PRID_IMP
> >> > field */
> >> >
> >> > What about renaming that as something like PRID_IMP_LOONGSON23 given
> >> > it is for both Loongson 2 and 3?
> >> >
> >> Since Loongson-1 is 32-bit CPU and Loongson-2/3 are 64 bit, can I use
> >> PRID_IMP_LOONGSON_32 and PRID_IMP_LOONGSON_64?
> >> In my opinion these names are better.
> >
> > That would be the best I agree.
> >
> >> >
> >> > > switch (c->processor_id & PRID_REV_MASK) {
> >> > > case PRID_REV_LOONGSON2E:
> >> > > + c->cputype = CPU_LOONGSON2;
> >> > > + __cpu_name[cpu] = "ICT Loongson-2E";
> >> > > set_elf_platform(cpu, "loongson2e");
> >> > > break;
> >> > > case PRID_REV_LOONGSON2F:
> >> > > + c->cputype = CPU_LOONGSON2;
> >> > > + __cpu_name[cpu] = "ICT Loongson-2F";
> >> > > set_elf_platform(cpu, "loongson2f");
> >> > > break;
> >> >
> >> > As remarked by Aaro Koskinen, changing the names of the Loongson 2 CPUs
> >> > (which is displayedd in /proc/cpuinfo) will break at least
> >> > GCC -march=native option. The name should be left unchanged.
> >> >
> >> Can I keep it as is and then submit a patch to GCC? I think it is important
> >> to distinguish 2E/2F/3A in cpuinfo.
> >
> > I think first the patch has to be integrated to GCC, and then you have
> > to wait at least a few months so that people start using the new
> > version. Then it should be possible to modify this.
> >
> > That said, other programs than GCC might use this information from
> > /proc/cpuinfo and might also break with this change.
> The GCC patch has been accepted yesterday, and the coming V17 patchset
> won't be accept at least in kernel-3.14,
> So, I'll keep the name in V17.
Kernel 3.15 is expected in roughly 6 months, it might still be a bit
tight for the change to propagate, even if I have seen it has been added
to the 4.8 branch. What the others things? Aaro?
Aurelien
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2014-01-12 9:58 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 2:44 [PATCH V16 00/12] MIPS: Add Loongson-3 based machines support Huacai Chen
2014-01-08 2:44 ` [PATCH V16 01/12] MIPS: Loongson: Add basic Loongson-3 definition Huacai Chen
2014-01-08 19:58 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 02/12] MIPS: Loongson: Add basic Loongson-3 CPU support Huacai Chen
2014-01-08 19:58 ` Aurelien Jarno
[not found] ` <CAAhV-H4tx=sCk=iUwuCfnCS+rbmtu5Y_UcpAn6JXDoobA+OGrQ@mail.gmail.com>
2014-01-09 21:36 ` Aurelien Jarno
2014-01-12 9:03 ` Huacai Chen
2014-01-12 9:57 ` Aurelien Jarno [this message]
2014-01-12 12:10 ` Aaro Koskinen
2014-01-18 1:54 ` John Crispin
2014-01-08 2:44 ` [PATCH V16 03/12] MIPS: Loongson 3: Add Lemote-3A machtypes definition Huacai Chen
2014-01-08 19:58 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 04/12] MIPS: Loongson: Add UEFI-like firmware interface (LEFI) support Huacai Chen
2014-01-08 22:58 ` Aurelien Jarno
2014-01-09 12:43 ` Alex Smith
2014-01-09 12:43 ` Alex Smith
[not found] ` <CAAhV-H64BXsw5CBL-KW1eqXkYcadhHF2NeBH9YmWQz046Lpzzw@mail.gmail.com>
2014-01-09 21:37 ` Aurelien Jarno
2014-01-09 12:37 ` Alex Smith
2014-01-09 12:37 ` Alex Smith
2014-01-08 2:44 ` [PATCH V16 05/12] MIPS: Loongson 3: Add HT-linked PCI support Huacai Chen
2014-01-08 22:58 ` Aurelien Jarno
[not found] ` <CAAhV-H57tDmYByjVwhf3teFZkGowR4E9+OO1vO0kP3iAKTNJVw@mail.gmail.com>
2014-01-09 21:38 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 06/12] MIPS: Loongson 3: Add IRQ init and dispatch support Huacai Chen
2014-01-08 22:58 ` Aurelien Jarno
2014-01-09 12:52 ` Alex Smith
2014-01-09 12:52 ` Alex Smith
2014-01-08 2:44 ` [PATCH V16 07/12] MIPS: Loongson 3: Add serial port support Huacai Chen
2014-01-08 22:58 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 08/12] MIPS: Loongson: Add swiotlb to support big memory (>4GB) Huacai Chen
2014-01-08 22:58 ` Aurelien Jarno
[not found] ` <CAAhV-H4h43N2OR4znwVv3miVbGkWJLapdgr9Jou1j4R8-9TRyA@mail.gmail.com>
2014-01-09 22:08 ` Aurelien Jarno
[not found] ` <CAAhV-H7WFdt-4jYG5qPV36UWJQnSfkSa2J-3CAs2+QLqwHVhuA@mail.gmail.com>
2014-01-11 15:24 ` Aurelien Jarno
2014-01-09 12:56 ` Alex Smith
2014-01-09 12:56 ` Alex Smith
[not found] ` <CAAhV-H7ZO0gNzQ5wQ-yD=NiP2AJrc3-bWLXHo-HDngf27c9+gQ@mail.gmail.com>
2014-01-11 15:25 ` Aurelien Jarno
2014-01-12 9:12 ` Huacai Chen
2014-01-12 9:57 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 09/12] MIPS: Loongson: Add Loongson-3 Kconfig options Huacai Chen
2014-01-09 13:07 ` Alex Smith
2014-01-09 13:07 ` Alex Smith
2014-01-11 15:24 ` Aurelien Jarno
2014-01-13 3:02 ` Huacai Chen
2014-01-13 4:30 ` Aurelien Jarno
2014-01-13 10:15 ` Huacai Chen
2014-01-13 10:38 ` Aurelien Jarno
2014-01-13 12:15 ` Huacai Chen
2014-01-08 2:44 ` [PATCH V16 10/12] MIPS: Loongson 3: Add Loongson-3 SMP support Huacai Chen
2014-01-09 13:19 ` Alex Smith
2014-01-09 13:19 ` Alex Smith
2014-01-08 2:44 ` [PATCH V16 11/12] MIPS: Loongson 3: Add CPU hotplug support Huacai Chen
2014-01-11 15:24 ` Aurelien Jarno
2014-01-08 2:44 ` [PATCH V16 12/12] MIPS: Loongson: Add a Loongson-3 default config file Huacai Chen
2014-01-08 7:26 ` [PATCH V16 00/12] MIPS: Add Loongson-3 based machines support John Crispin
2014-01-18 9:38 ` Andreas Barth
[not found] ` <0466fa9d60b91233d2157d5ce0b51333.squirrel@mail.lemote.com>
2014-02-06 23:27 ` Andreas Barth
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=20140112095752.GA14181@ohm.rr44.fr \
--to=aurelien@aurel32.net \
--cc=Steven.Hill@imgtec.com \
--cc=aaro.koskinen@iki.fi \
--cc=chenhc@lemote.com \
--cc=john@phrozen.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=taohl@lemote.com \
--cc=wuzhangjin@gmail.com \
--cc=yanh@lemote.com \
--cc=zhangfx@lemote.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox