diff mbox series

[V2,2/9] arch/csky: Add ck860 and -mcpu compiler options

Message ID 1557305915-11247-2-git-send-email-guoren@kernel.org
State Changes Requested
Headers show
Series [V2,1/9] arch/csky: Add VDSP and FLOAT_ABI compiler options. | expand

Commit Message

Guo Ren May 8, 2019, 8:58 a.m. UTC
From: Guo Ren <ren_guo@c-sky.com>

Add ck860 support and move -mcpu into arch.mk.csky.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
---
 arch/Config.in.csky | 18 +++++-------------
 arch/arch.mk.csky   | 26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 13 deletions(-)
 create mode 100644 arch/arch.mk.csky

Comments

Thomas Petazzoni May 26, 2019, 8:43 p.m. UTC | #1
Hello,

On Wed,  8 May 2019 16:58:28 +0800
guoren@kernel.org wrote:

> From: Guo Ren <ren_guo@c-sky.com>
> 
> Add ck860 support and move -mcpu into arch.mk.csky.

Adding ck860 support and moving -mcpu handling in arch.mk.csky are two
independent things. Please make the move to arch.mk.csky first without
ck860, as a cleanup, in a first patch, and then another patch does the
addition of ck860 support.

> +config BR2_ck860
> +	bool "ck860"
> +
>  endchoice
>  
>  config BR2_CSKY_FPU
>  	bool "Enable FPU coprocessor"
> -	depends on BR2_ck810 || BR2_ck807
> +	depends on BR2_ck810 || BR2_ck807 || 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
> @@ -25,7 +28,7 @@ config BR2_CSKY_FPU
>  
>  config BR2_CSKY_VDSP
>  	bool "Enable VDSP 3.0 enhanced instructions Co-processor"
> -	depends on BR2_ck860
> +	depends on BR2_CSKY_FPU

So in PATCH 1, VDSP is only for CK860, but now it's for all cores that
have a FPU, which includes CK810 and CK807. It should be consistent
from the start, i.e from the point where VDSP is introduced.

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

This should go to the patch cleaning up the logic to use arch.mk.csky.


> diff --git a/arch/arch.mk.csky b/arch/arch.mk.csky
> new file mode 100644
> index 0000000..fb59ae2
> --- /dev/null
> +++ b/arch/arch.mk.csky
> @@ -0,0 +1,26 @@
> +#
> +# Configure the GCC_TARGET_ARCH variable and append the
> +# appropriate C-SKY ISA extensions.
> +#
> +
> +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

Same.

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

This should go to the patch adding the BR2_CSKY_VDSP option.

Best regards,

Thomas
Guo Ren May 27, 2019, 6:43 a.m. UTC | #2
Thx Thomas,

On Sun, May 26, 2019 at 10:43:36PM +0200, Thomas Petazzoni wrote:
> > Add ck860 support and move -mcpu into arch.mk.csky.
> 
> Adding ck860 support and moving -mcpu handling in arch.mk.csky are two
> independent things. Please make the move to arch.mk.csky first without
> ck860, as a cleanup, in a first patch, and then another patch does the
> addition of ck860 support.
Ok.

> 
> > +config BR2_ck860
> > +	bool "ck860"
> > +
> >  endchoice
> >  
> >  config BR2_CSKY_FPU
> >  	bool "Enable FPU coprocessor"
> > -	depends on BR2_ck810 || BR2_ck807
> > +	depends on BR2_ck810 || BR2_ck807 || 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
> > @@ -25,7 +28,7 @@ config BR2_CSKY_FPU
> >  
> >  config BR2_CSKY_VDSP
> >  	bool "Enable VDSP 3.0 enhanced instructions Co-processor"
> > -	depends on BR2_ck860
> > +	depends on BR2_CSKY_FPU
> 
> So in PATCH 1, VDSP is only for CK860, but now it's for all cores that
> have a FPU, which includes CK810 and CK807. It should be consistent
> from the start, i.e from the point where VDSP is introduced.
Ok, I'll made a independent patch for VDSP introduce.

> 
> > -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)
> 
> This should go to the patch cleaning up the logic to use arch.mk.csky.
Ok.

> 
> 
> > diff --git a/arch/arch.mk.csky b/arch/arch.mk.csky
> > new file mode 100644
> > index 0000000..fb59ae2
> > --- /dev/null
> > +++ b/arch/arch.mk.csky
> > @@ -0,0 +1,26 @@
> > +#
> > +# Configure the GCC_TARGET_ARCH variable and append the
> > +# appropriate C-SKY ISA extensions.
> > +#
> > +
> > +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
> 
> Same.
> 
> > +ifeq ($(BR2_CSKY_VDSP),y)
> > +GCC_TARGET_CPU := $(GCC_TARGET_CPU)v
> > +endif
> 
> This should go to the patch adding the BR2_CSKY_VDSP option.
Yes.

Best Regards
 Guo Ren
diff mbox series

Patch

diff --git a/arch/Config.in.csky b/arch/Config.in.csky
index 4622eb9..e3e183a 100644
--- a/arch/Config.in.csky
+++ b/arch/Config.in.csky
@@ -13,11 +13,14 @@  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_ck810 || BR2_ck807 || 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
@@ -25,7 +28,7 @@  config BR2_CSKY_FPU
 
 config BR2_CSKY_VDSP
 	bool "Enable VDSP 3.0 enhanced instructions Co-processor"
-	depends on BR2_ck860
+	depends on BR2_CSKY_FPU
 
 config BR2_GCC_TARGET_FLOAT_ABI
 	default "soft"		if !BR2_CSKY_FPU
@@ -37,16 +40,5 @@  config BR2_ARCH
 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)
-
 config BR2_READELF_ARCH_NAME
 	default "CSKY"
diff --git a/arch/arch.mk.csky b/arch/arch.mk.csky
new file mode 100644
index 0000000..fb59ae2
--- /dev/null
+++ b/arch/arch.mk.csky
@@ -0,0 +1,26 @@ 
+#
+# Configure the GCC_TARGET_ARCH variable and append the
+# appropriate C-SKY ISA extensions.
+#
+
+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