Skip to contentSkip to conversation

arch/csky: Add VDSP and FLOAT_ABI compiler options.

PATCH New guoren at kernel.org 3 participants 29 messages May 8, 2019 – Jun 6, 2019 C-sky architecture

lore
Share & tools
lore

guoren at kernel.org

author maintainer
#0 lore raw

PATCH v2 1/9 arch/csky: Add VDSP and FLOAT_ABI compiler options.

From: Guo Ren <[email protected]>

We never use BR2_CSKY_DSP in buildroot and we use VDSP instead. For float compiling, we need -mfloat-abi=xxx.

---
 arch/Config.in.csky | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
arch/Config.in.csky +7 -3
index e88e4e2..4622eb9 100644
@@ -23,9 +23,13 @@ config BR2_CSKY_FPU
 	  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
+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
 
 config BR2_ARCH
 	default "csky"
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH v2 1/9 arch/csky: Add VDSP and FLOAT_ABI compiler options.

Ping, Are there any wrong with the patchsets ?

Best Regards
Guo Ren

Quoted 34 lines · guoren at kernel.org

From: Guo Ren <[email protected]>

We never use BR2_CSKY_DSP in buildroot and we use VDSP instead. For float compiling, we need -mfloat-abi=xxx.

---
 arch/Config.in.csky | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
arch/Config.in.csky +7 -3
index e88e4e2..4622eb9 100644
@@ -23,9 +23,13 @@ config BR2_CSKY_FPU
 	  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
+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
 
 config BR2_ARCH
 	default "csky"
Signature · 1 line
2.7.4
author maintainer
#2 lore raw

PATCH v2 2/9 arch/csky: Add ck860 and -mcpu compiler options

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

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

---
 arch/Config.in.csky | 18 +++++-------------
 arch/arch.mk.csky   | 26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 13 deletions(-)
 create mode 100644 arch/arch.mk.csky
arch/Config.in.csky +5 -13
index 4622eb9..e3e183a 100644
@@ -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"
arch/arch.mk.csky new file +26 -0
new file mode 100644
index 0000000..fb59ae2
@@ -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
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 2/9 arch/csky: Add ck860 and -mcpu compiler options

Hello,

Quoted 3 lines · On Wed, 8 May 2019 16:58:28 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

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.

Quoted 13 lines
arch/Config.in.csky +4 -1
+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

arch/Config.in.csky config BR2_CSKY_FPU · line 31

Quoted 5 lines
arch/Config.in.csky +1 -1
@@ -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.

arch/Config.in.csky config BR2_ARCH · line 49

Quoted 10 lines
arch/Config.in.csky +0 -10
-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.

Quoted 16 lines
arch/arch.mk.csky new file +10 -0
new file mode 100644
index 0000000..fb59ae2
@@ -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)

arch/arch.mk.csky line 20

Quoted 10 lines
arch/arch.mk.csky new file +10 -0
+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.

arch/arch.mk.csky line 24

Quoted 3 lines
arch/arch.mk.csky new file +3 -0
+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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#4 lore raw

PATCH v2 2/9 arch/csky: Add ck860 and -mcpu compiler options

Thx Thomas,

Quoted 6 lines · Thomas Petazzoni
Quoted 1 line

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.

Quoted 15 lines
Quoted 15 lines
arch/Config.in.csky +4 -1
+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
 
Quoted 8 lines

arch/Config.in.csky config BR2_CSKY_FPU · line 31

Quoted 4 lines
arch/Config.in.csky +1 -1
 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.

Quoted 13 lines

arch/Config.in.csky config BR2_ARCH · line 49

Quoted 11 lines
arch/Config.in.csky +0 -10
-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.

Quoted 31 lines
Quoted 18 lines
arch/arch.mk.csky new file +10 -0
new file mode 100644
index 0000000..fb59ae2
@@ -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)

arch/arch.mk.csky line 20

Quoted 10 lines
arch/arch.mk.csky new file +10 -0
+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.

Quoted 5 lines

arch/arch.mk.csky line 24

Quoted 3 lines
arch/arch.mk.csky new file +3 -0
+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

author maintainer
#5 lore raw

PATCH v2 3/9 arch/csky: Add toolchain build framework.

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Enable csky buildroot build toolchain in framework.

---
 arch/Config.in      | 1 -
 package/Makefile.in | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
arch/Config.in +0 -1
index d82803c..db1199c 100644
@@ -77,7 +77,6 @@ config BR2_aarch64_be
 
 config BR2_csky
 	bool "csky"
-	select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT
 	select BR2_ARCH_HAS_MMU_MANDATORY
 	help
 	  csky is processor IP from china.
package/Makefile.in +9 -0
index dc818a2..f05b9cc 100644
@@ -70,6 +70,15 @@ ABI := $(ABI)hf
 endif
 endif
 
+# For C-SKY abiv1 & abiv2
+ifeq ($(BR2_csky),y)
+ifeq ($(BR2_ck610),y)
+ABI = abiv1
+else
+ABI = abiv2
+endif
+endif
+
 # For FSL PowerPC there's SPE
 ifeq ($(BR2_powerpc_SPE),y)
 ABI = spe
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 3/9 arch/csky: Add toolchain build framework.

Quoted 15 lines · On Wed, 8 May 2019 16:58:29 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Enable csky buildroot build toolchain in framework.

---
 arch/Config.in      | 1 -
 package/Makefile.in | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
arch/Config.in +0 -0
index d82803c..db1199c 100644

arch/Config.in config BR2_aarch64_be · line 80

Quoted 4 lines
arch/Config.in +0 -1
@@ -77,7 +77,6 @@ config BR2_aarch64_be
 
 config BR2_csky
 	bool "csky"
-	select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT

The ordering is not good: you can't remove this "select" until all the toolchain components have C-SKY support added. So this patch should come later in the series, it should actually be one of the last patch, and should be: "arch/csky: enable internal toolchain backend" or something like that.

Quoted 6 lines
package/Makefile.in +0 -0
index dc818a2..f05b9cc 100644
@@ -70,6 +70,15 @@ ABI := $(ABI)hf
 endif

