Skip to contentSkip to conversation

arm: build arch memset/memcpy in Thumb2 mode

PATCH Superseded Stefan Agner 5 participants 9 messages Nov 21, 2014 – Dec 18, 2014 Arm (32-bit)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

---
Changes since v1:
- Don't set auto-it in AFLAGS
- Removed "no-warn-deprecated" warning suppression
- Converted non-UAL assembler instructions to their UAL compliant variants

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

 arch/arm/config.mk               |   4 +-
 arch/arm/include/asm/assembler.h |  33 ++++++++++--
 arch/arm/lib/memcpy.S            |  80 +++++++++++++++++++---------
 arch/arm/lib/memset.S            | 112 ++++++++++++++++++++-------------------
 4 files changed, 142 insertions(+), 87 deletions(-)
arch/arm/config.mk +3 -1
index f0eafd6..14f4e9f 100644
@@ -26,7 +26,9 @@ PLATFORM_CPPFLAGS += -D__ARM__
 
 # Choose between ARM/Thumb instruction sets
 ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
-PF_CPPFLAGS_ARM := $(call cc-option, -mthumb -mthumb-interwork,\
+AFLAGS_IMPLICIT_IT	:= $(call as-option,-Wa$(comma)-mimplicit-it=always)
+PF_CPPFLAGS_ARM		:= $(AFLAGS_IMPLICIT_IT) $(AFLAGS_NOWARN) \
+			$(call cc-option, -mthumb -mthumb-interwork,\
 			$(call cc-option,-marm,)\
 			$(call cc-option,-mno-thumb-interwork,)\
 		)
arch/arm/include/asm/assembler.h +28 -5
index 5e4789b..11b80fb 100644
@@ -14,12 +14,14 @@
  *  assembler source.
  */
 
+#include <config.h>
+
 /*
  * Endian independent macros for shifting bytes within registers.
  */
 #ifndef __ARMEB__
-#define pull		lsr
-#define push		lsl
+#define lspull		lsr
+#define lspush		lsl
 #define get_byte_0	lsl #0
 #define get_byte_1	lsr #8
 #define get_byte_2	lsr #16
@@ -29,8 +31,8 @@
 #define put_byte_2	lsl #16
 #define put_byte_3	lsl #24
 #else
-#define pull		lsl
-#define push		lsr
+#define lspull		lsl
+#define lspush		lsr
 #define get_byte_0	lsr #24
 #define get_byte_1	lsr #16
 #define get_byte_2	lsr #8
@@ -54,7 +56,28 @@
 #define PLD(code...)
 #endif
 
+	.irp	c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
+	.macro	ret\c, reg
+#if defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__)
+	mov\c	pc, \reg
+#else
+	.ifeqs	"\reg", "lr"
+	bx\c	\reg
+	.else
+	mov\c	pc, \reg
+	.endif
+#endif
+	.endm
+	.endr
+
 /*
- * Cache alligned
+ * Cache aligned, used for optimized memcpy/memset
+ * In the kernel this is only enabled for Feroceon CPU's...
+ * We disable it especially for Thumb builds since those instructions
+ * are not made in a Thumb ready way...
  */
+#ifdef CONFIG_SYS_THUMB_BUILD
+#define CALGN(code...)
+#else
 #define CALGN(code...) code
+#endif
arch/arm/lib/memcpy.S +54 -26

138 lines not on this page · raw message

arch/arm/lib/memset.S +57 -55

171 lines not on this page · raw message

Signature · 1 line
2.1.3
#1 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Quoted 24 lines · Stefan Agner

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

---
Changes since v1:
- Don't set auto-it in AFLAGS
- Removed "no-warn-deprecated" warning suppression
- Converted non-UAL assembler instructions to their UAL compliant variants

Quoted 4 lines

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

Any thoughts on that? Would be nice to have it in 2015.01 as the current state breaks Thumb2 for our board.

--
Stefan

#2 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

In reply to Stefan Agner

Hi Stefan,

Quoted 17 lines · Stefan Agner

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

Quoted 6 lines

---
Changes since v1:
- Don't set auto-it in AFLAGS
- Removed "no-warn-deprecated" warning suppression
- Converted non-UAL assembler instructions to their UAL compliant variants

Tested on pit and found that it fixed the problem with Thumb mode. Still works fine in ARM mode.

A few nits:
- typo 'Hoever' in commit message
- you could mention the Linux commit/release you synced to

Quoted 11 lines

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

 arch/arm/config.mk               |   4 +-
 arch/arm/include/asm/assembler.h |  33 ++++++++++--
 arch/arm/lib/memcpy.S            |  80 +++++++++++++++++++---------
 arch/arm/lib/memset.S            | 112 ++++++++++++++++++++-------------------
 4 files changed, 142 insertions(+), 87 deletions(-)

Regards,
Simon

#3 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Quoted 29 lines · Simon Glass

Hi Stefan,

Quoted 17 lines · Stefan Agner

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

Quoted 6 lines

---
Changes since v1:
- Don't set auto-it in AFLAGS
- Removed "no-warn-deprecated" warning suppression
- Converted non-UAL assembler instructions to their UAL compliant variants

Quoted 9 lines

Tested on pit and found that it fixed the problem with Thumb mode. Still works fine in ARM mode.

A few nits:
- typo 'Hoever' in commit message
- you could mention the Linux commit/release you synced to

Thanks for testing Simon.

The Linux commit/release I synced to was some 3.18-rcX. However, the relevant files did not change since 3.17, so we can add that as the synced version.

--
Stefan

Quoted 14 lines
Quoted 11 lines

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

 arch/arm/config.mk               |   4 +-
 arch/arm/include/asm/assembler.h |  33 ++++++++++--
 arch/arm/lib/memcpy.S            |  80 +++++++++++++++++++---------
 arch/arm/lib/memset.S            | 112 ++++++++++++++++++++-------------------
 4 files changed, 142 insertions(+), 87 deletions(-)

Regards,
Simon

#4 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

In reply to Stefan Agner

I tested these changes on several compilers and binutils. 4.3.3, 4.6.3, 4.7.2, 4.8.2 and 4.9.2 gcc with binutils 2.19, 2.21-24 in both THUMB and ARM on the Vybrid. It seem we must have an image <= 224kB which is the IRAM bank0 size - 0x8000 of u-boot base; u-boot since v2014.04 will not boot for me as the QSPI seemed to take it over this boundary.

The attached patches are meant to be attached as they aren't meant to be taken by patchworks, etc but just to show the small changes I made to minimize the image to less than 224kB.

[build script]
# File sizes similar because of 'mkimage' padding+hdr for 'imx'. # 2nd size is for the 'thumb2' builds.
set -e

## (Sourcery CodeBench Lite 2012.03-56) 4.6.3 ## (Sourcery CodeBench Lite 2012.03-56) 2.21.53.20110905 # 227092 Dec 1 15:20 u-boot.imx
# 173844 Dec 1 15:36 u-boot.imx
export PATH=$PATH:$HOME/x-tools/arm-2012.03/bin

## 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601] ## GNU assembler (GNU Binutils) 2.23.2
# 222996 Dec 1 15:19 u-boot.imx
# 173844 Dec 1 15:35 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-2013.q3/bin

## (crosstool-NG hg+default-9838aecd6340) 4.8.2 ## (GNU Binutils) 2.23.2
# 222996 Dec 1 15:18 u-boot.imx
# 173844 Dec 1 15:34 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-eabi/bin

## (Sourcery G++ Lite 2009q1-161) 4.3.3
## (Sourcery G++ Lite 2009q1-161) 2.19.51.20090205 # 218900 Dec 1 15:17 u-boot.imx - no CONFIG_SYS_LONGHELP # GCC does not produce working THUMB binaries. #export PATH=$PATH:/opt/arm-2009q1/bin NAME=arm-none-eabi-

## (crosstool-NG 1.20.0) 4.9.2
## (crosstool-NG 1.20.0) 2.24
# 222996 Dec 1 15:21 u-boot.imx
# 173844 Dec 1 15:32 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi-vybrid-4.9.2/bin/

## (crosstool-NG hg+default-2a773bd38e71) 4.7.3
## (crosstool-NG hg+default-2a773bd38e71) 2.22
# 222996 Dec 1 15:22 u-boot.imx
# 173844 Dec 1 15:31 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi-4.7.2/bin

## (crosstool-NG hg+-c7fa97debb36) 4.6.3
## (crosstool-NG hg+-c7fa97debb36) 2.21.1
# 227092 Dec 1 15:24 u-boot.imx
# 173844 Dec 1 15:30 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi.gcc4.6.3/bin #NAME=arm-none-linux-gnueabi-

## (Timesys 20130708) 4.7.3
## (Timesys 20130708) 2.23.2
# 227092 Dec 1 15:25 u-boot.imx
# 173844 Dec 1 15:29 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/armv7l-timesys-linux-gnueabi/bin #NAME=armv7l-timesys-linux-gnueabi-

## (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 ## (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 2.23.2.20130610 Linaro 2013.10-4 # 222996 Dec 1 15:26 u-boot.imx
# 173844 Dec 1 15:28 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin #NAME=arm-linux-gnueabihf-

make CROSS_COMPILE=$NAME vf610twr_config
make CROSS_COMPILE=$NAME $* u-boot.imx
cp u-boot.imx /srv/tftp

[end script]

I applied Stefan's memcpy/thumb patch, reverted c6150aaf and applied 'fs/ext4/ext4fs.c, fs/fs.c fs/fat/fat_write.c: Adjust 64bit math methods' by Tom Rini <[email protected]> (it has a little whitespace fat in it). All of the images booted on a Vybrid Tower (Rev H) from an SD card. Only issue is that I think the 'AFLAGS_NOWARN' can be removed as per below...

Quoted 41 lines · stefan at agner.ch

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

---
Changes since v1: - Don't set auto-it in AFLAGS - Removed "no-warn-deprecated" warning suppression - Converted non-UAL assembler instructions to their UAL compliant variants

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

arch/arm/config.mk | 4 +- arch/arm/include/asm/assembler.h | 33 ++++++++++-- arch/arm/lib/memcpy.S | 80 +++++++++++++++++++--------- arch/arm/lib/memset.S | 112 ++++++++++++++++++++------------------- 4 files changed, 142 insertions(+), 87 deletions(-)

arch/arm/config.mk +0 -1
index f0eafd6..14f4e9f 100644
@@ -26,7 +26,9 @@ PLATFORM_CPPFLAGS += -D__ARM__
 
 # Choose between ARM/Thumb instruction sets ifeq
 ($(CONFIG_SYS_THUMB_BUILD),y) -PF_CPPFLAGS_ARM := $(call cc-option,
-mthumb -mthumb-interwork,\ +AFLAGS_IMPLICIT_IT := $(call
Quoted 2 lines

as-option,-Wa$(comma)-mimplicit-it=always) +PF_CPPFLAGS_ARM := $(AFLAGS_IMPLICIT_IT) $(AFLAGS_NOWARN) \ + $(call cc-option, -mthumb

I don't think we need the '$(AFLAGS_NOWARN)' as you fixed that? I removed it during my tests and didn't see anything. Especially all builds produced output. I guess this is copy/paste from a Linux Makefile as I don't even see where it is set in U-Boot.

Quoted 6 lines

-mthumb-interwork,\ $(call cc-option,-marm,)\ $(call cc-option,-mno-thumb-interwork,)\ ) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 5e4789b..11b80fb 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -14,12 +14,14 @@ * assembler source. */

[snip]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: thumb-mode.patch
Type: text/x-diff
Size: 1155 bytes
Desc: patches to 2015.01-rc2
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141203/fdc2d39f/attachment.patch>

#5 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Quoted 128 lines · Bill Pringlemeir

I tested these changes on several compilers and binutils. 4.3.3, 4.6.3, 4.7.2, 4.8.2 and 4.9.2 gcc with binutils 2.19, 2.21-24 in both THUMB and ARM on the Vybrid. It seem we must have an image <= 224kB which is the IRAM bank0 size - 0x8000 of u-boot base; u-boot since v2014.04 will not boot for me as the QSPI seemed to take it over this boundary.

The attached patches are meant to be attached as they aren't meant to be taken by patchworks, etc but just to show the small changes I made to minimize the image to less than 224kB.

[build script]
# File sizes similar because of 'mkimage' padding+hdr for 'imx'. # 2nd size is for the 'thumb2' builds.
set -e

## (Sourcery CodeBench Lite 2012.03-56) 4.6.3 ## (Sourcery CodeBench Lite 2012.03-56) 2.21.53.20110905 # 227092 Dec 1 15:20 u-boot.imx
# 173844 Dec 1 15:36 u-boot.imx
export PATH=$PATH:$HOME/x-tools/arm-2012.03/bin

## 4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601] ## GNU assembler (GNU Binutils) 2.23.2
# 222996 Dec 1 15:19 u-boot.imx
# 173844 Dec 1 15:35 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-2013.q3/bin

## (crosstool-NG hg+default-9838aecd6340) 4.8.2 ## (GNU Binutils) 2.23.2
# 222996 Dec 1 15:18 u-boot.imx
# 173844 Dec 1 15:34 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-eabi/bin

## (Sourcery G++ Lite 2009q1-161) 4.3.3
## (Sourcery G++ Lite 2009q1-161) 2.19.51.20090205 # 218900 Dec 1 15:17 u-boot.imx - no CONFIG_SYS_LONGHELP # GCC does not produce working THUMB binaries. #export PATH=$PATH:/opt/arm-2009q1/bin NAME=arm-none-eabi-

## (crosstool-NG 1.20.0) 4.9.2
## (crosstool-NG 1.20.0) 2.24
# 222996 Dec 1 15:21 u-boot.imx
# 173844 Dec 1 15:32 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi-vybrid-4.9.2/bin/

## (crosstool-NG hg+default-2a773bd38e71) 4.7.3
## (crosstool-NG hg+default-2a773bd38e71) 2.22
# 222996 Dec 1 15:22 u-boot.imx
# 173844 Dec 1 15:31 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi-4.7.2/bin

## (crosstool-NG hg+-c7fa97debb36) 4.6.3
## (crosstool-NG hg+-c7fa97debb36) 2.21.1
# 227092 Dec 1 15:24 u-boot.imx
# 173844 Dec 1 15:30 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/arm-none-linux-gnueabi.gcc4.6.3/bin #NAME=arm-none-linux-gnueabi-

## (Timesys 20130708) 4.7.3
## (Timesys 20130708) 2.23.2
# 227092 Dec 1 15:25 u-boot.imx
# 173844 Dec 1 15:29 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/armv7l-timesys-linux-gnueabi/bin #NAME=armv7l-timesys-linux-gnueabi-

## (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 ## (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 2.23.2.20130610 Linaro 2013.10-4
# 222996 Dec 1 15:26 u-boot.imx
# 173844 Dec 1 15:28 u-boot.imx
#export PATH=$PATH:$HOME/x-tools/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin #NAME=arm-linux-gnueabihf-

make CROSS_COMPILE=$NAME vf610twr_config
make CROSS_COMPILE=$NAME $* u-boot.imx
cp u-boot.imx /srv/tftp

[end script]

I applied Stefan's memcpy/thumb patch, reverted c6150aaf and applied 'fs/ext4/ext4fs.c, fs/fs.c fs/fat/fat_write.c: Adjust 64bit math methods' by Tom Rini <[email protected]> (it has a little whitespace fat in it). All of the images booted on a Vybrid Tower (Rev H) from an SD card. Only issue is that I think the 'AFLAGS_NOWARN' can be removed as per below...

Quoted 38 lines · stefan at agner.ch

Resynchronize memcpy/memset with kernel and build them explicitly in Thumb2 mode (unified syntax). Those assembler files can be built and linked in ARM mode too, however when calling them from Thumb2 built code, the stack got corrupted and the copy did not succeed (the exact details have not been traced back). Hoever, the Linux kernel builds those files in Thumb2 mode. Hence U-Boot should build them in Thumb2 mode too when CONFIG_SYS_THUMB_BUILD is set.

To build the files without warning, some assembler instructions had to be replaced with their UAL compliant variant (thanks Jeroen for this input).

To build the file in Thumb2 mode the implicit-it=always option need to be set to generate Thumb2 compliant IT instructions where needed. We add this option to the general AFLAGS when building for Thumb2.

---
Changes since v1: - Don't set auto-it in AFLAGS - Removed "no-warn-deprecated" warning suppression - Converted non-UAL assembler instructions to their UAL compliant variants

Tested in ARM and Thumb2 mode on Vybrid SoC. Disassembled the memset/ memcpy object files before and after converting the instructions to UAL, the output was identical.

arch/arm/config.mk | 4 +- arch/arm/include/asm/assembler.h | 33 ++++++++++-- arch/arm/lib/memcpy.S | 80 +++++++++++++++++++--------- arch/arm/lib/memset.S | 112 ++++++++++++++++++++------------------- 4 files changed, 142 insertions(+), 87 deletions(-)

arch/arm/config.mk +0 -0
index f0eafd6..14f4e9f 100644
@@ -26,7 +26,9 @@ PLATFORM_CPPFLAGS += -D__ARM__
 
Quoted 11 lines
Quoted 5 lines
arch/arm/config.mk +0 -1
 # Choose between ARM/Thumb instruction sets ifeq
 ($(CONFIG_SYS_THUMB_BUILD),y) -PF_CPPFLAGS_ARM := $(call cc-option,
-mthumb -mthumb-interwork,\ +AFLAGS_IMPLICIT_IT := $(call

as-option,-Wa$(comma)-mimplicit-it=always) +PF_CPPFLAGS_ARM := $(AFLAGS_IMPLICIT_IT) $(AFLAGS_NOWARN) \ + $(call cc-option, -mthumb

I don't think we need the '$(AFLAGS_NOWARN)' as you fixed that? I removed it during my tests and didn't see anything. Especially all builds produced output. I guess this is copy/paste from a Linux Makefile as I don't even see where it is set in U-Boot.

You are right, I removed the assignation of that but did not remove it's inclucion into the PF_CPPFLAGS_ARM variable...

Can this be fixed by the merger or should I create a new revision?

--
Stefan

Quoted 10 lines
Quoted 6 lines

-mthumb-interwork,\ $(call cc-option,-marm,)\ $(call cc-option,-mno-thumb-interwork,)\ ) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 5e4789b..11b80fb 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -14,12 +14,14 @@ * assembler source. */

[snip]

#6 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Hi Stefan,

Am 03.12.2014 um 18:04 schrieb Stefan Agner:

Quoted 1 line

Can this be fixed by the merger or should I create a new revision?

It looks as if this was neither applied nor respun? I have some more patches to make CONFIG_USE_PRIVATE_LIBGCC build for Thumb that I would like to rebase on it.

In particular, I have pieced together a tiny asm/unified.h file with THUMB() and ARM() macros and doing the .syntax unified in that central place, and resyncing the various arch/arm/lib/_*.S files from Linux.
https://github.com/afaerber/u-boot/commits/stm32

Is there a particular reason you are doing the .syntax inline here?

And looking beyond this patch, assuming this is for your Vybrid's M4, do you already have a concept for how to go about vectors.S, start.S and the like for ARMv7-M? :) I've stubbed them out for now but haven't managed to successfully link yet...

Regards,
Andreas

Signature · 2 lines
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imend?rffer; HRB 21284 AG N?rnberg
#7 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Hi Andreas,

Quoted 8 lines · Andreas F?rber

Hi Stefan,

Am 03.12.2014 um 18:04 schrieb Stefan Agner:

Quoted 1 line

Can this be fixed by the merger or should I create a new revision?

It looks as if this was neither applied nor respun? I have some more patches to make CONFIG_USE_PRIVATE_LIBGCC build for Thumb that I would like to rebase on it.

Not sure what the expectation is... Probably I should just do a respin since there are now three minor nits...

Quoted 7 lines

In particular, I have pieced together a tiny asm/unified.h file with THUMB() and ARM() macros and doing the .syntax unified in that central place, and resyncing the various arch/arm/lib/_*.S files from Linux.
https://github.com/afaerber/u-boot/commits/stm32

Is there a particular reason you are doing the .syntax inline here?

No particular reason other than laziness :-)

Quoted 5 lines

And looking beyond this patch, assuming this is for your Vybrid's M4, do you already have a concept for how to go about vectors.S, start.S and the like for ARMv7-M? :) I've stubbed them out for now but haven't managed to successfully link yet...

Actually no, I don't use U-Boot on the M4 (so far). For Linux on the Vybrid M4, I use a special boot loader which runs on the A5 Linux. On Vybrid (the variant we use at least) boots always from the A5 first, hence I have a running Linux. Or alternatively, I could run the M4 from U-Boot running on the A5. So far, I had no need to run U-Boot on the M4.

The reason I was interested in Thumb2 was the size: Due to lack of 5V on the Colibri module we need to load the boot loader using Vybrid's serial loader over UART which is somewhat slow. So the 25% reduction of size means 25% less download time...

--
Stefan

#8 lore raw

PATCH v2 1/1 arm: build arch memset/memcpy in Thumb2 mode

Hello Stefan,

Quoted 6 lines · Stefan Agner

Hi Andreas,

Quoted 3 lines · Andreas F?rber

Hi Stefan,

Am 03.12.2014 um 18:04 schrieb Stefan Agner:

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Can this be fixed by the merger or should I create a new revision?

It looks as if this was neither applied nor respun? I have some more patches to make CONFIG_USE_PRIVATE_LIBGCC build for Thumb that I would like to rebase on it.

Not sure what the expectation is... Probably I should just do a respin since there are now three minor nits...

Agreed, and assuming the three nits are cared for, I'd take it as a bugfix.

Amicalement,

Signature · 1 line
Albert.