summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Kalowsky <daniel.kalowsky@intel.com>2016-03-03 16:25:40 -0800
committerGerrit Code Review <gerrit@zephyrproject.org>2016-03-04 15:08:40 +0000
commit3f6884902b7e3cd780ac3e99d381c5fab1fe0e71 (patch)
treecb22a9572669727573d27bb329149f182ef04bf1
parentbaddeadda161fb8de6437e0ecc0e2c4a52d2ab6d (diff)
arch: arm: set the architecture via Kconfig
Currently the build system has hardcoded values for the -march/-mcpu which identify what architecture should be used when compiling ARM code. For processors such as the STM32 this will need to be defined by a per SOC process. Change-Id: Ia8158cd687d8d0432ea420e204bb2bc67d33a054 Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
-rw-r--r--arch/arm/Makefile6
-rw-r--r--arch/arm/soc/atmel_sam3/Makefile3
-rw-r--r--arch/arm/soc/fsl_frdm_k64f/Makefile4
-rw-r--r--arch/arm/soc/ti_lm3s6965/Makefile3
4 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8a8ef40ea..fea5aad28 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -7,6 +7,12 @@ cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
KBUILD_CFLAGS += $(cflags-y)
KBUILD_CXXFLAGS += $(cflags-y)
+ifeq ($(CONFIG_CPU_CORTEX_M3),y)
+arch-cflags += $(call cc-option, -mthumb -mcpu=cortex-m3)
+else ifeq ($(CONFIG_CPU_CORTEX_M4),y)
+arch-cflags += $(call cc-option, -mthumb -mcpu=cortex-m4)
+endif
+
QEMU_CPU_TYPE_arm = cortex-m3
QEMU_FLAGS_arm = -cpu $(QEMU_CPU_TYPE_arm) \
-machine lm3s6965evb -nographic
diff --git a/arch/arm/soc/atmel_sam3/Makefile b/arch/arm/soc/atmel_sam3/Makefile
index e7d494890..494d173d0 100644
--- a/arch/arm/soc/atmel_sam3/Makefile
+++ b/arch/arm/soc/atmel_sam3/Makefile
@@ -1,6 +1,5 @@
-arch-cflags += $(call cc-option,-mthumb -mcpu=cortex-m3) \
- $(call cc-option,-mthumb -march=armv7-m)
+arch-cflags += $(call cc-option,-mthumb -march=armv7-m)
KBUILD_AFLAGS += $(arch-cflags)
KBUILD_CXXFLAGS += $(arch-cflags)
diff --git a/arch/arm/soc/fsl_frdm_k64f/Makefile b/arch/arm/soc/fsl_frdm_k64f/Makefile
index 5ebdf2eba..f4580b660 100644
--- a/arch/arm/soc/fsl_frdm_k64f/Makefile
+++ b/arch/arm/soc/fsl_frdm_k64f/Makefile
@@ -1,7 +1,5 @@
-
-arch-cflags = $(call cc-option,-mthumb -mcpu=cortex-m4) \
- $(call cc-option,-mthumb -march=armv7e-m)
+arch-cflags = $(call cc-option,-mthumb -march=armv7e-m)
KBUILD_CFLAGS += $(arch-cflags)
KBUILD_CXXFLAGS += $(arch-cflags)
diff --git a/arch/arm/soc/ti_lm3s6965/Makefile b/arch/arm/soc/ti_lm3s6965/Makefile
index 670a9815b..bfb20a7a1 100644
--- a/arch/arm/soc/ti_lm3s6965/Makefile
+++ b/arch/arm/soc/ti_lm3s6965/Makefile
@@ -1,6 +1,5 @@
-arch-cflags = $(call cc-option,-mthumb -mcpu=cortex-m3) \
- $(call cc-option,-mthumb -march=armv7-m)
+arch-cflags = $(call cc-option,-mthumb -march=armv7-m)
KBUILD_CFLAGS += $(arch-cflags)
KBUILD_CXXFLAGS += $(arch-cflags)