From 3f6884902b7e3cd780ac3e99d381c5fab1fe0e71 Mon Sep 17 00:00:00 2001 From: Dan Kalowsky Date: Thu, 3 Mar 2016 16:25:40 -0800 Subject: 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 --- arch/arm/Makefile | 6 ++++++ arch/arm/soc/atmel_sam3/Makefile | 3 +-- arch/arm/soc/fsl_frdm_k64f/Makefile | 4 +--- arch/arm/soc/ti_lm3s6965/Makefile | 3 +-- 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) -- cgit v1.2.3