linux-mips
[Top] [All Lists]

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

To: Robert Millan <rmh@gnu.org>
Subject: Re: [PATCH] Enable AT_PLATFORM for Loongson 2F CPU
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 9 Nov 2010 15:40:55 +0000
Cc: wu zhangjin <wuzhangjin@gmail.com>, David Daney <ddaney@caviumnetworks.com>, Aurelien Jarno <aurelien@aurel32.net>, linux-mips@linux-mips.org
In-reply-to: <1289305442.31389.0@thorin>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <AANLkTi=HjVCbghbH3LYHQfzh=qAPBV-0q_JnfkGPXyS1@mail.gmail.com> <AANLkTimbPpVmbrk13+KSF_DbBmfwjpeuzr2i7DMAKHbO@mail.gmail.com> <1289305442.31389.0@thorin>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Nov 09, 2010 at 01:24:02PM +0100, Robert Millan wrote:

> 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.

Looks technically ok; I just have a more stylistic problem with the patch:

> +                     if (cpu == 0)
> +                             __elf_platform = "loongson2e";

Cavium introduced this idion first.  Now your patch is repeating it and I'm
sure other SMP platforms will soon use it.   I don't want a thousand
if (cpu == 0) in that file, so can you cook a patch that introduces a
helper, something like

static void set_elf_platform(const char *plat)
{
        if (cpu == 0)
                __elf_platform = plat;
}

Then use that for all assignments to __elf_platform?  Thanks.

  Ralf

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