mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] ARC: allow to override default mcpu compiler flag
Date: Thu, 4 Jun 2020 18:27:34 +0000	[thread overview]
Message-ID: <50cb0c1f-a6df-1edb-af8c-7eb7c738493e@synopsys.com> (raw)
In-Reply-To: <20200604173927.23127-2-Eugeniy.Paltsev@synopsys.com>

On 6/4/20 10:39 AM, Eugeniy Paltsev wrote:
> Kernel builds set their own default -mcpu for a given ISA build.
> But that gets in the way of "custom" -mcpu flags from propagating
> into kernel build.
> 
> This will also be used in next patches for HSDK-4xD board support which
> uses a different -mcpu to effect dual issue scheduling.
> 
> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

Much better. Ack with nit below.

> ---
>  arch/arc/Kconfig  |  9 +++++++++
>  arch/arc/Makefile | 21 +++++++++++++++++++--
>  2 files changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> index ff306246d0f8..7034c217708f 100644
> --- a/arch/arc/Kconfig
> +++ b/arch/arc/Kconfig
> @@ -377,6 +377,15 @@ config ARC_HAS_SWAPE
>  	bool "Insn: SWAPE (endian-swap)"
>  	default y
>  
> +config ARC_TUNE_MCPU
> +	string "Override default -mcpu compiler flag"
> +	default ""
> +	help
> +	  Override default -mcpu=xxx compiler flag (which is set depending on
> +	  the ISA version) with the specified value.
> +	  NOTE: If specified flag isn't supported by current compiler the
> +	  ISA default value will be used as a fallback.
> +
>  if ISA_ARCV2
>  
>  config ARC_USE_UNALIGNED_MEM_ACCESS
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index 20e9ab6cc521..2b66e8264174 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -10,8 +10,25 @@ CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-)
>  endif
>  
>  cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
> -cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
> -cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=hs38
> +
> +tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT)	:= -mA7
> +tune-mcpu-def-$(CONFIG_ISA_ARCV2)	:= -mcpu=hs38
> +
> +ifeq ($(CONFIG_ARC_TUNE_MCPU),"")
> +cflags-y				+= $(tune-mcpu-def-y)
> +else
> +tune-mcpu				:= $(shell echo $(CONFIG_ARC_TUNE_MCPU))
> +tune-mcpu-ok 				:= $(call cc-option-yn, $(tune-mcpu))
> +ifeq ($(tune-mcpu-ok),y)
> +cflags-y				+= $(tune-mcpu)
> +else
> +# The flag provided by 'CONFIG_ARC_TUNE_MCPU' option isn't known by this compiler
> +# (probably the compiler is too old). Use ISA default mcpu flag instead as a safe option.

It is obvious what is done here and the comments can be skipped (no need to repost).

> +$(warning ** WARNING ** CONFIG_ARC_TUNE_MCPU flag '$(tune-mcpu)' is unknown, fallback to '$(tune-mcpu-def-y)')
> +cflags-y				+= $(tune-mcpu-def-y)
> +endif
> +endif

-Vineet

  reply	other threads:[~2020-06-04 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 17:39 [PATCH v2 0/4] ARC: [plat-hsdk-4xd] initial port for HSDK-4xD board Eugeniy Paltsev
2020-06-04 17:39 ` [PATCH v2 1/4] ARC: allow to override default mcpu compiler flag Eugeniy Paltsev
2020-06-04 18:27   ` Vineet Gupta [this message]
2020-06-05 10:47   ` Alexey Brodkin
2020-06-16 22:12     ` Vineet Gupta
2020-06-04 17:39 ` [PATCH v2 2/4] ARC: ARCv2: support loop buffer (LPB) disabling Eugeniy Paltsev
2020-06-18 19:50   ` Eugeniy Paltsev
2020-06-18 20:00     ` Vineet Gupta
2020-06-04 17:39 ` [PATCH v2 3/4] ARC: [plat-hsdk-4xd] initial port for HSDK-4xD board Eugeniy Paltsev
2020-06-04 22:02   ` Rob Herring
2020-06-04 17:39 ` [PATCH v2 4/4] ARC: [plat-hsdk*] document HSDK-4xD board/SoC bindings Eugeniy Paltsev
2020-06-04 20:00 ` [PATCH v2 0/4] ARC: [plat-hsdk-4xd] initial port for HSDK-4xD board Vineet Gupta

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=50cb0c1f-a6df-1edb-af8c-7eb7c738493e@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®