package/Makefile.in ABI := $(ABI)hf · line 80

Quoted 10 lines
package/Makefile.in +8 -0
 endif
 
+# For C-SKY abiv1 & abiv2
+ifeq ($(BR2_csky),y)
+ifeq ($(BR2_ck610),y)
+ABI = abiv1
+else
+ABI = abiv2
+endif
+endif

This should be a separate patch.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#7 lore raw

PATCH v2 3/9 arch/csky: Add toolchain build framework.

Quoted 19 lines · Thomas Petazzoni
Quoted 16 lines · On Wed, 8 May 2019 16:58:29 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Enable csky buildroot build toolchain in framework.

---
 arch/Config.in      | 1 -
 package/Makefile.in | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
arch/Config.in +0 -0
index d82803c..db1199c 100644
@@ -77,7 +77,6 @@ config BR2_aarch64_be
 
Quoted 9 lines

arch/Config.in config BR2_aarch64_be · line 80

Quoted 3 lines
arch/Config.in +0 -1
 config BR2_csky
 	bool "csky"
-	select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT

The ordering is not good: you can't remove this "select" until all the toolchain components have C-SKY support added. So this patch should come later in the series, it should actually be one of the last patch, and should be: "arch/csky: enable internal toolchain backend" or something like that.

Ok.

Quoted 9 lines
Quoted 9 lines
package/Makefile.in +0 -0
index dc818a2..f05b9cc 100644
@@ -70,6 +70,15 @@ ABI := $(ABI)hf
 endif
 endif
 
Quoted 10 lines

package/Makefile.in ABI := $(ABI)hf · line 80

Quoted 8 lines
package/Makefile.in +8 -0
+# For C-SKY abiv1 & abiv2
+ifeq ($(BR2_csky),y)
+ifeq ($(BR2_ck610),y)
+ABI = abiv1
+else
+ABI = abiv2
+endif
+endif

This should be a separate patch.

Ok.

Best Regards
Guo Ren

author maintainer
#8 lore raw

PATCH v2 4/9 package/binutils: Add C-SKY support

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Add binutils build for C-SKY Architecture.

---
 package/binutils/Config.in.host | 2 ++
 package/binutils/binutils.hash  | 2 ++
 package/binutils/binutils.mk    | 8 ++++++++
 3 files changed, 12 insertions(+)
package/binutils/Config.in.host +2 -0
index c3c3beb..53cd5ce 100644
@@ -5,6 +5,7 @@ config BR2_PACKAGE_HOST_BINUTILS_SUPPORTS_CFI
 	default y
 	depends on !BR2_microblaze
 
+if !BR2_csky
 choice
 	prompt "Binutils Version"
 	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
@@ -32,6 +33,7 @@ config BR2_BINUTILS_VERSION
 	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
 	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
+endif
 
 config BR2_BINUTILS_ENABLE_LTO
 	bool
package/binutils/binutils.hash +2 -0
index 039e368..9f8b419 100644
@@ -5,3 +5,5 @@ sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724a
 
 # Locally calculated (fetched from Github)
 sha512  a96dfcea6064fcd1aac1333ac0d631491bed8b0be9bdcf62f1447909c8f30d2cb8d9323ffeb7c9ad6b326ecddb72e3d28281684e73343189d0a4a37a11aef62f  binutils-gdb-arc-2018.09-release.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
+sha512  979552d4b3a4f31e9f3b9a7027321bd4eb3ac6c2d8deac1720e94e54f81d736db09c53c5d87c301010e307b64127e14400a036c7a35e5d63a954a4edd9cc8e2c  binutils-c66d8bbcebfddf713b2b436e1b135e6b125a55a5.tar.gz
package/binutils/binutils.mk +8 -0
index c70ba13..cebfd06 100644
@@ -20,6 +20,14 @@ BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
 BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
 BINUTILS_FROM_GIT = y
 endif
+
+ifeq ($(BR2_csky),y)
+BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
+BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
+BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
+BINUTILS_FROM_GIT = y
+endif
+
 BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
 BINUTILS_SOURCE ?= binutils-$(BINUTILS_VERSION).tar.xz
 BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_BINUTILS_EXTRA_CONFIG_OPTIONS))
Signature · 1 line
2.7.4
#9 lore raw

PATCH v2 4/9 package/binutils: Add C-SKY support

Hello,

package/binutils/Config.in.host config BR2_BINUTILS_VERSION · line 36

Quoted 9 lines · On Wed, 8 May 2019 16:58:30 +0800 guoren at kernel.org wrote:
package/binutils/Config.in.host +2 -0
+if !BR2_csky
 choice
 	prompt "Binutils Version"
 	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
@@ -32,6 +33,7 @@ config BR2_BINUTILS_VERSION
 	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
 	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
+endif

Let's do it like we do for the ARC architecture: add an option, and the proper depends on. I.e:

choice
prompt "Binutils Version"
default BR2_BINUTILS_VERSION_ARC if BR2_arc default BR2_BINUTILS_VERSION_CSKY if BR2_csky default BR2_BINUTILS_VERSION_2_31_X
help
Select the version of binutils you wish to use.

config BR2_BINUTILS_VERSION_2_30_X
bool "binutils 2.30"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_31_X
bool "binutils 2.31.1"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_32_X
bool "binutils 2.32"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_ARC
bool "binutils arc (2.31)"
depends on BR2_arc

config BR2_BINUTILS_VERSION_CSKY
bool "binutils csky (2.32)"
depends on BR2_csky

endchoice

config BR2_BINUTILS_VERSION

        string
	default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
        default "arc-2019.03-rc1"       if BR2_BINUTILS_VERSION_ARC
        default "2.30"          if BR2_BINUTILS_VERSION_2_30_X
        default "2.31.1"        if BR2_BINUTILS_VERSION_2_31_X
        default "2.32"          if BR2_BINUTILS_VERSION_2_32_X
Quoted 5 lines
package/binutils/binutils.mk +0 -0
index c70ba13..cebfd06 100644

package/binutils/binutils.mk BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb, · line 29

