Patchwork [U-Boot,v2,1/4] ARM: make reserving the gd register a make variable

login
register
mail settings
Submitter Jeroen Hofstee
Date Aug. 14, 2013, 6:25 p.m.
Message ID <1376504746-15173-2-git-send-email-jeroen@myspectrum.nl>
Download mbox | patch
Permalink /patch/267176/
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Comments

Jeroen Hofstee - Aug. 14, 2013, 6:25 p.m.
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)

cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Signed-off-by: Jeroen Hofstee <jeroen@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(-)
Jeroen Hofstee - Aug. 17, 2013, 1:55 p.m.
On 08/14/2013 08:25 PM, Jeroen Hofstee wrote:
> 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)

I am leaking some debug code here, this can simply be an
assignment by value instead of a cc-option check.

Regards,
Jeroen
Albert ARIBAUD - Sept. 19, 2013, 6:57 a.m.
Hi Jeroen,

On Sat, 17 Aug 2013 15:55:16 +0200, Jeroen Hofstee
<jeroen@myspectrum.nl> wrote:

> On 08/14/2013 08:25 PM, Jeroen Hofstee wrote:
> > 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)
> 
> I am leaking some debug code here, this can simply be an
> assignment by value instead of a cc-option check.

Does this mean you'll repost a version of this patch?

> Regards,
> Jeroen

Amicalement,
Jeroen Hofstee - Sept. 19, 2013, 4:54 p.m.
Hello Albert,

On 09/19/2013 08:57 AM, Albert ARIBAUD wrote:
> On Sat, 17 Aug 2013 15:55:16 +0200, Jeroen Hofstee
> <jeroen@myspectrum.nl> wrote:
>
>> On 08/14/2013 08:25 PM, Jeroen Hofstee wrote:
>>> 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)
>> I am leaking some debug code here, this can simply be an
>> assignment by value instead of a cc-option check.
> Does this mean you'll repost a version of this patch?
>

yup, you get a v3. I intend to rebase on
http://patchwork.ozlabs.org/patch/273377/ as well.

Regards,
Jeroen

Patch

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
 # =========================================================================