Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 10/16] arch/arm: add support for hard-float on Cortex-M4
Date: Thu, 17 Mar 2016 00:45:19 +0100	[thread overview]
Message-ID: <56E9F00F.9040209@mind.be> (raw)
In-Reply-To: <1458164602-16983-11-git-send-email-thomas.petazzoni@free-electrons.com>

On 03/16/16 22:43, Thomas Petazzoni wrote:
> Cortex-M4 cores can optionally have a FPv4-SP floating point unit
> (which is different than the VFPv4). This commit adds the necessary
> Config.in options to allow the user to enable the use of this FPU, and
> to build an EABIhf toolchain for Cortex-M4.
>
> Note that for now the kernel does not have CONFIG_VFP support for
> ARMv7-M, so in practice, this VFP support cannot really be used for
> the moment.

  As in, when you select this option, then your target will fail dramatically 
because it's hardfloat so even a simple printf will crash violently if a 
reschedule happens in the middle?

  If so, I'm not so sure we really want this option...

>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>   arch/Config.in.arm | 23 +++++++++++++++++++++--
>   1 file changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/arch/Config.in.arm b/arch/Config.in.arm
> index ee612f5..ad3c725 100644
> --- a/arch/Config.in.arm
> +++ b/arch/Config.in.arm
> @@ -31,6 +31,12 @@ config BR2_ARM_CPU_HAS_VFPV4
>   	bool
>   	select BR2_ARM_CPU_HAS_VFPV3
>
> +config BR2_ARM_CPU_MAYBE_HAS_FPV4_SP

  Since the gcc option has -d16, shouldn't we have that as well?

> +	bool
> +
> +config BR2_ARM_CPU_HAS_FPV4_SP
> +	bool
> +
>   config BR2_ARM_CPU_HAS_ARM
>   	bool
>
> @@ -177,6 +183,7 @@ config BR2_cortex_m3
>   config BR2_cortex_m4
>   	bool "cortex-M4"
>   	select BR2_ARM_CPU_HAS_THUMB2
> +	select BR2_ARM_CPU_MAYBE_HAS_FPV4_SP
>   	select BR2_ARM_CPU_ARMV7M
>   config BR2_fa526
>   	bool "fa526/626"
> @@ -218,10 +225,11 @@ config BR2_ARM_ENABLE_NEON
>
>   config BR2_ARM_ENABLE_VFP
>   	bool "Enable VFP extension support"

  As I understand it (but I could be wrong), FPv4 is not again different from 
VFP, i.e. it's again a different ABI (like softfloat and VFP are different 
ABIs). At least, you get different flags in the ELF files. So I would tend to 
really make a separate option for FPv4, to avoid all confusion. That is, 
assuming that I'm right about it being a different ABI.

  Note that in practice it doesn't make much of a difference becaus you never 
have both VFP and FPv4 on the same processor. Well, at least for the time being 
- who knows what kind of ugliness ARM will still invent :-)

  Regards,
  Arnout