Quoted 10 lines
package/binutils/binutils.mk +7 -0
@@ -20,6 +20,14 @@ BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
 BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
 BINUTILS_FROM_GIT = y
 endif
+
+ifeq ($(BR2_csky),y)
+BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
+BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
+BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
+BINUTILS_FROM_GIT = y
+endif

Same here, please follow the same logic as the one used for ARC, for consistency, i.e:

# Version is set when using buildroot toolchain.
# If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)
BINUTILS_VERSION = arc-2019.03-rc1
else ifeq ($(BR2_csky),y)
BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5 else
BINUTILS_VERSION = 2.31.1
endif
endif # BINUTILS_VERSION

ifeq ($(BINUTILS_VERSION),arc-2019.03-rc1)
BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
else ifeq ($(BINUTILS_VERSION),c66d8bbcebfddf713b2b436e1b135e6b125a55a5) BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
endif

What we're doing for ARC is made not the best, but being consistent in how different architectures do it is much more important.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#10 lore raw

PATCH v2 4/9 package/binutils: Add C-SKY support

Thx Thomas,

Quoted 48 lines · Thomas Petazzoni

Hello,

package/binutils/Config.in.host config BR2_BINUTILS_VERSION · line 36

Quoted 9 lines · On Wed, 8 May 2019 16:58:30 +0800 guoren at kernel.org wrote:
package/binutils/Config.in.host +2 -0
+if !BR2_csky
 choice
 	prompt "Binutils Version"
 	default BR2_BINUTILS_VERSION_2_31_X if !BR2_arc
@@ -32,6 +33,7 @@ config BR2_BINUTILS_VERSION
 	default "2.30"		if BR2_BINUTILS_VERSION_2_30_X
 	default "2.31.1"	if BR2_BINUTILS_VERSION_2_31_X
 	default "2.32"		if BR2_BINUTILS_VERSION_2_32_X
+endif

Let's do it like we do for the ARC architecture: add an option, and the proper depends on. I.e:

choice
prompt "Binutils Version"
default BR2_BINUTILS_VERSION_ARC if BR2_arc default BR2_BINUTILS_VERSION_CSKY if BR2_csky default BR2_BINUTILS_VERSION_2_31_X
help
Select the version of binutils you wish to use.

config BR2_BINUTILS_VERSION_2_30_X
bool "binutils 2.30"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_31_X
bool "binutils 2.31.1"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_2_32_X
bool "binutils 2.32"
depends on !BR2_csky

config BR2_BINUTILS_VERSION_ARC
bool "binutils arc (2.31)"
depends on BR2_arc

config BR2_BINUTILS_VERSION_CSKY
bool "binutils csky (2.32)"
depends on BR2_csky

endchoice

Quoted 7 lines

config BR2_BINUTILS_VERSION

        string
	default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
        default "arc-2019.03-rc1"       if BR2_BINUTILS_VERSION_ARC
        default "2.30"          if BR2_BINUTILS_VERSION_2_30_X
        default "2.31.1"        if BR2_BINUTILS_VERSION_2_31_X
        default "2.32"          if BR2_BINUTILS_VERSION_2_32_X

Ok, nice tips. Thx.

Quoted 43 lines
Quoted 6 lines
package/binutils/binutils.mk +0 -0
index c70ba13..cebfd06 100644

package/binutils/binutils.mk BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb, · line 29

Quoted 10 lines
package/binutils/binutils.mk +7 -0
@@ -20,6 +20,14 @@ BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,
 BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
 BINUTILS_FROM_GIT = y
 endif
+
+ifeq ($(BR2_csky),y)
+BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5
+BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION))
+BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
+BINUTILS_FROM_GIT = y
+endif

Same here, please follow the same logic as the one used for ARC, for consistency, i.e:

# Version is set when using buildroot toolchain.
# If not, we do like other packages BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION)) ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)
BINUTILS_VERSION = arc-2019.03-rc1
else ifeq ($(BR2_csky),y)
BINUTILS_VERSION = c66d8bbcebfddf713b2b436e1b135e6b125a55a5 else
BINUTILS_VERSION = 2.31.1
endif
endif # BINUTILS_VERSION

ifeq ($(BINUTILS_VERSION),arc-2019.03-rc1)
BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
else ifeq ($(BINUTILS_VERSION),c66d8bbcebfddf713b2b436e1b135e6b125a55a5) BINUTILS_SITE = $(call github,c-sky,binutils-gdb,$(BINUTILS_VERSION)) BINUTILS_SOURCE = binutils-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
endif

Quoted 2 lines

What we're doing for ARC is made not the best, but being consistent in how different architectures do it is much more important.

Ok, follow the rules.

Best Regards
Guo Ren

author maintainer
#11 lore raw

PATCH v2 5/9 package/gcc: Add C-SKY support

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Add gcc build for C-SKY Architecture.

---
 package/gcc/Config.in.host | 8 ++++++++
 package/gcc/gcc.hash       | 2 ++
 package/gcc/gcc.mk         | 3 +++
 3 files changed, 13 insertions(+)
package/gcc/Config.in.host +8 -0
index 8e22a4c..c123a84 100644
@@ -3,6 +3,7 @@ comment "GCC Options"
 choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
+	default BR2_GCC_VERSION_CSKY if BR2_csky
 	default BR2_GCC_VERSION_OR1K if BR2_or1k
 	default BR2_GCC_VERSION_7_X
 	help
@@ -14,6 +15,12 @@ config BR2_GCC_VERSION_ARC
 	depends on BR2_arc
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
 
+config BR2_GCC_VERSION_CSKY
+	bool "gcc csky"
+	# Only supported architecture
+	depends on BR2_csky
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_6
+
 config BR2_GCC_VERSION_OR1K
 	bool "gcc or1k (5.x)"
 	# Only supported architecture
@@ -85,6 +92,7 @@ config BR2_GCC_VERSION
 	default "8.3.0"     if BR2_GCC_VERSION_8_X
 	default "arc-2018.09-release" if BR2_GCC_VERSION_ARC
 	default "or1k-musl-5.4.0-20170218" if BR2_GCC_VERSION_OR1K
