[U-Boot] [PATCH v4 4/6] armv7: Use -march=armv7-a and thereby enable Thumb-2

Stephen Warren
2012-05-23T15:20:20Z

On 05/23/2012 09:01 AM, Thierry Reding wrote:
> * Aneesh V wrote:
>> Enable -march=armv7-a for armv7 platforms if the tool-chain
>> supports it. This in turn results in Thumb-2 code generated for
>> these platforms if CONFIG_SYS_THUMB_BUILD is enabled.
>>
>> Signed-off-by: Aneesh V <aneesh@ti.com> --- I believe armv7-a is
>> fine for all the SoCs except Tegra2 and I see that Tegra2 is
>> already making the necessary exception in
>> .../armv7/tegra2/config.mk
>>
>> Let me know if any other SoC has a problem with armv7-a
>
> I haven't been able to boot any Tegra2 boards with this patch
> applied. I'm guessing that some exceptions for Tegra2 code are
> still missing, though they shouldn't work with armv5 either since
> the AVP is armv4 only. For now I've conditionalized the
> -march=armv7-a on !CONFIG_TEGRA2.

I have the following patch locally, courtesy of Allen Martin. Allen,
are you going to (or did you) post the final version here?

> diff --git a/arch/arm/cpu/armv7/tegra2/config.mk
> b/arch/arm/cpu/armv7/tegra2/config.mk index fe9ef5b..f3ba6f5
> 100644 --- a/arch/arm/cpu/armv7/tegra2/config.mk +++
> b/arch/arm/cpu/armv7/tegra2/config.mk @@ -24,10 +24,12 @@ # MA
> 02111-1307 USA #
>
> -# Tegra has an ARMv4T CPU which runs board_init_f(), so we must
> build this -# file with compatible flags +# Tegra has an ARMv4T CPU
> which runs board_init_f(), so we must build these +# files with
> compatible flags ifdef CONFIG_TEGRA2 CFLAGS_arch/arm/lib/board.o +=
> -march=armv4t +CFLAGS_common/cmd_nvedit.o += -march=armv4t
> +CFLAGS_lib/string.o += -march=armv4t endif
>
> USE_PRIVATE_LIBGCC = yes