linux-mips
[Top] [All Lists]

Re: [PATCH V2] MIPS: BMIPS: fix compilation for BMIPS5000

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH V2] MIPS: BMIPS: fix compilation for BMIPS5000
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 20 Aug 2013 18:24:27 +0100
Cc: Jonas Gorski <jogo@openwrt.org>, Linux-MIPS <linux-mips@linux-mips.org>, John Crispin <blogic@openwrt.org>, Kevin Cernekee <cernekee@gmail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5OnVjNrhgfz1zqExSeNyQTLTDoyvVT1BCGINuDVlopc=; b=sgXJ9J1tx07KW2QBUvaeGzBqgobCiQEGfDbMh5SUjCr2k5mEGoFeddLpqby1LhLFQA 9Snc5976NZ/58CzMOAC/cZqLCjLpPihqAJdJEu/gdxR9sZN5lsbuc6K7L1/uhnqRIesV gL0K8GO9QfPnkLHscY2K/pPDD/coLaYsH4K3FeTxOH6sr31/MUM6c5c9ciPlQHWgUOAO kNb7aIVOqlcKjlrGYrjTKFviZs1h4XsbbEfPxdwNOF47FYfxBAINDDNi4SSqGCP9JpCh P7GchrCXmqX2L9QRprFW5jIQTB7Vyasu0tmlsxAlVYk+qwExSPO3sGtWmJz5RUYeBJik KYQQ==
In-reply-to: <20130801135505.GA3466@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1375350938-16554-1-git-send-email-jogo@openwrt.org> <20130801135505.GA3466@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
2013/8/1 Ralf Baechle <ralf@linux-mips.org>:
> On Thu, Aug 01, 2013 at 11:55:38AM +0200, Jonas Gorski wrote:
>
>> Commit 02b849f7613003fe5f9e58bf233d49b0ebd4a5e8 ("MIPS: Get rid of the
>> use of .macro in C code.") replaced the macro usage but missed
>> the accessors in bmips.h, causing the following build error:
>>
>>   CC      arch/mips/kernel/smp-bmips.o
>> {standard input}: Assembler messages:
>> {standard input}:951: Error: Unrecognized opcode `_ssnop'
>> {standard input}:952: Error: Unrecognized opcode `_ssnop'
>> (...)
>> make[6]: *** [arch/mips/kernel/smp-bmips.o] Error 1
>>
>> Fix this by also replacing the macros here, fixing the last occurrence
>> in mips.
>
> How about getting rid of the entire inline assembler code by something
> like below patch?
>
>   Ralf
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Better late than never:

Tested-by: Florian Fainelli <f.fainelli@gmail.com>

>
>  arch/mips/include/asm/bmips.h | 56 
> ++++++++++++++++++-------------------------
>  1 file changed, 23 insertions(+), 33 deletions(-)
>
> diff --git a/arch/mips/include/asm/bmips.h b/arch/mips/include/asm/bmips.h
> index 552a65a..6483d26 100644
> --- a/arch/mips/include/asm/bmips.h
> +++ b/arch/mips/include/asm/bmips.h
> @@ -13,6 +13,7 @@
>  #include <linux/compiler.h>
>  #include <linux/linkage.h>
>  #include <asm/addrspace.h>
> +#include <asm/r4kcache.h>
>  #include <asm/mipsregs.h>
>  #include <asm/hazards.h>
>
> @@ -65,44 +66,33 @@ static inline unsigned long bmips_read_zscm_reg(unsigned 
> int offset)
>  {
>         unsigned long ret;
>
> -       __asm__ __volatile__(
> -               ".set push\n"
> -               ".set noreorder\n"
> -               "cache %1, 0(%2)\n"
> -               "sync\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "mfc0 %0, $28, 3\n"
> -               "_ssnop\n"
> -               ".set pop\n"
> -               : "=&r" (ret)
> -               : "i" (Index_Load_Tag_S), "r" (ZSCM_REG_BASE + offset)
> -               : "memory");
> +       barrier();
> +       cache_op(Index_Load_Tag_S, ZSCM_REG_BASE + offset);
> +       __sync();
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       ret = read_c0_ddatalo();
> +       __ssnop();
> +
>         return ret;
>  }
>
>  static inline void bmips_write_zscm_reg(unsigned int offset, unsigned long 
> data)
>  {
> -       __asm__ __volatile__(
> -               ".set push\n"
> -               ".set noreorder\n"
> -               "mtc0 %0, $28, 3\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "cache %1, 0(%2)\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               "_ssnop\n"
> -               : /* no outputs */
> -               : "r" (data),
> -                 "i" (Index_Store_Tag_S), "r" (ZSCM_REG_BASE + offset)
> -               : "memory");
> +       write_c0_ddatalo(3);
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       cache_op(Index_Store_Tag_S, ZSCM_REG_BASE + offset);
> +       __ssnop();
> +       __ssnop();
> +       __ssnop();
> +       barrier();
>  }
>
>  #endif /* !defined(__ASSEMBLY__) */



-- 
Florian

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