+	default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY
 
 config BR2_EXTRA_GCC_CONFIG_OPTIONS
 	string "Additional gcc options"
package/gcc/gcc.hash +2 -0
index 4f1e7f9..780484d 100644
@@ -13,3 +13,5 @@ sha512  1811337ae3add9680cec64968a2509d085b6dc5b6783fc1e8c295e3e47416196fd1a3ad8
 sha512  4d12c3ac27b9de9c533be3b8964cf23d21bf6933b5073183e1affe714b0ff33f9d6169e3b55a5c505d7dae33c9bb4f8b0d110461e3a124182d8c8d51b66b8e45  gcc-arc-2018.09-release.tar.gz
 # Locally calculated (fetched from Github)
 sha512  2de7cf47333a4092b02d3bb98f4206f14966f1d139a724d09cf3b22f8a43ae0c704f33e6477d6367a03c29b265480dc900169e9d417006c5d46f0ae446b8c6f1  gcc-or1k-musl-5.4.0-20170218.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/gcc)
+sha512  1c3564fd6573dce13451a73015e7d88fecbb214dc1df96607976255b1d8b9e60318405333f4f218eea8d07e3675a802b66eff6df3921d505c4036481512792c2  gcc-48152afb96c59733d5bc79e3399bb7b3d4b44266.tar.gz
package/gcc/gcc.mk +3 -0
index 5901624..abc29c7 100644
@@ -16,6 +16,9 @@ GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
 else ifeq ($(BR2_or1k),y)
 GCC_SITE = $(call github,openrisc,or1k-gcc,$(GCC_VERSION))
 GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
+else ifeq ($(BR2_csky),y)
+GCC_SITE = $(call github,c-sky,gcc,$(GCC_VERSION))
+GCC_SOURCE = gcc-$(GCC_VERSION).tar.gz
 else
 GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(GCC_VERSION)
 # From version 5.5.0, 6.4.0, 7.2.0 and 8.1.0 a bz2 release tarball is not
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 5/9 package/gcc: Add C-SKY support

Hello,

Quoted 13 lines · On Wed, 8 May 2019 16:58:31 +0800 guoren at kernel.org wrote:
package/gcc/Config.in.host +1 -0
index 8e22a4c..c123a84 100644
@@ -3,6 +3,7 @@ comment "GCC Options"
 choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
+	default BR2_GCC_VERSION_CSKY if BR2_csky
 	default BR2_GCC_VERSION_OR1K if BR2_or1k
 	default BR2_GCC_VERSION_7_X
 	help

package/gcc/Config.in.host config BR2_GCC_VERSION_ARC · line 22

Quoted 8 lines
package/gcc/Config.in.host +5 -0
@@ -14,6 +15,12 @@ config BR2_GCC_VERSION_ARC
 	depends on BR2_arc
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
 
+config BR2_GCC_VERSION_CSKY
+	bool "gcc csky"
+	# Only supported architecture
+	depends on BR2_csky
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_6

I don't see what will prevent me from selecting an upstream gcc 6.x or 7.x for C-SKY here. Are you sure you should not add a bunch of "depends on !BR2_csky" to the other gcc version options ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#13 lore raw

PATCH v2 5/9 package/gcc: Add C-SKY support

Thx,

Quoted 21 lines · Thomas Petazzoni

Hello,

Quoted 16 lines · On Wed, 8 May 2019 16:58:31 +0800 guoren at kernel.org wrote:
package/gcc/Config.in.host +1 -0
index 8e22a4c..c123a84 100644
@@ -3,6 +3,7 @@ comment "GCC Options"
 choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
+	default BR2_GCC_VERSION_CSKY if BR2_csky
 	default BR2_GCC_VERSION_OR1K if BR2_or1k
 	default BR2_GCC_VERSION_7_X
 	help
@@ -14,6 +15,12 @@ config BR2_GCC_VERSION_ARC
 	depends on BR2_arc
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
 
Quoted 9 lines

package/gcc/Config.in.host config BR2_GCC_VERSION_ARC · line 22

Quoted 5 lines
package/gcc/Config.in.host +5 -0
+config BR2_GCC_VERSION_CSKY
+	bool "gcc csky"
+	# Only supported architecture
+	depends on BR2_csky
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_6

I don't see what will prevent me from selecting an upstream gcc 6.x or 7.x for C-SKY here. Are you sure you should not add a bunch of "depends on !BR2_csky" to the other gcc version options ?

Yes, I'll add !BR2_csky to the other gcc version options.

Best Regards
Guo Ren

author maintainer
#14 lore raw

PATCH v2 6/9 package/gdb: Add C-SKY support

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Add gdb build for C-SKY Architecture.

---
 package/gdb/Config.in.host | 1 +
 package/gdb/gdb.hash       | 2 ++
 package/gdb/gdb.mk         | 7 +++++++
 3 files changed, 10 insertions(+)
package/gdb/Config.in.host +1 -0
index 969168f..0aa7d0a 100644
@@ -48,6 +48,7 @@ choice
 	prompt "GDB debugger Version"
 	default BR2_GDB_VERSION_8_1
 	depends on !BR2_arc
+	depends on !BR2_csky
 	help
 	  Select the version of gdb you wish to use.
 
package/gdb/gdb.hash +2 -0
index 1104da5..90a60b0 100644
@@ -6,3 +6,5 @@ sha512  2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5
 
 # Locally calculated (fetched from Github)
 sha512  8303e399e396f5c15dc976e48503fc7d45a720dd1a470443f755c5f2458d092b4392e7ae582abc251bc4b43a778ad784f764286a2a05abfc1649cbeeeb6e7d15 	gdb-arc-2018.09-release-gdb.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
+sha512  c421e1f3c0d6cfb3c04544573c0c4b0075c8d8e3d563c6c234fcc1e4c2167ab203d1e57aec3b58abd348dc46f8cf9b47b753d3a43dba3ea970c9c9a6bd78c07b	gdb-4ecb98fbc2f94dbe01b69384afbc515107de73df.tar.gz
package/gdb/gdb.mk +7 -0
index a926961..460d21f 100644
@@ -14,6 +14,13 @@ GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
 GDB_FROM_GIT = y
 endif
 
