All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
@ 2017-06-01  6:33 Phil Edworthy
  2017-06-01  6:33 ` [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds Phil Edworthy
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Phil Edworthy @ 2017-06-01  6:33 UTC (permalink / raw)
  To: u-boot

Rather than change asm files that come from Linux, add the symbols
to Kconfig. Since one of the symbols is for thumb2 builds, make
CPU_V7M always select them.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
 arch/arm/Kconfig      | 10 ++++++++++
 arch/arm/lib/Makefile |  2 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2a3a36e..2793651 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -19,6 +19,15 @@ config HAS_VBAR
 config HAS_THUMB2
 	bool
 
+# Used for compatibility with asm files copied from the kernel
+config ARM_ASM_UNIFIED
+	bool
+	default y
+
+# Used for compatibility with asm files copied from the kernel
+config THUMB2_KERNEL
+	bool
+
 # If set, the workarounds for these ARM errata are applied early during U-Boot
 # startup. Note that in general these options force the workarounds to be
 # applied; no CPU-type/version detection exists, unlike the similar options in
@@ -128,6 +137,7 @@ config CPU_V7
 config CPU_V7M
 	bool
 	select HAS_THUMB2
+	select THUMB2_KERNEL
 	select SYS_CACHE_SHIFT_5
 
 config CPU_PXA
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index f162c14..6e1c436 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -72,8 +72,6 @@ ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
 extra-y	+= eabi_compat.o
 endif
 
-asflags-y += -DCONFIG_ARM_ASM_UNIFIED
-
 # some files can only build in ARM or THUMB2, not THUMB1
 
 ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds
  2017-06-01  6:33 [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Phil Edworthy
@ 2017-06-01  6:33 ` Phil Edworthy
  2017-06-06  0:23   ` [U-Boot] [U-Boot,v3,2/2] " Tom Rini
  2017-06-06  0:23 ` [U-Boot] [U-Boot, 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Tom Rini
  2017-06-09  0:07 ` [U-Boot] [PATCH " Vikas MANOCHA
  2 siblings, 1 reply; 7+ messages in thread
From: Phil Edworthy @ 2017-06-01  6:33 UTC (permalink / raw)
  To: u-boot

The branch instruction only has an 11-bit relative target address, which
is sometimes not enough.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
---
v3:
 - Move CONFIG_ARM_ASM_UNIFIED and CONFIG_THUMB2_KERNEL to Kconfig
v2:
 - Use W(b) instead of ldr+mov. Using this macro requires
   CONFIG_ARM_ASM_UNIFIED and CONFIG_THUMB2_KERNEL to be defined.
---
 arch/arm/cpu/armv7m/start.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7m/start.S b/arch/arm/cpu/armv7m/start.S
index 49f2720..890c773 100644
--- a/arch/arm/cpu/armv7m/start.S
+++ b/arch/arm/cpu/armv7m/start.S
@@ -5,10 +5,12 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <asm/assembler.h>
+
 .globl	reset
 .type reset, %function
 reset:
-	b	_main
+	W(b)	_main
 
 .globl	c_runtime_cpu_setup
 c_runtime_cpu_setup:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [U-Boot, 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
  2017-06-01  6:33 [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Phil Edworthy
  2017-06-01  6:33 ` [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds Phil Edworthy
@ 2017-06-06  0:23 ` Tom Rini
  2017-06-09  0:07 ` [U-Boot] [PATCH " Vikas MANOCHA
  2 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2017-06-06  0:23 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 01, 2017 at 07:33:28AM +0100, Phil Edworthy wrote:

> Rather than change asm files that come from Linux, add the symbols
> to Kconfig. Since one of the symbols is for thumb2 builds, make
> CPU_V7M always select them.
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170605/afcb6da2/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [U-Boot,v3,2/2] armv7m: Fix larger builds
  2017-06-01  6:33 ` [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds Phil Edworthy
@ 2017-06-06  0:23   ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2017-06-06  0:23 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 01, 2017 at 07:33:29AM +0100, Phil Edworthy wrote:

> The branch instruction only has an 11-bit relative target address, which
> is sometimes not enough.
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170605/a9d0527b/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
  2017-06-01  6:33 [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Phil Edworthy
  2017-06-01  6:33 ` [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds Phil Edworthy
  2017-06-06  0:23 ` [U-Boot] [U-Boot, 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Tom Rini
@ 2017-06-09  0:07 ` Vikas MANOCHA
  2017-06-09  0:12   ` Tom Rini
  2 siblings, 1 reply; 7+ messages in thread
From: Vikas MANOCHA @ 2017-06-09  0:07 UTC (permalink / raw)
  To: u-boot

Hi Albert/Tom,

> -----Original Message-----
> From: Phil Edworthy [mailto:phil.edworthy at renesas.com]
> Sent: Wednesday, May 31, 2017 11:33 PM
> To: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Tom Rini <trini@konsulko.com>; Vikas MANOCHA <vikas.manocha@st.com>; Kamil Lulko <kamil.lulko@gmail.com>; u-
> boot at lists.denx.de; Phil Edworthy <phil.edworthy@renesas.com>
> Subject: [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
> 
> Rather than change asm files that come from Linux, add the symbols to Kconfig. Since one of the symbols is for thumb2 builds, make
> CPU_V7M always select them.
> 
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> ---
>  arch/arm/Kconfig      | 10 ++++++++++
>  arch/arm/lib/Makefile |  2 --
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2a3a36e..2793651 100644
> --- a/arch/arm/Kconfigl
> +++ b/arch/arm/Kconfig
> @@ -19,6 +19,15 @@ config HAS_VBAR
>  config HAS_THUMB2
>  	bool
> 
> +# Used for compatibility with asm files copied from the kernel config
> +ARM_ASM_UNIFIED
> +	bool
> +	default y

Is every arm arch (arm720, arm926 etc) assembly code written for unified ?
Otherwise we might have run-time side effects.

Cheers,
Vikas

> +
> +# Used for compatibility with asm files copied from the kernel config
> +THUMB2_KERNEL
> +	bool
> +
>  # If set, the workarounds for these ARM errata are applied early during U-Boot  # startup. Note that in general these options force
> the workarounds to be  # applied; no CPU-type/version detection exists, unlike the similar options in @@ -128,6 +137,7 @@ config
> CPU_V7  config CPU_V7M
>  	bool
>  	select HAS_THUMB2
> +	select THUMB2_KERNEL
>  	select SYS_CACHE_SHIFT_5
> 
>  config CPU_PXA
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index f162c14..6e1c436 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -72,8 +72,6 @@ ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
>  extra-y	+= eabi_compat.o
>  endif
> 
> -asflags-y += -DCONFIG_ARM_ASM_UNIFIED
> -
>  # some files can only build in ARM or THUMB2, not THUMB1
> 
>  ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
  2017-06-09  0:07 ` [U-Boot] [PATCH " Vikas MANOCHA
@ 2017-06-09  0:12   ` Tom Rini
  2017-06-09  0:41     ` Vikas MANOCHA
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Rini @ 2017-06-09  0:12 UTC (permalink / raw)
  To: u-boot

On Fri, Jun 09, 2017 at 12:07:40AM +0000, Vikas MANOCHA wrote:

> Hi Albert/Tom,
> 
> > -----Original Message-----
> > From: Phil Edworthy [mailto:phil.edworthy at renesas.com]
> > Sent: Wednesday, May 31, 2017 11:33 PM
> > To: Albert Aribaud <albert.u.boot@aribaud.net>
> > Cc: Tom Rini <trini@konsulko.com>; Vikas MANOCHA <vikas.manocha@st.com>; Kamil Lulko <kamil.lulko@gmail.com>; u-
> > boot at lists.denx.de; Phil Edworthy <phil.edworthy@renesas.com>
> > Subject: [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
> > 
> > Rather than change asm files that come from Linux, add the symbols to Kconfig. Since one of the symbols is for thumb2 builds, make
> > CPU_V7M always select them.
> > 
> > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > ---
> >  arch/arm/Kconfig      | 10 ++++++++++
> >  arch/arm/lib/Makefile |  2 --
> >  2 files changed, 10 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2a3a36e..2793651 100644
> > --- a/arch/arm/Kconfigl
> > +++ b/arch/arm/Kconfig
> > @@ -19,6 +19,15 @@ config HAS_VBAR
> >  config HAS_THUMB2
> >  	bool
> > 
> > +# Used for compatibility with asm files copied from the kernel config
> > +ARM_ASM_UNIFIED
> > +	bool
> > +	default y
> 
> Is every arm arch (arm720, arm926 etc) assembly code written for unified ?
> Otherwise we might have run-time side effects.

I could be missing something, but this is only used by <asm/assembler.h>
and in turn only by arch/arm/lib/*.S, where we already had been defining
this.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170608/0a255a7a/attachment.sig>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
  2017-06-09  0:12   ` Tom Rini
@ 2017-06-09  0:41     ` Vikas MANOCHA
  0 siblings, 0 replies; 7+ messages in thread
From: Vikas MANOCHA @ 2017-06-09  0:41 UTC (permalink / raw)
  To: u-boot

Hi Tom,

> -----Original Message-----
> From: Tom Rini [mailto:trini at konsulko.com]
> Sent: Thursday, June 08, 2017 5:12 PM
> To: Vikas MANOCHA <vikas.manocha@st.com>
> Cc: Phil Edworthy <phil.edworthy@renesas.com>; Albert Aribaud <albert.u.boot@aribaud.net>; Kamil Lulko
> <kamil.lulko@gmail.com>; u-boot at lists.denx.de
> Subject: Re: [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility
> 
> On Fri, Jun 09, 2017 at 12:07:40AM +0000, Vikas MANOCHA wrote:
> 
> > Hi Albert/Tom,
> >
> > > -----Original Message-----
> > > From: Phil Edworthy [mailto:phil.edworthy at renesas.com]
> > > Sent: Wednesday, May 31, 2017 11:33 PM
> > > To: Albert Aribaud <albert.u.boot@aribaud.net>
> > > Cc: Tom Rini <trini@konsulko.com>; Vikas MANOCHA
> > > <vikas.manocha@st.com>; Kamil Lulko <kamil.lulko@gmail.com>; u-
> > > boot at lists.denx.de; Phil Edworthy <phil.edworthy@renesas.com>
> > > Subject: [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm
> > > compatibility
> > >
> > > Rather than change asm files that come from Linux, add the symbols
> > > to Kconfig. Since one of the symbols is for thumb2 builds, make CPU_V7M always select them.
> > >
> > > Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> > > ---
> > >  arch/arm/Kconfig      | 10 ++++++++++
> > >  arch/arm/lib/Makefile |  2 --
> > >  2 files changed, 10 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index
> > > 2a3a36e..2793651 100644
> > > --- a/arch/arm/Kconfigl
> > > +++ b/arch/arm/Kconfig
> > > @@ -19,6 +19,15 @@ config HAS_VBAR
> > >  config HAS_THUMB2
> > >  	bool
> > >
> > > +# Used for compatibility with asm files copied from the kernel
> > > +config ARM_ASM_UNIFIED
> > > +	bool
> > > +	default y
> >
> > Is every arm arch (arm720, arm926 etc) assembly code written for unified ?
> > Otherwise we might have run-time side effects.
> 
> I could be missing something, but this is only used by <asm/assembler.h> and in turn only by arch/arm/lib/*.S, where we already had
> been defining this.

Yes, you are right. I was under the impression that asm/assembler.h is being used by all arm archs everywhere like startup code, cache mgt etc.

Cheers,
Vikas

> 
> --
> Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-09  0:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  6:33 [U-Boot] [PATCH 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Phil Edworthy
2017-06-01  6:33 ` [U-Boot] [PATCH v3 2/2] armv7m: Fix larger builds Phil Edworthy
2017-06-06  0:23   ` [U-Boot] [U-Boot,v3,2/2] " Tom Rini
2017-06-06  0:23 ` [U-Boot] [U-Boot, 1/2] arm: Add Kconfig symbols used for Linux asm compatibility Tom Rini
2017-06-09  0:07 ` [U-Boot] [PATCH " Vikas MANOCHA
2017-06-09  0:12   ` Tom Rini
2017-06-09  0:41     ` Vikas MANOCHA

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.