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>
This commit is contained in:
Dan Kalowsky 2016-03-03 16:25:40 -08:00 committed by Gerrit Code Review
commit 3f6884902b
4 changed files with 9 additions and 7 deletions

View file

@ -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