+ifeq ($(BR2_csky),y)
+GDB_VERSION = 4ecb98fbc2f94dbe01b69384afbc515107de73df
+GDB_SITE = $(call github,c-sky,binutils-gdb,$(GDB_VERSION))
+GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
+GDB_FROM_GIT = y
+endif
+
 GDB_LICENSE = GPL-2.0+, LGPL-2.0+, GPL-3.0+, LGPL-3.0+
 GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
 
Signature · 1 line
2.7.4
#15 lore raw

PATCH v2 6/9 package/gdb: Add C-SKY support

Hello,

Quoted 3 lines · On Wed, 8 May 2019 16:58:32 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Add gdb build for C-SKY Architecture.

I think this should explain what is supported and not supported:

- Building host-gdb ?

- Building gdbserver for the target ?

- Building full gdb for the target ?

Quoted 13 lines
---
 package/gdb/Config.in.host | 1 +
 package/gdb/gdb.hash       | 2 ++
 package/gdb/gdb.mk         | 7 +++++++
 3 files changed, 10 insertions(+)
package/gdb/Config.in.host +0 -0
index 969168f..0aa7d0a 100644

package/gdb/Config.in.host choice · line 51

Quoted 4 lines
package/gdb/Config.in.host +1 -0
@@ -48,6 +48,7 @@ choice
 	prompt "GDB debugger Version"
 	default BR2_GDB_VERSION_8_1
 	depends on !BR2_arc
+	depends on !BR2_csky

So building host-gdb is not possible ? Which means remote debugging is not possible ?

This seems a bit odd because board/csky/readme.txt precisely suggests to use host-gdb:

../host/bin/csky-linux-gdb -x ../../board/csky/gx6605s/gdbinit vmlinux

Quoted 18 lines
package/gdb/Config.in.host +0 -0
 	help
 	  Select the version of gdb you wish to use.
 
package/gdb/gdb.hash +2 -0
index 1104da5..90a60b0 100644
@@ -6,3 +6,5 @@ sha512  2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5
 
 # Locally calculated (fetched from Github)
 sha512  8303e399e396f5c15dc976e48503fc7d45a720dd1a470443f755c5f2458d092b4392e7ae582abc251bc4b43a778ad784f764286a2a05abfc1649cbeeeb6e7d15 	gdb-arc-2018.09-release-gdb.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
+sha512  c421e1f3c0d6cfb3c04544573c0c4b0075c8d8e3d563c6c234fcc1e4c2167ab203d1e57aec3b58abd348dc46f8cf9b47b753d3a43dba3ea970c9c9a6bd78c07b	gdb-4ecb98fbc2f94dbe01b69384afbc515107de73df.tar.gz
package/gdb/gdb.mk +0 -0
index a926961..460d21f 100644

package/gdb/gdb.mk GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz · line 22

Quoted 9 lines
package/gdb/gdb.mk +6 -0
@@ -14,6 +14,13 @@ GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
 GDB_FROM_GIT = y
 endif
 
+ifeq ($(BR2_csky),y)
+GDB_VERSION = 4ecb98fbc2f94dbe01b69384afbc515107de73df
+GDB_SITE = $(call github,c-sky,binutils-gdb,$(GDB_VERSION))
+GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
+GDB_FROM_GIT = y
+endif

And you confirm you support both gdbserver and full gdb on the target ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#16 lore raw

PATCH v2 6/9 package/gdb: Add C-SKY support

Quoted 9 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · On Wed, 8 May 2019 16:58:32 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Add gdb build for C-SKY Architecture.

Quoted 7 lines

I think this should explain what is supported and not supported:

- Building host-gdb ?

- Building gdbserver for the target ?

- Building full gdb for the target ?

Ok.

Quoted 9 lines
Quoted 9 lines
---
 package/gdb/Config.in.host | 1 +
 package/gdb/gdb.hash       | 2 ++
 package/gdb/gdb.mk         | 7 +++++++
 3 files changed, 10 insertions(+)
Quoted 12 lines

package/gdb/Config.in.host choice · line 51

Quoted 9 lines
package/gdb/Config.in.host +1 -0
index 969168f..0aa7d0a 100644
@@ -48,6 +48,7 @@ choice
 	prompt "GDB debugger Version"
 	default BR2_GDB_VERSION_8_1
 	depends on !BR2_arc
+	depends on !BR2_csky

So building host-gdb is not possible ? Which means remote debugging is not possible ?

No, we could build out host-gdb for remote debugging. Becasue the !BR2_csky just make no BR2_GDB_VERSION_XXX and disable BR2_PACKAGE_GDB_NEEDS_CXX11, BR2_GDB_VERSION.

In gdb.mk we overwrite the GDB_VERSION with a commit version. I'll move the version define in Config.in.host.

Quoted 5 lines

This seems a bit odd because board/csky/readme.txt precisely suggests to use host-gdb:

../host/bin/csky-linux-gdb -x ../../board/csky/gx6605s/gdbinit vmlinux

Package/gdb could build out csky-linux-gdb for remote debug.

Quoted 21 lines
Quoted 21 lines
package/gdb/Config.in.host +0 -0
 	help
 	  Select the version of gdb you wish to use.
 
package/gdb/gdb.hash +2 -0
index 1104da5..90a60b0 100644
@@ -6,3 +6,5 @@ sha512  2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5
 
 # Locally calculated (fetched from Github)
 sha512  8303e399e396f5c15dc976e48503fc7d45a720dd1a470443f755c5f2458d092b4392e7ae582abc251bc4b43a778ad784f764286a2a05abfc1649cbeeeb6e7d15 	gdb-arc-2018.09-release-gdb.tar.gz
+# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
+sha512  c421e1f3c0d6cfb3c04544573c0c4b0075c8d8e3d563c6c234fcc1e4c2167ab203d1e57aec3b58abd348dc46f8cf9b47b753d3a43dba3ea970c9c9a6bd78c07b	gdb-4ecb98fbc2f94dbe01b69384afbc515107de73df.tar.gz
package/gdb/gdb.mk +0 -0
index a926961..460d21f 100644
@@ -14,6 +14,13 @@ GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
 GDB_FROM_GIT = y
 endif
 
Quoted 8 lines

package/gdb/gdb.mk GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz · line 22

Quoted 6 lines
package/gdb/gdb.mk +6 -0
+ifeq ($(BR2_csky),y)
+GDB_VERSION = 4ecb98fbc2f94dbe01b69384afbc515107de73df
+GDB_SITE = $(call github,c-sky,binutils-gdb,$(GDB_VERSION))
+GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
+GDB_FROM_GIT = y
+endif

And you confirm you support both gdbserver and full gdb on the target ?

We could build out gdbserver and host-gdb.

Best Regards
Guo Ren

author maintainer
#17 lore raw

PATCH v2 7/9 package/glibc: Add C-SKY support

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Add glibc build for C-SKY Architecture.

---
 package/glibc/glibc.hash                | 2 ++
 package/glibc/glibc.mk                  | 3 +++
 toolchain/toolchain-buildroot/Config.in | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)
package/glibc/glibc.hash +2 -0
index 5316f03..6e47559 100644
@@ -1,2 +1,4 @@
 # This hash file is not used; instead, update the
 # hash files in the per-version sub-directories.
+# Locally calculated (fetched from https://github.com/c-sky/glibc)
+sha512 9deb2deceefe347d72de13510a5baa3de00f94c684f3b25e136ca3660f61e65a69f2115abb488c2ab0fa93cda8535853ce1e13e186efcc8434ecc4049efd82b5  glibc-7630ed2fa60caea98f500e4a7a51b88f9bf1e176.tar.gz
package/glibc/glibc.mk +3 -0
index 0345f1f..c4ddf8b 100644
@@ -10,6 +10,9 @@ GLIBC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,glibc,$(GLIBC_VE
 else ifeq ($(BR2_RISCV_32),y)
 GLIBC_VERSION = 06983fe52cfe8e4779035c27e8cc5d2caab31531
 GLIBC_SITE = $(call github,riscv,riscv-glibc,$(GLIBC_VERSION))
+else ifeq ($(BR2_csky),y)
+GLIBC_VERSION = 7630ed2fa60caea98f500e4a7a51b88f9bf1e176
+GLIBC_SITE = $(call github,c-sky,glibc,$(GLIBC_VERSION))
 else
 # Generate version string using:
 #   git describe --match 'glibc-*' --abbrev=40 origin/release/MAJOR.MINOR/master | cut -d '-' -f 2-
toolchain/toolchain-buildroot/Config.in +1 -1
index beb17a2..d9f16e2 100644
@@ -48,7 +48,7 @@ config BR2_TOOLCHAIN_BUILDROOT_GLIBC
 		   BR2_powerpc     || BR2_powerpc64  || BR2_powerpc64le || \
 		   BR2_riscv       || BR2_sh         || BR2_sparc64     || \
 		   BR2_x86_64      || BR2_microblaze || BR2_nios2       || \
-		   (BR2_arcle && BR2_ARC_ATOMIC_EXT)
+		   (BR2_arcle && BR2_ARC_ATOMIC_EXT) || BR2_csky
 	depends on BR2_USE_MMU
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
Signature · 1 line
2.7.4
#18 lore raw

PATCH v2 7/9 package/glibc: Add C-SKY support

Hello,

Quoted 16 lines · On Wed, 8 May 2019 16:58:33 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Add glibc build for C-SKY Architecture.

---
 package/glibc/glibc.hash                | 2 ++
 package/glibc/glibc.mk                  | 3 +++
 toolchain/toolchain-buildroot/Config.in | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)
package/glibc/glibc.hash +0 -0
index 5316f03..6e47559 100644

package/glibc/glibc.hash line 2

Quoted 2 lines
package/glibc/glibc.hash +0 -0
@@ -1,2 +1,4 @@
 # This hash file is not used; instead, update the
 # hash files in the per-version sub-directories.

Well, did you see this comment ? If you did, why did you add some hashes to this file ? :-)

package/glibc/glibc.hash line 4

Quoted 2 lines
package/glibc/glibc.hash +2 -0
+# Locally calculated (fetched from https://github.com/c-sky/glibc)
+sha512 9deb2deceefe347d72de13510a5baa3de00f94c684f3b25e136ca3660f61e65a69f2115abb488c2ab0fa93cda8535853ce1e13e186efcc8434ecc4049efd82b5  glibc-7630ed2fa60caea98f500e4a7a51b88f9bf1e176.tar.gz

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#19 lore raw

PATCH v2 7/9 package/glibc: Add C-SKY support

Quoted 16 lines · Thomas Petazzoni

Hello,

Quoted 11 lines · On Wed, 8 May 2019 16:58:33 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Add glibc build for C-SKY Architecture.

---
 package/glibc/glibc.hash                | 2 ++
 package/glibc/glibc.mk                  | 3 +++
 toolchain/toolchain-buildroot/Config.in | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)
Quoted 10 lines

package/glibc/glibc.hash line 2

Quoted 7 lines
package/glibc/glibc.hash +0 -0
index 5316f03..6e47559 100644
@@ -1,2 +1,4 @@
 # This hash file is not used; instead, update the
 # hash files in the per-version sub-directories.

Well, did you see this comment ? If you did, why did you add some hashes to this file ? :-)

Ok, follow the rules.

Best Regards
Guo Ren

author maintainer
#20 lore raw

PATCH v2 8/9 support/config.sub: Add C-SKY support

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Enable gnuconfig for C-SKY Architecutre compiling.

---
 support/gnuconfig/config.sub | 2 ++
 1 file changed, 2 insertions(+)
support/gnuconfig/config.sub +2 -0
index 6d86a1e..45dd0a7 100755
@@ -254,6 +254,7 @@ case $basic_machine in
 	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
+	| csky \
 	| ba \
 	| be32 | be64 \
 	| bfin \
