summaryrefslogtreecommitdiff
path: root/src/arch/arm/armv7
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2015-11-13 13:28:41 -0800
committerJulius Werner <jwerner@chromium.org>2015-11-17 21:31:07 +0100
commitd3634c108d63d07ce004a66e3abb05e8da57d65b (patch)
treefaa8038ed49e4041d3eee01c8a2ca1add304b569 /src/arch/arm/armv7
parent0dc6a1e8987597ce234f2a4f54932219cd5e2480 (diff)
downloadcoreboot-d3634c108d63d07ce004a66e3abb05e8da57d65b.tar.xz
rules.h: Add ENV_ macros to detect current architecture
This patch expands the existing ENV_<stage> macros in <rules.h> with a set of ENV_<arch> macros which can be used to detect which architecture the current compilation unit is built for. These are more consistent than compiler-defined macros (like '#ifdef __arm__') and will make it easier to write small, architecture-dependent differences in common code (where we currently often use IS_ENABLED(CONFIG_ARCH_...), which is technically incorrect in a world where every stage can run on a different architecture, and merely kinda happened to work out for now). Also remove a vestigal <arch/rules.h> from ARM64 which was no longer used, and genericise ARM subarchitecture Makefiles a little to make things like __COREBOOT_ARM_ARCH__ available from all file types (including .ld). BUG=None TEST=Compiled Falco, Blaze, Jerry and Smaug. Change-Id: Id51aeb290b5c215c653e42a51919d0838e28621f Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/12433 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Diffstat (limited to 'src/arch/arm/armv7')
-rw-r--r--src/arch/arm/armv7/Makefile.inc42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/arch/arm/armv7/Makefile.inc b/src/arch/arm/armv7/Makefile.inc
index 3a489cb259..2e9c49cbe2 100644
--- a/src/arch/arm/armv7/Makefile.inc
+++ b/src/arch/arm/armv7/Makefile.inc
@@ -20,16 +20,14 @@ armv7-a_flags = -march=armv7-a $(armv7_flags)
armv7-m_flags = -march=armv7-m $(armv7_flags)
armv7_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated
-armv7-a_asm_flags = $(armv7-a_flags) $(armv7_asm_flags)
-armv7-m_asm_flags = $(armv7-m_flags) $(armv7_asm_flags)
###############################################################################
# bootblock
###############################################################################
ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7),y)
-bootblock-c-ccopts += $(armv7-a_flags)
-bootblock-S-ccopts += $(armv7-a_asm_flags)
+bootblock-generic-ccopts += $(armv7-a_flags)
+bootblock-S-ccopts += $(armv7_asm_flags)
ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y)
bootblock-y += bootblock.S
@@ -42,8 +40,8 @@ bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception_asm.S
bootblock-y += mmu.c
else ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV7_M),y)
-bootblock-c-ccopts += $(armv7-m_flags)
-bootblock-S-ccopts += $(armv7-m_asm_flags)
+bootblock-generic-ccopts += $(armv7-m_flags)
+bootblock-S-ccopts += $(armv7_asm_flags)
ifneq ($(CONFIG_BOOTBLOCK_CUSTOM),y)
bootblock-y += bootblock_m.S
@@ -58,10 +56,10 @@ endif # CONFIG_ARCH_BOOTBLOCK_ARMV7
################################################################################
ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7),y)
-libverstage-c-ccopts += $(armv7-a_flags)
-libverstage-S-ccopts += $(armv7-a_asm_flags)
-verstage-c-ccopts += $(armv7-a_flags)
-verstage-S-ccopts += $(armv7-a_asm_flags)
+libverstage-generic-ccopts += $(armv7-a_flags)
+libverstage-S-ccopts += $(armv7_asm_flags)
+verstage-generic-ccopts += $(armv7-a_flags)
+verstage-S-ccopts += $(armv7_asm_flags)
verstage-y += cache.c
verstage-y += cpu.S
@@ -70,10 +68,10 @@ verstage-y += exception_asm.S
verstage-y += mmu.c
else ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV7_M),y)
-libverstage-c-ccopts += $(armv7-m_flags)
-libverstage-S-ccopts += $(armv7-m_asm_flags)
-verstage-c-ccopts += $(armv7-m_flags)
-verstage-S-ccopts += $(armv7-m_asm_flags)
+libverstage-generic-ccopts += $(armv7-m_flags)
+libverstage-S-ccopts += $(armv7_asm_flags)
+verstage-generic-ccopts += $(armv7-m_flags)
+verstage-S-ccopts += $(armv7_asm_flags)
endif # CONFIG_ARCH_VERSTAGE_ARMV7_M
@@ -87,11 +85,11 @@ romstage-y += exception.c
romstage-y += exception_asm.S
romstage-y += mmu.c
-romstage-c-ccopts += $(armv7-a_flags)
-romstage-S-ccopts += $(armv7-a_asm_flags)
+romstage-generic-ccopts += $(armv7-a_flags)
+romstage-S-ccopts += $(armv7_asm_flags)
-rmodules_arm-c-ccopts += $(armv7-a_flags)
-rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
+rmodules_arm-generic-ccopts += $(armv7-a_flags)
+rmodules_arm-S-ccopts += $(armv7_asm_flags)
endif # CONFIG_ARCH_ROMSTAGE_ARMV7
@@ -107,10 +105,10 @@ ramstage-y += exception.c
ramstage-y += exception_asm.S
ramstage-y += mmu.c
-ramstage-c-ccopts += $(armv7-a_flags)
-ramstage-S-ccopts += $(armv7-a_asm_flags)
+ramstage-generic-ccopts += $(armv7-a_flags)
+ramstage-S-ccopts += $(armv7_asm_flags)
# All rmodule code is armv7 if ramstage is armv7.
-rmodules_arm-c-ccopts += $(armv7-a_flags)
-rmodules_arm-S-ccopts += $(armv7-a_asm_flags)
+rmodules_arm-generic-ccopts += $(armv7-a_flags)
+rmodules_arm-S-ccopts += $(armv7_asm_flags)
endif # CONFIG_ARCH_RAMSTAGE_ARMV7