[U-Boot] [PATCH 1/3] ARM: make reserving the gd register a make variable

Jeroen Hofstee jeroen at myspectrum.nl
Sun Aug 11 22:58:37 CEST 2013


Currently all ARM targets spell out that r8 needs to be a reserved
register, while using a common crt0.s. Move this to a common make
variable so it is not repeated (and can be easily changed)

Signed-off-by: Jeroen Hofstee <jeroen at myspectrum.nl>
---
 arch/arm/config.mk                   | 2 ++
 arch/arm/cpu/arm1136/config.mk       | 2 +-
 arch/arm/cpu/arm1176/config.mk       | 2 +-
 arch/arm/cpu/arm720t/config.mk       | 2 +-
 arch/arm/cpu/arm920t/config.mk       | 2 +-
 arch/arm/cpu/arm925t/config.mk       | 2 +-
 arch/arm/cpu/arm926ejs/config.mk     | 2 +-
 arch/arm/cpu/arm946es/config.mk      | 2 +-
 arch/arm/cpu/arm_intcm/config.mk     | 2 +-
 arch/arm/cpu/armv7/config.mk         | 2 +-
 arch/arm/cpu/armv7/rmobile/config.mk | 2 +-
 arch/arm/cpu/ixp/config.mk           | 2 +-
 arch/arm/cpu/pxa/config.mk           | 2 +-
 arch/arm/cpu/s3c44b0/config.mk       | 2 +-
 arch/arm/cpu/sa1100/config.mk        | 2 +-
 15 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 540a119..5e382ab 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -98,3 +98,5 @@ endif
 ifneq ($(CONFIG_SPL_BUILD),y)
 ALL-y	+= checkarmreloc
 endif
+
+OPTION_FIXED_GD=$(call cc-option, -ffixed-r8)
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 1ef6061..daca1bd 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk
index 917da03..163778a 100644
--- a/arch/arm/cpu/arm1176/config.mk
+++ b/arch/arm/cpu/arm1176/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5t
diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
index 56b6280..f1fb6a8 100644
--- a/arch/arm/cpu/arm720t/config.mk
+++ b/arch/arm/cpu/arm720t/config.mk
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS +=  -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS +=  -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
 # =========================================================================
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
index 58fd756..a6b2c6f 100644
--- a/arch/arm/cpu/arm920t/config.mk
+++ b/arch/arm/cpu/arm920t/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
 # =========================================================================
diff --git a/arch/arm/cpu/arm925t/config.mk b/arch/arm/cpu/arm925t/config.mk
index 58fd756..a6b2c6f 100644
--- a/arch/arm/cpu/arm925t/config.mk
+++ b/arch/arm/cpu/arm925t/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
 # =========================================================================
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 917ff7e..a29634d 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv5te
 # =========================================================================
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
index 1e41c11..7465da1 100644
--- a/arch/arm/cpu/arm946es/config.mk
+++ b/arch/arm/cpu/arm946es/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS +=  -march=armv4
 # =========================================================================
diff --git a/arch/arm/cpu/arm_intcm/config.mk b/arch/arm/cpu/arm_intcm/config.mk
index 1e41c11..7465da1 100644
--- a/arch/arm/cpu/arm_intcm/config.mk
+++ b/arch/arm/cpu/arm_intcm/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS +=  -march=armv4
 # =========================================================================
diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
index ca4a9e7..22be8df 100644
--- a/arch/arm/cpu/armv7/config.mk
+++ b/arch/arm/cpu/armv7/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common -msoft-float $(OPTION_FIXED_GD)
 
 # If armv7-a is not supported by GCC fall-back to armv5, which is
 # supported by more tool-chains
diff --git a/arch/arm/cpu/armv7/rmobile/config.mk b/arch/arm/cpu/armv7/rmobile/config.mk
index 4f01610..fbf4b61 100644
--- a/arch/arm/cpu/armv7/rmobile/config.mk
+++ b/arch/arm/cpu/armv7/rmobile/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v7a.
 PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/ixp/config.mk b/arch/arm/cpu/ixp/config.mk
index 0f12f8b..ca2c182 100644
--- a/arch/arm/cpu/ixp/config.mk
+++ b/arch/arm/cpu/ixp/config.mk
@@ -8,7 +8,7 @@
 
 BIG_ENDIAN = y
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float -mbig-endian
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float -mbig-endian
 
 PLATFORM_CPPFLAGS += -mbig-endian -march=armv5te -mtune=strongarm1100
 
diff --git a/arch/arm/cpu/pxa/config.mk b/arch/arm/cpu/pxa/config.mk
index 535bca3..c6b8f0b 100644
--- a/arch/arm/cpu/pxa/config.mk
+++ b/arch/arm/cpu/pxa/config.mk
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -mcpu=xscale
 # =========================================================================
diff --git a/arch/arm/cpu/s3c44b0/config.mk b/arch/arm/cpu/s3c44b0/config.mk
index b902ca3..424584a 100644
--- a/arch/arm/cpu/s3c44b0/config.mk
+++ b/arch/arm/cpu/s3c44b0/config.mk
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi -msoft-float
 # =========================================================================
diff --git a/arch/arm/cpu/sa1100/config.mk b/arch/arm/cpu/sa1100/config.mk
index 576f685..d94e855 100644
--- a/arch/arm/cpu/sa1100/config.mk
+++ b/arch/arm/cpu/sa1100/config.mk
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=strongarm1100
 # =========================================================================
-- 
1.8.1.2



More information about the U-Boot mailing list