ARC: rework setting of ARC CPU specific compiler options
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Wed, 12 Feb 2020 11:23:54 +0000 (14:23 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Wed, 12 Feb 2020 18:11:12 +0000 (21:11 +0300)
It's a very rare if at all existing occasion when ARC CPU template
is used as is w/o any changes - in the end it's a beauty and competitive
advantage of ARC cores to be tailored for a particular use-case - and
so it doesn't make a lot of sense to offer template-based "-mcpu" selection.
Given for each and every platform we end-up adding quite a few more flags
it's logical to move "-mcpu" selection to platform's definition as well
which we exactly do here.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
12 files changed:
arch/arc/config.mk
board/abilis/tb100/config.mk [new file with mode: 0644]
board/synopsys/axs10x/config.mk
board/synopsys/emsdp/config.mk
board/synopsys/hsdk/config.mk
board/synopsys/iot_devkit/config.mk
board/synopsys/nsim/Kconfig
board/synopsys/nsim/config.mk [new file with mode: 0644]
configs/nsim_700_defconfig
configs/nsim_700be_defconfig
configs/nsim_hs38_defconfig
configs/nsim_hs38be_defconfig

index 18005d999301fd59288edbded22b504d892c8d56..6fa29adae81f77eb6d1afa43143afe91212b96df 100644 (file)
@@ -22,26 +22,6 @@ ifdef CONFIG_ARC_MMU_VER
 CONFIG_MMU = 1
 endif
 
-ifdef CONFIG_CPU_ARC750D
-PLATFORM_CPPFLAGS += -mcpu=arc700
-endif
-
-ifdef CONFIG_CPU_ARC770D
-PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
-endif
-
-ifdef CONFIG_CPU_ARCEM6
-PLATFORM_CPPFLAGS += -mcpu=arcem
-endif
-
-ifdef CONFIG_CPU_ARCHS34
-PLATFORM_CPPFLAGS += -mcpu=archs
-endif
-
-ifdef CONFIG_CPU_ARCHS38
-PLATFORM_CPPFLAGS += -mcpu=archs
-endif
-
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -fno-common
 
diff --git a/board/abilis/tb100/config.mk b/board/abilis/tb100/config.mk
new file mode 100644 (file)
index 0000000..9e8dee4
--- /dev/null
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Synopsys, Inc. All rights reserved.
+
+PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
index 81ff498f818921be1de12eeabfc6ead10a60a4d4..ccac5442908e5032d754770a826aa041c6ff3164 100644 (file)
@@ -2,6 +2,12 @@
 #
 # Copyright (C) 2018 Synopsys, Inc. All rights reserved.
 
+ifdef CONFIG_TARGET_AXS103
+  PLATFORM_CPPFLAGS += -mcpu=archs
+else
+  PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
+endif
+
 bsp-generate: u-boot u-boot.bin
 ifdef CONFIG_ISA_ARCV2
        $(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-axs.py \
index 67fd7bf82a3a1607646d587dcc9fa24443a7f722..5bd10442aff417944fa17db1faf372d5a09a8dcb 100644 (file)
@@ -1,2 +1,2 @@
-PLATFORM_CPPFLAGS += -mlittle-endian -mnorm -mswap -mmpy-option=3 \
+PLATFORM_CPPFLAGS += -mcpu=arcem -mlittle-endian -mnorm -mswap -mmpy-option=3 \
                      -mbarrel-shifter -mfpu=fpuda_all -mcode-density
index 9e280f921a1b435f120f6047b683225abaa61c67..5ae22fa2b75e4233e1d47d97b90fd94cb30f351d 100644 (file)
@@ -2,6 +2,10 @@
 #
 # Copyright (C) 2018 Synopsys, Inc. All rights reserved.
 
+PLATFORM_CPPFLAGS += -mcpu=hs38_linux -mlittle-endian -matomic -mll64 \
+                     -mdiv-rem -mswap -mnorm -mmpy-option=9 -mbarrel-shifter \
+                     -mfpu=fpud_all
+
 bsp-generate: u-boot u-boot.bin
        $(Q)python3 $(srctree)/board/$(BOARDDIR)/headerize-hsdk.py \
                --arc-id 0x52 --image $(srctree)/u-boot.bin \
index 120733538a407aafae3a3609dfa6fb92841ad412..bd8f09ec7a7ed3288aabb2147ecb873fa0b6555d 100644 (file)
@@ -1,2 +1,3 @@
-PLATFORM_CPPFLAGS += -mlittle-endian -mcode-density -mdiv-rem -mswap -mnorm -mmpy-option=6 -mbarrel-shifter
+PLATFORM_CPPFLAGS += -mcpu=arcem -mlittle-endian -mcode-density -mdiv-rem \
+                     -mswap -mnorm -mmpy-option=6 -mbarrel-shifter
 LDSCRIPT = $(srctree)/board/synopsys/iot_devkit/u-boot.lds
index 22287032bf5e3a635e992cbdcd7440549d3dd8bf..b6966b2991efed1505b66e62470a615a1905f1d8 100644 (file)
@@ -9,4 +9,13 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
        default "nsim"
 
+config NSIM_BOARD_CPPFLAGS
+       string "board arc-specific compiler options"
+       help
+         For nSIM we allow to set custom arc-specific compiler options
+         (like -mcpu=) instead of hardcoding them in its makefile as nSIM
+         target is used for representing targets without fixed CPU version
+         like FPGA-based boards and software simulators.
+         This variable takes space separated compiler options list.
+
 endif
diff --git a/board/synopsys/nsim/config.mk b/board/synopsys/nsim/config.mk
new file mode 100644 (file)
index 0000000..40f9578
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Synopsys, Inc. All rights reserved.
+
+# CONFIG_NSIM_BOARD_CPPFLAGS is a string variable which comes from defconfig
+# with double quotes. We use echo to remove them so CONFIG_NSIM_BOARD_CPPFLAGS
+# won't be treated by compiler as a single option.
+PLATFORM_CPPFLAGS += $(shell echo $(CONFIG_NSIM_BOARD_CPPFLAGS))
index 6a38e2c246aa15b598ed7951a24987c55b3eebcc..5e89769784362f85a6ac7213f7e95f24bb6dd4c0 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARC=y
 CONFIG_TARGET_NSIM=y
+CONFIG_NSIM_BOARD_CPPFLAGS="-mcpu=arc700 -mlock -mswape"
 CONFIG_SYS_TEXT_BASE=0x81000000
 CONFIG_DEBUG_UART_BASE=0xf0000000
 CONFIG_DEBUG_UART_CLOCK=70000000
index d3ed84a4154c4b207832e249daa2cd53b3ddc5cf..03912712486b21f53594affa6700c77a61e8f7f4 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARC=y
 CONFIG_CPU_BIG_ENDIAN=y
 CONFIG_TARGET_NSIM=y
+CONFIG_NSIM_BOARD_CPPFLAGS="-mcpu=arc700 -mlock -mswape"
 CONFIG_SYS_TEXT_BASE=0x81000000
 CONFIG_DEBUG_UART_BASE=0xf0000000
 CONFIG_DEBUG_UART_CLOCK=70000000
index 6cd01a505be0622ecd980f8a7052bdd28b0c5ceb..910c2ce2242438a82a48865f29662ff1c66e13a6 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
 CONFIG_TARGET_NSIM=y
+CONFIG_NSIM_BOARD_CPPFLAGS="-mcpu=archs"
 CONFIG_SYS_TEXT_BASE=0x81000000
 CONFIG_DEBUG_UART_BASE=0xf0000000
 CONFIG_DEBUG_UART_CLOCK=70000000
index b074b4ca98c0193c40f6683609da8c81d61d2506..72472afb2b1199eeb221a2b195febc725fec6c35 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
 CONFIG_CPU_BIG_ENDIAN=y
 CONFIG_TARGET_NSIM=y
+CONFIG_NSIM_BOARD_CPPFLAGS="-mcpu=archs"
 CONFIG_SYS_TEXT_BASE=0x81000000
 CONFIG_DEBUG_UART_BASE=0xf0000000
 CONFIG_DEBUG_UART_CLOCK=70000000