@@ -376,6 +377,7 @@ case $basic_machine in
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| csky-* \
 	| ba-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
Signature · 1 line
2.7.4
#21 lore raw

PATCH v2 8/9 support/config.sub: Add C-SKY support

Hello Guo,

Quoted 8 lines · On Wed, 8 May 2019 16:58:34 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Enable gnuconfig for C-SKY Architecutre compiling.

---
 support/gnuconfig/config.sub | 2 ++
 1 file changed, 2 insertions(+)

I've slightly improved the commit message, and applied to master. I've applied to master and not to next, because this commit is really
important: without it, none of the autotools based packages can build on C-SKY (which is not yet tested in the autobuilders).

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#22 lore raw

PATCH v2 8/9 support/config.sub: Add C-SKY support

Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello Guo,

Quoted 8 lines · On Wed, 8 May 2019 16:58:34 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Enable gnuconfig for C-SKY Architecutre compiling.

---
support/gnuconfig/config.sub | 2 ++

1 file changed, 2 insertions(+)
Quoted 4 lines

I've slightly improved the commit message, and applied to master. I've applied to master and not to next, because this commit is really
important: without it, none of the autotools based packages can build on C-SKY (which is not yet tested in the autobuilders).

I agree that this minimal change is probably the most sensible thing to do for master, but for next it IMHO makes more sense to update our config.sub / config.guess copies, as upstream has gained csky support since:

commit 63b4ce2e8c28aee6a32133e400436e4ca885215a

Author: Mao Han <[email protected]>
Date:   Mon Apr 16 14:46:36 2018 +1000

* config.sub (csky, csky-*): Recognise.
* testsuite/config-sub.data: Add a test case.

Signature · 1 line
Bye, Peter Korsgaard
#23 lore raw

PATCH v2 8/9 support/config.sub: Add C-SKY support

Hello,

Quoted 5 lines · On Tue, 28 May 2019 00:00:35 +0200 Peter Korsgaard <[email protected]> wrote:

I agree that this minimal change is probably the most sensible thing to do for master, but for next it IMHO makes more sense to update our config.sub / config.guess copies, as upstream has gained csky support since:

Quoted 8 lines

commit 63b4ce2e8c28aee6a32133e400436e4ca885215a

Author: Mao Han <[email protected]>
Date:   Mon Apr 16 14:46:36 2018 +1000

* config.sub (csky, csky-*): Recognise.
* testsuite/config-sub.data: Add a test case.

Agreed. I hadn't checked upstream gnuconfig, but it indeed makes a lot of sense to update our gnuconfig copy using the latest upstream version.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#24 lore raw

PATCH v2 8/9 support/config.sub: Add C-SKY support

In reply to Thomas Petazzoni
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello Guo,

Quoted 8 lines · On Wed, 8 May 2019 16:58:34 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Enable gnuconfig for C-SKY Architecutre compiling.

---
support/gnuconfig/config.sub | 2 ++

1 file changed, 2 insertions(+)
Quoted 4 lines

I've slightly improved the commit message, and applied to master. I've applied to master and not to next, because this commit is really
important: without it, none of the autotools based packages can build on C-SKY (which is not yet tested in the autobuilders).

Committed to 2019.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard
author maintainer
#25 lore raw

PATCH v2 9/9 configs/qemu_cskyXXX_virt: new defconfig

In reply to guoren at kernel.org

From: Guo Ren <[email protected]>

Add C-SKY defconfig for QEMU virt machine.

Tested with https://gitlab.com/c-sky/buildroot/pipelines

---
 .gitlab-ci.yml                      |   4 +
 board/qemu/csky/610_defconfig       | 526 +++++++++++++++++++++++++++++++++++
 board/qemu/csky/807_defconfig       | 531 +++++++++++++++++++++++++++++++++++
 board/qemu/csky/810_defconfig       | 531 +++++++++++++++++++++++++++++++++++
 board/qemu/csky/860_defconfig       | 533 ++++++++++++++++++++++++++++++++++++
 configs/qemu_csky610_virt_defconfig |  29 ++
 configs/qemu_csky807_virt_defconfig |  30 ++
 configs/qemu_csky810_virt_defconfig |  30 ++
 configs/qemu_csky860_virt_defconfig |  30 ++
 9 files changed, 2244 insertions(+)
 create mode 100644 board/qemu/csky/610_defconfig
 create mode 100644 board/qemu/csky/807_defconfig
 create mode 100644 board/qemu/csky/810_defconfig
 create mode 100644 board/qemu/csky/860_defconfig
 create mode 100644 configs/qemu_csky610_virt_defconfig
 create mode 100644 configs/qemu_csky807_virt_defconfig
 create mode 100644 configs/qemu_csky810_virt_defconfig
 create mode 100644 configs/qemu_csky860_virt_defconfig
.gitlab-ci.yml +4 -0
index 374dbfe..4fa3473 100644
@@ -248,6 +248,10 @@ qemu_aarch64_virt_defconfig: { extends: .defconfig }
 qemu_arm_versatile_defconfig: { extends: .defconfig }
 qemu_arm_versatile_nommu_defconfig: { extends: .defconfig }
 qemu_arm_vexpress_defconfig: { extends: .defconfig }
+qemu_csky610_virt_defconfig: { extends: .defconfig }
+qemu_csky807_virt_defconfig: { extends: .defconfig }
+qemu_csky810_virt_defconfig: { extends: .defconfig }
+qemu_csky860_virt_defconfig: { extends: .defconfig }
 qemu_m68k_mcf5208_defconfig: { extends: .defconfig }
 qemu_m68k_q800_defconfig: { extends: .defconfig }
 qemu_microblazebe_mmu_defconfig: { extends: .defconfig }
board/qemu/csky/610_defconfig new file +526 -0

526 lines not on this page · raw message

board/qemu/csky/807_defconfig new file +531 -0

531 lines not on this page · raw message

board/qemu/csky/810_defconfig new file +531 -0

531 lines not on this page · raw message

board/qemu/csky/860_defconfig new file +533 -0

533 lines not on this page · raw message

