All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3] arch/csky: Add ck860 and vdsp compiler options
Date: Tue, 7 May 2019 14:01:50 +0200	[thread overview]
Message-ID: <20190507140150.7d970503@windsurf> (raw)
In-Reply-To: <1557222442-8484-1-git-send-email-guoren@kernel.org>

Hello Guo,

Thanks for this new csky related contribution. See below some comments.

On Tue,  7 May 2019 17:47:20 +0800
guoren at kernel.org wrote:

> From: Guo Ren <ren_guo@c-sky.com>
> 
> The ck860 is C-SKY abiv2 cpu series and it could support SMP and vdsp
> instructions set. Add the compiler options for them.
> 
> Signed-off-by: Guo Ren <ren_guo@c-sky.com>
> ---
>  arch/Config.in.csky | 33 ++++++++++++++++++++-------------
>  1 file changed, 20 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/Config.in.csky b/arch/Config.in.csky
> index e88e4e2..bbff600 100644
> --- a/arch/Config.in.csky
> +++ b/arch/Config.in.csky
> @@ -13,19 +13,26 @@ config BR2_ck807
>  config BR2_ck810
>  	bool "ck810"
>  
> +config BR2_ck860
> +	bool "ck860"
> +
>  endchoice
>  
>  config BR2_CSKY_FPU
>  	bool "Enable FPU coprocessor"
> -	depends on BR2_ck810 || BR2_ck807
> +	depends on BR2_ck807 || BR2_ck810 || BR2_ck860
>  	help
>  	  You can say N here if your C-SKY CPU doesn't have a
>  	  Floating-Point Coprocessor or if you don't need FPU support
>  	  for your user-space programs.
>  
> -config BR2_CSKY_DSP
> -	bool "Enable DSP enhanced instructions"
> -	depends on BR2_ck810 || BR2_ck807

Why is this option being removed ? This is not explained in the commit
log.

> +config BR2_CSKY_VDSP
> +	bool "Enable VDSP 3.0 enhanced instructions Co-processor"
> +	depends on BR2_ck860
> +
> +config BR2_GCC_TARGET_FLOAT_ABI
> +	default "soft"		if !BR2_CSKY_FPU
> +	default "hard"		if BR2_CSKY_FPU

This should be in a separate patch, it's not a change that is directly
related.

>  config BR2_ARCH
>  	default "csky"
> @@ -34,15 +41,15 @@ config BR2_ENDIAN
>  	default "LITTLE"
>  
>  config BR2_GCC_TARGET_CPU
> -	default "ck610"		if (BR2_ck610 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
> -	default "ck807"		if (BR2_ck807 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
> -	default "ck807e"	if (BR2_ck807 && !BR2_CSKY_FPU &&  BR2_CSKY_DSP)
> -	default "ck807f"	if (BR2_ck807 &&  BR2_CSKY_FPU && !BR2_CSKY_DSP)
> -	default "ck807ef"	if (BR2_ck807 &&  BR2_CSKY_FPU &&  BR2_CSKY_DSP)
> -	default "ck810"		if (BR2_ck810 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
> -	default "ck810e"	if (BR2_ck810 && !BR2_CSKY_FPU &&  BR2_CSKY_DSP)
> -	default "ck810f"	if (BR2_ck810 &&  BR2_CSKY_FPU && !BR2_CSKY_DSP)
> -	default "ck810ef"	if (BR2_ck810 &&  BR2_CSKY_FPU &&  BR2_CSKY_DSP)
> +	default "ck610"		if (BR2_ck610 && !BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck807"		if (BR2_ck807 && !BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck807f"	if (BR2_ck807 &&  BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck810"		if (BR2_ck810 && !BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck810f"	if (BR2_ck810 &&  BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck860"		if (BR2_ck860 && !BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck860f"	if (BR2_ck860 &&  BR2_CSKY_FPU && !BR2_CSKY_VDSP)
> +	default "ck860v"	if (BR2_ck860 && !BR2_CSKY_FPU &&  BR2_CSKY_VDSP)
> +	default "ck860fv"	if (BR2_ck860 &&  BR2_CSKY_FPU &&  BR2_CSKY_VDSP)

Perhaps this is becoming too much, and we should adopt a solution
similar to the one in arch/arch.mk.riscv. I.e, drop the
BR2_GCC_TARGET_CPU definition from arch/Config.in.csky, and add a file
arch/arch.mk.csky that contains:

ifeq ($(BR2_csky),y)

ifeq ($(BR2_ck610),y)
GCC_TARGET_CPU := ck610
else ifeq ($(BR2_ck807),y)
GCC_TARGET_CPU := ck807
else ifeq ($(BR2_ck810),y)
GCC_TARGET_CPU := ck810
else ifeq ($(BR2_ck860),y)
GCC_TARGET_CPU := ck860
endif

ifeq ($(BR2_CSKY_FPU),y)
GCC_TARGET_CPU := $(GCC_TARGET_CPU)f
endif

ifeq ($(BR2_CSKY_VDSP),y)
GCC_TARGET_CPU := $(GCC_TARGET_CPU)v
endif

endif

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2019-05-07 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  9:47 [Buildroot] [PATCH 1/3] arch/csky: Add ck860 and vdsp compiler options guoren at kernel.org
2019-05-07  9:47 ` [Buildroot] [PATCH 2/3] arch: Add support for C-SKY toolchain build guoren at kernel.org
2019-05-07 22:54   ` Arnout Vandecappelle
2019-05-08  2:33     ` Guo Ren
2019-05-07  9:47 ` [Buildroot] [PATCH 3/3] configs/qemu_cskyXXX_virt: new defconfig guoren at kernel.org
2019-05-07 12:01 ` Thomas Petazzoni [this message]
2019-05-08  2:31   ` [Buildroot] [PATCH 1/3] arch/csky: Add ck860 and vdsp compiler options Guo Ren

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=20190507140150.7d970503@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.