soc: arm: Unify setting of Cortex-M specifc compiler flags

Moved setting of specific Cortex-M compiler flags in each SoC directory
unify setting them in the arch/arm/soc Makefile.

Add flags for Cortex M0, M0+, M1, M3, M4, and M7.  However only
CONFIG_CPU_CORTEX_M3 and CONFIG_CPU_CORTEX_M4 are supported at this time

As part of this change converted Kbuild files for some SoCs into
Makefiles as the Makefiles would be empty otherwise.

Change-Id: Ie4e0178b141ca761ec482a610ae50e94fe58070f
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2016-05-26 11:13:30 -05:00
commit bbe222cad0
11 changed files with 38 additions and 26 deletions

View file

@ -4,6 +4,32 @@ include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,) cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
cflags-cortex-m0 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0) \
$(call cc-option,-mthumb -march=armv6-m)
cflags-cortex-m0+ = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m0plus) \
$(call cc-option,-mthumb -march=armv6-m)
cflags-cortex-m1 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m1) \
$(call cc-option,-mthumb -march=armv6-m)
cflags-cortex-m3 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m3) \
$(call cc-option,-mthumb -march=armv7-m)
cflags-cortex-m4 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m4) \
$(call cc-option,-mthumb -march=armv7e-m)
cflags-cortex-m7 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m7) \
$(call cc-option,-mthumb -march=armv7e-m)
aflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
cflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
cxxflags-$(CONFIG_CPU_CORTEX_M3) += $(cflags-cortex-m3)
_arm_isa-$(CONFIG_CPU_CORTEX_M3) = armv7-m
aflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
cflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
cxxflags-$(CONFIG_CPU_CORTEX_M4) += $(cflags-cortex-m4)
_arm_isa-$(CONFIG_CPU_CORTEX_M4) = armv7e-m
_CROSS_COMPILE_arm_isa = $(_arm_isa-y)
KBUILD_AFLAGS += $(aflags-y)
KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y)
KBUILD_CXXFLAGS += $(cflags-y) KBUILD_CXXFLAGS += $(cflags-y)

View file

@ -1 +0,0 @@
obj-y += soc.o

View file

@ -1,2 +1 @@
soc-cflags += $(call cc-option,-mthumb -mcpu=cortex-m3) \ obj-y += soc.o
$(call cc-option,-mthumb -march=armv7-m)

View file

@ -1 +0,0 @@
obj-y += soc.o

View file

@ -1,6 +1 @@
soc-cflags = $(call cc-option,-mthumb -mcpu=cortex-m4) \ obj-y += soc.o
$(call cc-option,-march=armv7e-m) \
$(call cc-option,-mabi=aapcs)
_CROSS_COMPILE_arm_isa = armv7e-m
export _CROSS_COMPILE_arm_isa

View file

@ -1,3 +0,0 @@
obj-y += soc_config.o
obj-y += soc.o
obj-y += wdog.o

View file

@ -1,2 +1,3 @@
soc-cflags = $(call cc-option,-mthumb -mcpu=cortex-m4) \ obj-y += soc_config.o
$(call cc-option,-mthumb -march=armv7e-m) obj-y += soc.o
obj-y += wdog.o

View file

@ -1,4 +0,0 @@
obj-y += soc.o
obj-$(CONFIG_GPIO) += soc_gpio.o
obj-$(CONFIG_PINMUX) += soc_config.o

View file

@ -1,2 +1,4 @@
soc-cflags += $(call cc-option,-mthumb -mcpu=cortex-m3) \ obj-y += soc.o
$(call cc-option,-mthumb -march=armv7-m)
obj-$(CONFIG_GPIO) += soc_gpio.o
obj-$(CONFIG_PINMUX) += soc_config.o

View file

@ -1,3 +0,0 @@
obj-y += soc_config.o
obj-y += soc.o
obj-y += scp.o

View file

@ -1,2 +1,3 @@
soc-cflags = $(call cc-option,-mthumb -mcpu=cortex-m3) \ obj-y += soc_config.o
$(call cc-option,-mthumb -march=armv7-m) obj-y += soc.o
obj-y += scp.o