configs/qemu_csky610_virt_defconfig new file +29 -0
new file mode 100644
index 0000000..85b31d1
@@ -0,0 +1,29 @@
+# Architecture
+BR2_csky=y
+BR2_ck610=y
+
+# System
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+# Toolchain
+BR2_OPTIMIZE_2=y
+BR2_SHARED_STATIC_LIBS=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_HOST_GDB=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.0.12"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/csky/610_defconfig"
+
+# Packages on board
+BR2_PACKAGE_LINUX_TOOLS_PERF=y
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_GDB=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_KMOD=y
+BR2_PACKAGE_UTIL_LINUX=y
+BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
configs/qemu_csky807_virt_defconfig new file +30 -0
new file mode 100644
index 0000000..c3247f0
@@ -0,0 +1,30 @@
+# Architecture
+BR2_csky=y
+BR2_ck807=y
+
+# System
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+# Toolchain
+BR2_OPTIMIZE_2=y
+BR2_SHARED_STATIC_LIBS=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_HOST_GDB=y
+BR2_TARGET_OPTIMIZATION="-mbacktrace"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.0.12"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/csky/807_defconfig"
+
+# Packages on board
+BR2_PACKAGE_LINUX_TOOLS_PERF=y
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_GDB=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_KMOD=y
+BR2_PACKAGE_UTIL_LINUX=y
+BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
configs/qemu_csky810_virt_defconfig new file +30 -0
new file mode 100644
index 0000000..acd2be0
@@ -0,0 +1,30 @@
+# Architecture
+BR2_csky=y
+BR2_ck810=y
+
+# System
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+# Toolchain
+BR2_OPTIMIZE_2=y
+BR2_SHARED_STATIC_LIBS=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_HOST_GDB=y
+BR2_TARGET_OPTIMIZATION="-mbacktrace"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.0.12"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/csky/810_defconfig"
+
+# Packages on board
+BR2_PACKAGE_LINUX_TOOLS_PERF=y
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_GDB=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_KMOD=y
+BR2_PACKAGE_UTIL_LINUX=y
+BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
configs/qemu_csky860_virt_defconfig new file +30 -0
new file mode 100644
index 0000000..118ad51
@@ -0,0 +1,30 @@
+# Architecture
+BR2_csky=y
+BR2_ck860=y
+
+# System
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+# Toolchain
+BR2_OPTIMIZE_2=y
+BR2_SHARED_STATIC_LIBS=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+BR2_PACKAGE_HOST_GDB=y
+BR2_TARGET_OPTIMIZATION="-mbacktrace"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.0.12"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/csky/860_defconfig"
+
+# Packages on board
+BR2_PACKAGE_LINUX_TOOLS_PERF=y
+BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
+BR2_PACKAGE_GDB=y
+BR2_PACKAGE_BASH=y
+BR2_PACKAGE_KMOD=y
+BR2_PACKAGE_UTIL_LINUX=y
+BR2_PACKAGE_UTIL_LINUX_LIBBLKID=y
Signature · 1 line
2.7.4
#26 lore raw

PATCH v2 1/9 arch/csky: Add VDSP and FLOAT_ABI compiler options.

In reply to guoren at kernel.org

Hello,

Quoted 3 lines · On Wed, 8 May 2019 16:58:27 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

We never use BR2_CSKY_DSP in buildroot

This is not true, BR2_CSKY_DSP is used:

arch/Config.in.csky:    default "ck610"         if (BR2_ck610 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck807"         if (BR2_ck807 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck807e"        if (BR2_ck807 && !BR2_CSKY_FPU &&  BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck807f"        if (BR2_ck807 &&  BR2_CSKY_FPU && !BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck807ef"       if (BR2_ck807 &&  BR2_CSKY_FPU &&  BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck810"         if (BR2_ck810 && !BR2_CSKY_FPU && !BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck810e"        if (BR2_ck810 && !BR2_CSKY_FPU &&  BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck810f"        if (BR2_ck810 &&  BR2_CSKY_FPU && !BR2_CSKY_DSP)
arch/Config.in.csky:    default "ck810ef"       if (BR2_ck810 &&  BR2_CSKY_FPU &&  BR2_CSKY_DSP)

so as such, your patch is incorrect: you remove an option, but the option is still being used.

If this option is not needed because in fact the DSP enhanced instructions have never been used, then please have a patch that *ONLY* removes the BR2_CSKY_DSP option (both its definition and where it is used).

Then another patch that adds the BR2_CSKY_VDSP option.

And finally another that sets the BR2_GCC_TARGET_FLOAT_ABI value.

All of these topics are independent from each other, they should be in separate patches.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#27 lore raw

PATCH v2 1/9 arch/csky: Add VDSP and FLOAT_ABI compiler options.

In reply to guoren at kernel.org

arch/Config.in.csky config BR2_CSKY_FPU · line 28

Quoted 3 lines · On Wed, 8 May 2019 16:58:27 +0800 guoren at kernel.org wrote:
arch/Config.in.csky +3 -0
+config BR2_CSKY_VDSP
+	bool "Enable VDSP 3.0 enhanced instructions Co-processor"
+	depends on BR2_ck860

Another comment: you add an option that depends on BR2_ck860 in this PATCH 1, but BR2_ck860 is only added in PATCH 2. This is not correct.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#28 lore raw

PATCH v2 1/9 arch/csky: Add VDSP and FLOAT_ABI compiler options.

Quoted 10 lines · Thomas Petazzoni

arch/Config.in.csky config BR2_CSKY_FPU · line 28

Quoted 3 lines · On Wed, 8 May 2019 16:58:27 +0800 guoren at kernel.org wrote:
arch/Config.in.csky +3 -0
+config BR2_CSKY_VDSP
+     bool "Enable VDSP 3.0 enhanced instructions Co-processor"
+     depends on BR2_ck860

Another comment: you add an option that depends on BR2_ck860 in this PATCH 1, but BR2_ck860 is only added in PATCH 2. This is not correct.

Yes, BR2_ck860 should be first in patch.

Best Regards
Guo Ren