From d3634c108d63d07ce004a66e3abb05e8da57d65b Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 13 Nov 2015 13:28:41 -0800 Subject: rules.h: Add ENV_ macros to detect current architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch expands the existing ENV_ macros in with a set of ENV_ 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 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 Reviewed-on: http://review.coreboot.org/12433 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Kyösti Mälkki Tested-by: Raptor Engineering Automated Test Stand --- src/arch/arm/armv4/Makefile.inc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/arch/arm/armv4') diff --git a/src/arch/arm/armv4/Makefile.inc b/src/arch/arm/armv4/Makefile.inc index ee1879cf8f..1b91961f7e 100644 --- a/src/arch/arm/armv4/Makefile.inc +++ b/src/arch/arm/armv4/Makefile.inc @@ -30,8 +30,7 @@ endif bootblock-y += cache.c -bootblock-c-ccopts += $(armv4_flags) -bootblock-S-ccopts += $(armv4_flags) +bootblock-generic-ccopts += $(armv4_flags) endif # CONFIG_ARCH_BOOTBLOCK_ARMV4 @@ -40,10 +39,8 @@ endif # CONFIG_ARCH_BOOTBLOCK_ARMV4 ################################################################################ ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV4),y) -libverstage-c-ccopts += $(armv4_flags) -libverstage-S-ccopts += $(armv4_flags) -verstage-c-ccopts += $(armv4_flags) -verstage-S-ccopts += $(armv4_flags) +libverstage-generic-ccopts += $(armv4_flags) +verstage-generic-ccopts += $(armv4_flags) verstage-y += cache.c endif # CONFIG_ARCH_VERSTAGE_ARMV4 @@ -55,12 +52,10 @@ endif # CONFIG_ARCH_VERSTAGE_ARMV4 ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV4),y) -romstage-c-ccopts += $(armv4_flags) -romstage-S-ccopts += $(armv4_flags) +romstage-generic-ccopts += $(armv4_flags) romstage-y += cache.c -rmodules_arm-c-ccopts += $(armv4_flags) -rmodules_arm-S-ccopts += $(armv4_flags) +rmodules_arm-generic-ccopts += $(armv4_flags) endif # CONFIG_ARCH_ROMSTAGE_ARMV4 @@ -70,7 +65,6 @@ endif # CONFIG_ARCH_ROMSTAGE_ARMV4 ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV4),y) -ramstage-c-ccopts += $(armv4_flags) -ramstage-S-ccopts += $(armv4_flags) +ramstage-generic-ccopts += $(armv4_flags) endif # CONFIG_ARCH_RAMSTAGE_ARMV4 -- cgit v1.2.3