From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Lo=EFc?= Minier Date: Mon, 14 Mar 2011 17:11:52 +0100 Subject: [U-Boot] [RFC PATCH 1/2] armv7: enable Thumb build for armv7 In-Reply-To: <1300109258-12496-1-git-send-email-aneesh@ti.com> References: <1300109258-12496-1-git-send-email-aneesh@ti.com> Message-ID: <20110314161152.GD18358@bee.dooz.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Mar 14, 2011, Aneesh V wrote: > +- ARM Options: > + CONFIG_SYS_THUMB_BUILD > + > + Use this flag to build U-Boot using the Thumb instruction > + set for ARM architectures. Thumb instruction set provides > + better code density. For ARM architectures that support > + Thumb2 this flag will result in Thumb2 code generated by > + GCC. > + > - Linux Kernel Interface: > CONFIG_CLOCKS_IN_MHZ > The above README changes suggest that "Thumb-1" would also be possible but you patch an armv7 file: > --- a/arch/arm/cpu/armv7/config.mk > +++ b/arch/arm/cpu/armv7/config.mk so I suspect only armv7 CPUs would be affected? Consider patching arch/arm/config.mk instead which is where -marm is currently set: # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: PLATFORM_CPPFLAGS += $(call cc-option,-marm,) In fact, I would find it less confusing if the flags were -mthumb or -marm and never -marm -mthumb, so you probably want to patch the code setting -marm above to be in your "else" clause. > @@ -31,3 +31,8 @@ PLATFORM_CPPFLAGS += -march=armv5 This suggests that u-boot is actually built in ARMv5 mode, which means we're missing out actual Thumb-2 instructions (v6+). Perhaps arch/arm/cpu/armv7/config.mk should also $(call cc-option,-march=armv7). (I've never used -march=armv7 but it seems to exist and is probably more correct than -march=armv7-a). > # ========================================================================= > PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,\ > $(call cc-option,-malignment-traps,)) > + > +ifeq ($(CONFIG_SYS_THUMB_BUILD),y) > +# Enable Thumb mode build if compiler supports it > +PLATFORM_CPPFLAGS += $(call cc-option,-mthumb -mthumb-interwork) > +endif > -- > 1.7.0.4 > -- Lo?c Minier