Use THUMB mode for VCMA9 U-Boot builts
cover Use THUMB mode for VCMA9 U-Boot builts
Patch 1 fixes a bug in the calling of board_init_r() in THUMB mode. Patch 2-3 enable THUMB support for the ARM920T architecture. Patch 4 finally activates THUMB mode for VCMA9.
PATCH 1/4 arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
--- arch/arm/lib/crt0.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/lib/crt0.S +5 -1
@@ -167,8 +167,12 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */ mov r0, r9 /* gd_t */ ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */ /* call board_init_r */ +#if defined(CONFIG_SYS_THUMB_BUILD) + ldr lr, =board_init_r /* this is auto-relocated! */ + bx lr +#else ldr pc, =board_init_r /* this is auto-relocated! */ - +#endif /* we should not return here. */ #endif
Signature · 1 line
1.8.4
PATCH 1/4 arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
Quoted 12 lines · David M?ller
Signed-off-by David M?ller <[email protected]>--- arch/arm/lib/crt0.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)arch/arm/lib/crt0.S +0
-0@@ -167,8 +167,12 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */ mov r0, r9 /* gd_t */ ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
arch/arm/lib/crt0.S clbss_l:cmp r0, r1 /* while not at end of BSS */ · line 177
Quoted 10 lines
arch/arm/lib/crt0.S +5
-1/* call board_init_r */ +#if defined(CONFIG_SYS_THUMB_BUILD) + ldr lr, =board_init_r /* this is auto-relocated! */ + bx lr +#else ldr pc, =board_init_r /* this is auto-relocated! */ - +#endif /* we should not return here. */ #endif
In general, my preference is always to use the thumb compatible way, can you rework like that and explain in the commit message? Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160209/4d1d0d1d/attachment.sig>
PATCH 1/4 arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
Hello
Quoted 14 lines · Tom Rini
arch/arm/lib/crt0.S clbss_l:cmp r0, r1 /* while not at end of BSS */ · line 177
Quoted 10 lines · David M?ller
arch/arm/lib/crt0.S +5
-1/* call board_init_r */ +#if defined(CONFIG_SYS_THUMB_BUILD) + ldr lr, =board_init_r /* this is auto-relocated! */ + bx lr +#else ldr pc, =board_init_r /* this is auto-relocated! */ - +#endif /* we should not return here. */ #endifIn general, my preference is always to use the thumb compatible way, can you rework like that and explain in the commit message? Thanks!
AFAIK, the "bx" instruction is undefined on non-THUMB capable architectures. I therefore don't see a way to avoid some kind of #if/#else/#endif construct.
Dave
PATCH 1/4 arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
Quoted 18 lines · David M?ller (ELSOFT AG)
Hello
Quoted 14 lines · Tom Rini
arch/arm/lib/crt0.S clbss_l:cmp r0, r1 /* while not at end of BSS */ · line 177
Quoted 10 lines · David M?ller
arch/arm/lib/crt0.S +5
-1/* call board_init_r */ +#if defined(CONFIG_SYS_THUMB_BUILD) + ldr lr, =board_init_r /* this is auto-relocated! */ + bx lr +#else ldr pc, =board_init_r /* this is auto-relocated! */ - +#endif /* we should not return here. */ #endifIn general, my preference is always to use the thumb compatible way, can you rework like that and explain in the commit message? Thanks!
Quoted 3 lines
AFAIK, the "bx" instruction is undefined on non-THUMB capable architectures. I therefore don't see a way to avoid some kind of #if/#else/#endif construct.
Ah, OK, nevermind then, thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160210/4f511f5e/attachment.sig>
PATCH 1/4 arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
In reply to David MüllerQuoted 1 line · David M?ller (ELSOFT AG)
Signed-off-by David M?ller <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/6d4eb124/attachment.sig>
PATCH 2/4 arm: the ARM920T is THUMB capable, so select the appropriate ISA
In reply to David Müller--- arch/arm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Makefile +1 -1
@@ -9,7 +9,7 @@ endif # This selects which instruction set is used. arch-$(CONFIG_CPU_ARM720T) =-march=armv4 -arch-$(CONFIG_CPU_ARM920T) =-march=armv4 +arch-$(CONFIG_CPU_ARM920T) =-march=armv4t arch-$(CONFIG_CPU_ARM926EJS) =-march=armv5te arch-$(CONFIG_CPU_ARM946ES) =-march=armv4 arch-$(CONFIG_CPU_SA1100) =-march=armv4
Signature · 1 line
1.8.4
PATCH 2/4 arm: the ARM920T is THUMB capable, so select the appropriate ISA
Quoted 1 line · David M?ller (ELSOFT AG)
Signed-off-by David M?ller <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/ed2b24e1/attachment.sig>
PATCH 3/4 arm: build some file(s) as ARM mode only
In reply to David Müller--- arch/arm/cpu/arm920t/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/cpu/arm920t/Makefile +6 -0
@@ -13,3 +13,9 @@ obj-$(CONFIG_USE_IRQ) += interrupts.o obj-$(CONFIG_EP93XX) += ep93xx/ obj-$(CONFIG_IMX) += imx/ obj-$(CONFIG_S3C24X0) += s3c24x0/ + +# some files can only build in ARM mode + +ifdef CONFIG_SYS_THUMB_BUILD +CFLAGS_cpu.o := -marm +endif
Signature · 1 line
1.8.4
PATCH 3/4 arm: build some file(s) as ARM mode only
Quoted 1 line · David M?ller (ELSOFT AG)
Signed-off-by David M?ller <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/ad75d66f/attachment.sig>
PATCH 4/4 arm: VCMA9: because of NOR flash space constrains, activate THUMB build mode
In reply to David Müller--- include/configs/VCMA9.h | 2 ++ 1 file changed, 2 insertions(+)
include/configs/VCMA9.h +2 -0
@@ -20,6 +20,8 @@* High Level Configuration Options * (easy to change) */ +#define CONFIG_SYS_THUMB_BUILD +#define CONFIG_S3C24X0 /* This is a SAMSUNG S3C24x0-type SoC */ #define CONFIG_S3C2410 /* specifically a SAMSUNG S3C2410 SoC */ #define CONFIG_VCMA9 /* on a MPL VCMA9 Board */
Signature · 1 line
1.8.4
PATCH 4/4 arm: VCMA9: because of NOR flash space constrains, activate THUMB build mode
Quoted 1 line · David M?ller (ELSOFT AG)
Signed-off-by David M?ller <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160215/96b3d86a/attachment.sig>