mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
ARC: build: allow users to specify -mcpu
kernel build system used to add -mcpu for each ARC ISA as default. These days there are versions and varaints of ARC HS cores some of which have specific -mcpu options to fine tune / optimize generated code. So allow users/external build systems to specify their own -mcpu This will be used in future patches for HSDK-4xD board support which uses specific -mcpu to utilize dual issue scheduling of the core. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com> [abrodkin/vgupta: rewrote changelog]
This commit is contained in:
parent
97d0b5d0b5
commit
0bdd6e7428
@ -170,6 +170,15 @@ config ARC_CPU_HS
|
||||
|
||||
endchoice
|
||||
|
||||
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.
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
bool "Enable Big Endian Mode"
|
||||
help
|
||||
|
@ -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.
|
||||
$(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
|
||||
|
||||
|
||||
ifdef CONFIG_ARC_CURR_IN_REG
|
||||
# For a global register defintion, make sure it gets passed to every file
|
||||
|
Loading…
Reference in New Issue
Block a user