> -	depends on BR2_ARM_CPU_MAYBE_HAS_VFPV2
> +	depends on BR2_ARM_CPU_MAYBE_HAS_VFPV2 || BR2_ARM_CPU_MAYBE_HAS_FPV4_SP
>   	select BR2_ARM_CPU_HAS_VFPV4 if BR2_ARM_CPU_MAYBE_HAS_VFPV4
>   	select BR2_ARM_CPU_HAS_VFPV3 if BR2_ARM_CPU_MAYBE_HAS_VFPV3
>   	select BR2_ARM_CPU_HAS_VFPV2 if BR2_ARM_CPU_MAYBE_HAS_VFPV2
> +	select BR2_ARM_CPU_HAS_FPV4_SP if BR2_ARM_CPU_MAYBE_HAS_FPV4_SP
>   	help
>   	  For some CPU cores, the VFP extension is optional. Select
>   	  this option if you are certain your particular
> @@ -264,7 +272,7 @@ config BR2_ARM_EABI
>
>   config BR2_ARM_EABIHF
>   	bool "EABIhf"
> -	depends on BR2_ARM_CPU_HAS_VFPV2
> +	depends on BR2_ARM_CPU_HAS_VFPV2 || BR2_ARM_CPU_HAS_FPV4_SP
>   	help
>   	  The EABIhf is an extension of EABI which supports the 'hard'
>   	  floating point model. This model uses the floating point
> @@ -285,6 +293,7 @@ endchoice
>   choice
>   	prompt "Floating point strategy"
>   	depends on BR2_ARM_EABI || BR2_ARM_EABIHF
> +	default BR2_ARM_FPU_FPV4_SP if BR2_ARM_CPU_HAS_FPV4_SP
>   	default BR2_ARM_FPU_VFPV4D16 if BR2_ARM_CPU_HAS_VFPV4
>   	default BR2_ARM_FPU_VFPV3D16 if BR2_ARM_CPU_HAS_VFPV3
>   	default BR2_ARM_FPU_VFPV2 if BR2_ARM_CPU_HAS_VFPV2
> @@ -374,6 +383,15 @@ config BR2_ARM_FPU_VFPV4D16
>   	  cores, including the earlier Cortex-A{8, 9}, you should
>   	  instead select VFPv3-D16.
>
> +config BR2_ARM_FPU_FPV4_SP
> +	bool "FPv4-SP-D16"
> +	depends on BR2_ARM_CPU_HAS_FPV4_SP
> +	help
> +	  This option allows to use the FPv4-SP floating point unit,
> +	  as available in some ARMv7-M processors (Cortex-M4). This
> +	  option requires a FPv4-SP unit that has 16 double-precision
> +	  registers.
> +
>   config BR2_ARM_FPU_NEON
>   	bool "NEON"
>   	depends on BR2_ARM_CPU_HAS_NEON
> @@ -475,6 +493,7 @@ config BR2_GCC_TARGET_FPU
>   	default "vfpv3-d16" 	if BR2_ARM_FPU_VFPV3D16
>   	default "vfpv4" 	if BR2_ARM_FPU_VFPV4
>   	default "vfpv4-d16" 	if BR2_ARM_FPU_VFPV4D16
> +	default "fpv4-sp-d16"	if BR2_ARM_FPU_FPV4_SP
>   	default "neon" 		if BR2_ARM_FPU_NEON
>   	default "neon-vfpv4" 	if BR2_ARM_FPU_NEON_VFPV4
>
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2016-03-16 23:45 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 21:43 [Buildroot] [PATCH 00/16] ARM Cortex-M support Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 01/16] arch/arm: introduce and use BR2_ARM_CPU_ARMV7M Thomas Petazzoni
2016-03-16 22:29   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 02/16] arch/arm: Cortex-M3 provides only Thumb-2 Thomas Petazzoni
2016-03-16 22:43   ` Arnout Vandecappelle
2016-03-17  8:03     ` Thomas Petazzoni
2016-03-17 11:08       ` Peter Korsgaard
2016-03-17 13:06         ` Thomas Petazzoni
2016-03-17 20:36     ` Thomas Petazzoni
2016-03-17 22:34       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 03/16] arch/arm: add Cortex-M4 entry Thomas Petazzoni
2016-03-16 22:50   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 04/16] uclibc: Enable compile in thumb mode when selected Thomas Petazzoni
2016-03-16 23:01   ` Arnout Vandecappelle
2016-03-17 11:21   ` Peter Korsgaard
2016-03-17 13:10     ` Thomas Petazzoni
2016-03-17 21:25     ` Thomas Petazzoni
2016-03-17 21:44       ` Peter Korsgaard
2016-03-17 22:03         ` Thomas Petazzoni
2016-03-17 22:18           ` Peter Korsgaard
2016-03-16 21:43 ` [Buildroot] [PATCH 05/16] uclibc: disable DOPIC on ARM noMMU Thomas Petazzoni
2016-03-16 23:09   ` Arnout Vandecappelle
2016-03-17  8:06     ` Thomas Petazzoni
2016-03-17 10:32       ` Max Filippov
2016-03-17 11:00         ` Thomas Petazzoni
2016-03-17 11:39           ` Max Filippov
2016-03-16 21:43 ` [Buildroot] [PATCH 06/16] uclibc: NPTL thread implementation only available on MMU platforms Thomas Petazzoni
2016-03-16 23:11   ` Arnout Vandecappelle
2016-03-17 12:14   ` Peter Korsgaard
2016-03-17 13:11     ` Thomas Petazzoni
2016-03-17 19:45       ` Waldemar Brodkorb
2016-03-17 20:08         ` Peter Korsgaard
2016-03-16 21:43 ` [Buildroot] [PATCH 07/16] musl: build broken on Thumb, use ARM mode Thomas Petazzoni
2016-03-16 23:14   ` Arnout Vandecappelle
2016-03-17  8:10     ` Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 08/16] toolchain-buildroot: update glibc comment for noMMU Thomas Petazzoni
2016-03-16 23:18   ` Arnout Vandecappelle
2016-03-18 20:49     ` Thomas Petazzoni
2016-03-18 20:59       ` Peter Korsgaard
2016-03-18 21:33       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 09/16] toolchain-buildroot: don't show musl on noMMU platforms Thomas Petazzoni
2016-03-16 23:26   ` Arnout Vandecappelle
2016-03-18 20:51     ` Thomas Petazzoni
2016-03-18 21:42       ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 10/16] arch/arm: add support for hard-float on Cortex-M4 Thomas Petazzoni
2016-03-16 23:45   ` Arnout Vandecappelle [this message]
2016-03-17  8:16     ` Thomas Petazzoni
2016-03-18 21:47       ` Arnout Vandecappelle
2016-03-18 22:29         ` Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 11/16] package/Makefile.in: adjust LDFLAGS for elf2flt Thomas Petazzoni
2016-03-16 23:48   ` Arnout Vandecappelle
2016-03-16 21:43 ` [Buildroot] [PATCH 12/16] elf2flt: use new upstream site and add ARM patch Thomas Petazzoni
2016-03-16 23:50   ` Arnout Vandecappelle
2016-03-17  8:18     ` Thomas Petazzoni
2016-03-17 18:53       ` Mike Frysinger
2016-03-17 19:41         ` Waldemar Brodkorb
2016-03-17 20:34         ` Thomas Petazzoni
2016-03-17 20:45           ` Mike Frysinger
2016-03-17 19:39   ` Waldemar Brodkorb
2016-03-16 21:43 ` [Buildroot] [PATCH 13/16] elf2flt: disable Werror to avoid build issues Thomas Petazzoni
2016-03-16 23:53   ` Arnout Vandecappelle
2016-03-17  8:18     ` Thomas Petazzoni
2016-03-17  1:40   ` Mike Frysinger
2016-03-17  8:19     ` Thomas Petazzoni
2016-03-17 18:57       ` Mike Frysinger
2016-03-16 21:43 ` [Buildroot] [PATCH 14/16] afboot-stm32: use the Buildroot toolchain Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 15/16] configs/stm32f429_disco: new configuration for STM32F429 Discovery board Thomas Petazzoni
2016-03-16 21:43 ` [Buildroot] [PATCH 16/16] configs/stm32f469_disco: new configuration for STM32F469 " Thomas Petazzoni

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=56E9F00F.9040209@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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