public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 1/2] armv7: enable Thumb build for armv7
Date: Tue, 15 Mar 2011 09:31:21 +0530	[thread overview]
Message-ID: <4D7EE491.8030304@ti.com> (raw)
In-Reply-To: <20110314161152.GD18358@bee.dooz.org>

Loic,

On Monday 14 March 2011 09:41 PM, Lo?c Minier wrote:
> 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.

I will do that. Thank you.

>
>> @@ -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).
>

Please note that I am enabling armv7-a in the second patch in omap4
config.mk file. The reason I didn't do this here was some ARMv7 SoCs do
not want to use -march=armv7-a even if the compiler supports it. Tegra2
is an example. Please see the below from Tegra2 config.mk:

# Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
PLATFORM_CPPFLAGS += -march=armv4

This being the case I would have had to define another CONFIG flag if I
had to add -march=armv7-a in arch/arm/cpu/armv7/config.mk. I thought it
un-necessary and instead put it in the SoC specific file. So, Tegra2
can continue to use -march=armv4 and will get Thumb-1 if they enable
CONFIG_SYS_THUMB_BUILD. Or do you think we should define something like
CONFIG_SYS_MARCH_ARMV7

I will try -march=armv7, but I vaguely remember it had some issues.

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

  reply	other threads:[~2011-03-15  4:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 13:27 [U-Boot] [RFC PATCH 1/2] armv7: enable Thumb build for armv7 Aneesh V
2011-03-14 13:27 ` [U-Boot] [RFC PATCH 2/2] OMAP4: enable Thumb2 support for OMAP4 Aneesh V
2011-03-14 16:11 ` [U-Boot] [RFC PATCH 1/2] armv7: enable Thumb build for armv7 Loïc Minier
2011-03-15  4:01   ` Aneesh V [this message]
2011-03-15 11:54     ` Loïc Minier
2011-03-16  8:39       ` Aneesh V
2011-03-16 17:25         ` Albert ARIBAUD
2011-03-17  7:30           ` Aneesh V
2011-03-24 14:45             ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D7EE491.8030304@ti.com \
    --to=aneesh@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox