All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
@ 2019-04-16  7:25 Nylon Chen
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32) Nylon Chen
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Nylon Chen @ 2019-04-16  7:25 UTC (permalink / raw)
  To: buildroot

v5:
    1) add toolchain-external-andes-nds32/*
    2) add autobuild configs support

v4:
    1) removed BR2_ANDES_NDS32_FPU option
    2) removed test the Andes nds32 toolchain patch

Nylon Chen (4):
  arch: add support for Andes 32-bit(nds32)
  configs/andes_nds32_ae3xx: new defconfig
  toolchain-external-andes-nds32: new package
  support/config-fragments/autobuild: test the Andes nds32 toolchain

 DEVELOPERS                                    |  6 +++
 arch/Config.in                                | 12 +++++
 arch/Config.in.nds32                          | 11 +++++
 board/andes/ae3xx/ae3xx.fragment              |  1 +
 ...0001-nds32-Fix-boot-messages-garbled.patch | 28 +++++++++++
 board/andes/readme.txt                        | 49 +++++++++++++++++++
 configs/andes_ae3xx_defconfig                 | 14 ++++++
 .../autobuild/andes-nds32.config              |  3 ++
 .../autobuild/toolchain-configs.csv           |  1 +
 toolchain/toolchain-external/Config.in        |  3 ++
 .../toolchain-external-andes-nds32/Config.in  |  9 ++++
 .../Config.in.options                         | 14 ++++++
 .../toolchain-external-andes-nds.hash         |  2 +
 .../toolchain-external-andes-nds.mk           | 10 ++++
 14 files changed, 163 insertions(+)
 create mode 100644 arch/Config.in.nds32
 create mode 100644 board/andes/ae3xx/ae3xx.fragment
 create mode 100644 board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch
 create mode 100644 board/andes/readme.txt
 create mode 100644 configs/andes_ae3xx_defconfig
 create mode 100644 support/config-fragments/autobuild/andes-nds32.config
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk

-- 
2.18.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32)
  2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
@ 2019-04-16  7:25 ` Nylon Chen
  2019-04-17  7:49   ` Thomas Petazzoni
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig Nylon Chen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Nylon Chen @ 2019-04-16  7:25 UTC (permalink / raw)
  To: buildroot

This commit provides basic support for the Andes 32-bit(nds32) architecture.

Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
---
 DEVELOPERS           |  3 +++
 arch/Config.in       | 12 ++++++++++++
 arch/Config.in.nds32 | 11 +++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 arch/Config.in.nds32

diff --git a/DEVELOPERS b/DEVELOPERS
index 4927be926d..f4f842e61d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1665,6 +1665,9 @@ F:	package/trousers/
 N:	Norbert Lange <nolange79@gmail.com>
 F:	package/tcf-agent/
 
+N:	Nylon Chen <nylon7@andestech.com>
+F:	arch/Config.in.nds32
+
 N:	Olaf Rempel <razzor@kopf-tisch.de>
 F:	package/ctorrent/
 
diff --git a/arch/Config.in b/arch/Config.in
index f50760a0cf..d82803c828 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -154,6 +154,14 @@ config BR2_mips64el
 	  http://www.mips.com/
 	  http://en.wikipedia.org/wiki/MIPS_Technologies
 
+config BR2_nds32
+	bool "nds32"
+	select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT
+	select BR2_ARCH_HAS_MMU_MANDATORY
+	help
+	  nds32 is a 32-bit architecture developed by Andes Technology.
+	  https://en.wikipedia.org/wiki/Andes_Technology
+
 config BR2_nios2
 	bool "Nios II"
 	select BR2_ARCH_HAS_MMU_MANDATORY
@@ -419,6 +427,10 @@ if BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el
 source "arch/Config.in.mips"
 endif
 
+if BR2_nds32
+source "arch/Config.in.nds32"
+endif
+
 if BR2_nios2
 source "arch/Config.in.nios2"
 endif
diff --git a/arch/Config.in.nds32 b/arch/Config.in.nds32
new file mode 100644
index 0000000000..9c5db20e6f
--- /dev/null
+++ b/arch/Config.in.nds32
@@ -0,0 +1,11 @@
+config BR2_ARCH
+	default "nds32"
+
+config BR2_GCC_TARGET_ARCH
+	default "v3"
+
+config BR2_ENDIAN
+	default "LITTLE"
+
+config BR2_READELF_ARCH_NAME
+	default "Andes Technology compact code size embedded RISC processor family"
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig
  2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32) Nylon Chen
@ 2019-04-16  7:25 ` Nylon Chen
  2019-04-17  7:53   ` Thomas Petazzoni
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package Nylon Chen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Nylon Chen @ 2019-04-16  7:25 UTC (permalink / raw)
  To: buildroot

Add Andes 32-bit defconfig for AE3XX platform.

Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
---
 DEVELOPERS                                    |  2 +
 board/andes/ae3xx/ae3xx.fragment              |  1 +
 ...0001-nds32-Fix-boot-messages-garbled.patch | 28 +++++++++++
 board/andes/readme.txt                        | 49 +++++++++++++++++++
 configs/andes_ae3xx_defconfig                 | 14 ++++++
 5 files changed, 94 insertions(+)
 create mode 100644 board/andes/ae3xx/ae3xx.fragment
 create mode 100644 board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch
 create mode 100644 board/andes/readme.txt
 create mode 100644 configs/andes_ae3xx_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index f4f842e61d..f053a34922 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1667,6 +1667,8 @@ F:	package/tcf-agent/
 
 N:	Nylon Chen <nylon7@andestech.com>
 F:	arch/Config.in.nds32
+F:	board/andes
+F:	configs/andes_ae3xx_defconfig
 
 N:	Olaf Rempel <razzor@kopf-tisch.de>
 F:	package/ctorrent/
diff --git a/board/andes/ae3xx/ae3xx.fragment b/board/andes/ae3xx/ae3xx.fragment
new file mode 100644
index 0000000000..3b13d10740
--- /dev/null
+++ b/board/andes/ae3xx/ae3xx.fragment
@@ -0,0 +1 @@
+CONFIG_NDS32_BUILTIN_DTB="ae3xx"
diff --git a/board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch b/board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch
new file mode 100644
index 0000000000..adb60937bd
--- /dev/null
+++ b/board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch
@@ -0,0 +1,28 @@
+From 90d52d180dcc5d1300dc352ca709eb6453894143 Mon Sep 17 00:00:00 2001
+From: Nylon Chen <nylon7@andestech.com>
+Date: Wed, 28 Nov 2018 16:26:46 +0800
+Subject: [PATCH] nds32: Fix boot messages garbled
+
+In order to display uart correctly we have to pass the correct setting of uart to kernel by bootarg.
+This patch will provide such settings to set the correct uart baud rate.
+
+Signed-off-by: Nylon Chen <nylon7@andestech.com>
+---
+ arch/nds32/boot/dts/ae3xx.dts | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/nds32/boot/dts/ae3xx.dts b/arch/nds32/boot/dts/ae3xx.dts
+index bb39749a6673..aefe2090926a 100644
+--- a/arch/nds32/boot/dts/ae3xx.dts
++++ b/arch/nds32/boot/dts/ae3xx.dts
+@@ -6,6 +6,7 @@
+ 	interrupt-parent = <&intc>;
+ 
+ 	chosen {
++		bootargs = "memblock=debug earlycon console=ttyS0,38400n8 debug loglevel=7";
+ 		stdout-path = &serial0;
+ 	};
+ 
+-- 
+2.18.0
+
diff --git a/board/andes/readme.txt b/board/andes/readme.txt
new file mode 100644
index 0000000000..0f95c65549
--- /dev/null
+++ b/board/andes/readme.txt
@@ -0,0 +1,49 @@
+Intro
+=====
+
+Andestech(nds32) AE3XX Platform
+
+The AE3XX prototype demonstrates the AE3XX example platform on the FPGA. 
+It is composed of one Andestech(nds32) processor and AE3XX.
+
+How to build it
+===============
+
+Configure Buildroot
+-------------------
+
+The andes_ae3xx_defconfig configuration is a sample configuration with
+all that is required to bring the FPGA Development Board:
+
+  $ make andes_ae3xx_defconfig
+
+Build everything
+----------------
+Note: you will need to have access to the network, since Buildroot will
+download the packages' sources.
+
+  $ make
+
+Result of the build
+-------------------
+
+After building, you should obtain this tree:
+
+output/images/
+    +-- vmlinux
+    +-- rootfs.cpio
+    +-- rootfs.tar
+
+How to run it
+=============
+
+Run
+---
+
+  Setup the Console with the rate 38400/8-N-1.
+
+  $ cd output/images
+  $ ../host/bin/nds32le-linux-gdb vmlinux
+  $ target remote [your host]
+  $ lo
+  $ c 
diff --git a/configs/andes_ae3xx_defconfig b/configs/andes_ae3xx_defconfig
new file mode 100644
index 0000000000..250e3ee157
--- /dev/null
+++ b/configs/andes_ae3xx_defconfig
@@ -0,0 +1,14 @@
+BR2_nds32=y
+BR2_GLOBAL_PATCH_DIR="board/andes/patches/"
+BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz"
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="nds32le-linux"
+BR2_TOOLCHAIN_EXTERNAL_GCC_8=y
+BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_17=y
+BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.17"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/andes/ae3xx/ae3xx.fragment"
+BR2_TARGET_ROOTFS_INITRAMFS=y
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package
  2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32) Nylon Chen
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig Nylon Chen
@ 2019-04-16  7:25 ` Nylon Chen
  2019-04-17  7:52   ` Thomas Petazzoni
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain Nylon Chen
  2019-04-17 19:22 ` [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Thomas Petazzoni
  4 siblings, 1 reply; 12+ messages in thread
From: Nylon Chen @ 2019-04-16  7:25 UTC (permalink / raw)
  To: buildroot

This commit adds a new package for the Andes external toolchain for
the nds32 Little Endian architecture.

https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz

Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
---
 DEVELOPERS                                         |  1 +
 toolchain/toolchain-external/Config.in             |  3 +++
 .../toolchain-external-andes-nds32/Config.in       |  9 +++++++++
 .../Config.in.options                              | 14 ++++++++++++++
 .../toolchain-external-andes-nds.hash              |  2 ++
 .../toolchain-external-andes-nds.mk                | 10 ++++++++++
 6 files changed, 39 insertions(+)
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash
 create mode 100644 toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f053a34922..0bb3ad128e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1669,6 +1669,7 @@ N:	Nylon Chen <nylon7@andestech.com>
 F:	arch/Config.in.nds32
 F:	board/andes
 F:	configs/andes_ae3xx_defconfig
+F:	toolchain/toolchain-external/toolchain-external-andes-nds32/
 
 N:	Olaf Rempel <razzor@kopf-tisch.de>
 F:	package/ctorrent/
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 1f14f0350a..5135168890 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -124,6 +124,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-aarch64-be/Config
 # ARC
 source "toolchain/toolchain-external/toolchain-external-synopsys-arc/Config.in.options"
 
+# Andes
+source "toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options"
+
 # ARM
 source "toolchain/toolchain-external/toolchain-external-arm-arm/Config.in.options"
 source "toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in.options"
diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
new file mode 100644
index 0000000000..af57d6cd06
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
@@ -0,0 +1,9 @@
+config BR2_TOOLCHAIN_EXTERNAL_ANDES_NDS32
+	depends on BR2_nds32
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
+	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
+	help
+	  nds32 toolchain for the nds32 architecture. It uses GCC 8.2.1,
+	  GDB 8.1.1, glibc 2.28, Binutils 2.30. It generates code that
+	  runs on ae3xx platform
diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
new file mode 100644
index 0000000000..3632e59564
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
@@ -0,0 +1,14 @@
+if BR2_TOOLCHAIN_EXTERNAL_ANDES_NDS32
+
+config BR2_TOOLCHAIN_EXTERNAL_PREFIX
+	default "nds32le-linux"
+
+config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
+	default "toolchain-external-andes-nds32"
+
+config BR2_TOOLCHAIN_EXTERNAL_URL
+	string "Toolchain URL"
+	depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+	help
+	  URL of the custom toolchain tarball to download and install.
+endif
diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash
new file mode 100644
index 0000000000..4314bb1f55
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash
@@ -0,0 +1,2 @@
+# From https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz
+sha256 6050601df85ad93a4c211c1d57ed3773edb62aa505f7e07d7d555652e83af2cc  nds32le-linux-glibc-v3-upstream.tar.gz
diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk
new file mode 100644
index 0000000000..c0df49e716
--- /dev/null
+++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk
@@ -0,0 +1,10 @@
+################################################################################
+#
+# toolchain-external-andes-nds32
+#
+################################################################################
+TOOLCHAIN_EXTERNAL_ANDES_NDS32_SITE = https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/$(TOOLCHAIN_EXTERNAL_ANDES_NDS32_SOURCE)
+TOOLCHAIN_EXTERNAL_ANDES_NDS32_SOURCE = nds32le-linux-glibc-v3-upstream.tar.gz
+
+$(eval $(toolchain-external-package))
+
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain
  2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
                   ` (2 preceding siblings ...)
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package Nylon Chen
@ 2019-04-16  7:25 ` Nylon Chen
  2019-04-17  7:53   ` Thomas Petazzoni
  2019-04-17 19:22 ` [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Thomas Petazzoni
  4 siblings, 1 reply; 12+ messages in thread
From: Nylon Chen @ 2019-04-16  7:25 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
---
 support/config-fragments/autobuild/andes-nds32.config    | 3 +++
 support/config-fragments/autobuild/toolchain-configs.csv | 1 +
 2 files changed, 4 insertions(+)
 create mode 100644 support/config-fragments/autobuild/andes-nds32.config

diff --git a/support/config-fragments/autobuild/andes-nds32.config b/support/config-fragments/autobuild/andes-nds32.config
new file mode 100644
index 0000000000..541677e002
--- /dev/null
+++ b/support/config-fragments/autobuild/andes-nds32.config
@@ -0,0 +1,3 @@
+BR2_nds32=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TOOLCHAIN_EXTERNAL_ANDES_NDS32=y
diff --git a/support/config-fragments/autobuild/toolchain-configs.csv b/support/config-fragments/autobuild/toolchain-configs.csv
index 60ce1a9786..15a69d60ee 100644
--- a/support/config-fragments/autobuild/toolchain-configs.csv
+++ b/support/config-fragments/autobuild/toolchain-configs.csv
@@ -22,6 +22,7 @@ support/config-fragments/autobuild/br-arm-full-static.config,x86_64
 support/config-fragments/autobuild/sourcery-arm.config,x86
 
 # Toolchains used by test-pkg only when the '-a' option is passed:
+support/config-fragments/autobuild/andes-nds32.config,x86
 support/config-fragments/autobuild/arm-aarch64.config,x86_64
 support/config-fragments/autobuild/br-aarch64-glibc.config,x86_64
 support/config-fragments/autobuild/br-arc-full-internal.config,any
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32)
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32) Nylon Chen
@ 2019-04-17  7:49   ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-17  7:49 UTC (permalink / raw)
  To: buildroot

On Tue, 16 Apr 2019 15:25:42 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> This commit provides basic support for the Andes 32-bit(nds32) architecture.
> 
> Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
> Signed-off-by: Greentime Hu <greentime@andestech.com>
> Signed-off-by: Nylon Chen <nylon7@andestech.com>
> ---
>  DEVELOPERS           |  3 +++
>  arch/Config.in       | 12 ++++++++++++
>  arch/Config.in.nds32 | 11 +++++++++++
>  3 files changed, 26 insertions(+)
>  create mode 100644 arch/Config.in.nds32

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package Nylon Chen
@ 2019-04-17  7:52   ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-17  7:52 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 16 Apr 2019 15:25:44 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> This commit adds a new package for the Andes external toolchain for
> the nds32 Little Endian architecture.
> 
> https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz
> 
> Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
> Signed-off-by: Greentime Hu <greentime@andestech.com>
> Signed-off-by: Nylon Chen <nylon7@andestech.com>

First of all, this patch should have been *before* the defconfig patch,
and the defconfig should have used this external toolchain package.

In addition, this patch had many problems. It was clearly not tested
properly, see below for the details.

> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index 1f14f0350a..5135168890 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -124,6 +124,9 @@ source "toolchain/toolchain-external/toolchain-external-linaro-aarch64-be/Config
>  # ARC
>  source "toolchain/toolchain-external/toolchain-external-synopsys-arc/Config.in.options"
>  
> +# Andes
> +source "toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options"

You forgot to also include the Config.in file, so the toolchain could
not be visible in menuconfig.

> diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
> new file mode 100644
> index 0000000000..af57d6cd06
> --- /dev/null
> +++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_TOOLCHAIN_EXTERNAL_ANDES_NDS32

This was missing:

	bool "Andes nds32"

so that the toolchain has a visible option.

> +	depends on BR2_nds32
> +	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
> +	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
> +	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17

The toolchain provides RPC and SSP support, so this is missing:

	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
	select BR2_TOOLCHAIN_HAS_SSP

> diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
> new file mode 100644
> index 0000000000..3632e59564
> --- /dev/null
> +++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/Config.in.options
> @@ -0,0 +1,14 @@
> +if BR2_TOOLCHAIN_EXTERNAL_ANDES_NDS32
> +
> +config BR2_TOOLCHAIN_EXTERNAL_PREFIX
> +	default "nds32le-linux"
> +
> +config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
> +	default "toolchain-external-andes-nds32"
> +
> +config BR2_TOOLCHAIN_EXTERNAL_URL
> +	string "Toolchain URL"
> +	depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
> +	help
> +	  URL of the custom toolchain tarball to download and install.

This option is totally unnecessary, the toolchain URL is defined in
the .mk and should not be configurable.

> diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash

This file should have been named toolchain-external-andes-nds32.hash to
match the package name.

> new file mode 100644
> index 0000000000..4314bb1f55
> --- /dev/null
> +++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.hash
> @@ -0,0 +1,2 @@
> +# From https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz
> +sha256 6050601df85ad93a4c211c1d57ed3773edb62aa505f7e07d7d555652e83af2cc  nds32le-linux-glibc-v3-upstream.tar.gz
> diff --git a/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk

This file should have been named toolchain-external-andes-nds32.mk to
match the package name.

> new file mode 100644
> index 0000000000..c0df49e716
> --- /dev/null
> +++ b/toolchain/toolchain-external/toolchain-external-andes-nds32/toolchain-external-andes-nds.mk
> @@ -0,0 +1,10 @@
> +################################################################################
> +#
> +# toolchain-external-andes-nds32
> +#
> +################################################################################

Missing empty line here.

> +TOOLCHAIN_EXTERNAL_ANDES_NDS32_SITE = https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/$(TOOLCHAIN_EXTERNAL_ANDES_NDS32_SOURCE)

This URL is wrong, as it finishes with the file name, while it should
not. The download clearly doesn't work with this.

> +TOOLCHAIN_EXTERNAL_ANDES_NDS32_SOURCE = nds32le-linux-glibc-v3-upstream.tar.gz
> +
> +$(eval $(toolchain-external-package))
> +

This empty line at the end of the file was causing a check-package
warning.

I fixed all those issues and applied the patch. Thanks!

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig Nylon Chen
@ 2019-04-17  7:53   ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-17  7:53 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 16 Apr 2019 15:25:43 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> Add Andes 32-bit defconfig for AE3XX platform.
> 
> Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
> Signed-off-by: Greentime Hu <greentime@andestech.com>
> Signed-off-by: Nylon Chen <nylon7@andestech.com>

The commit title was not matching the name of the defconfig file being
added, so I fixed that up.

> diff --git a/configs/andes_ae3xx_defconfig b/configs/andes_ae3xx_defconfig
> new file mode 100644
> index 0000000000..250e3ee157
> --- /dev/null
> +++ b/configs/andes_ae3xx_defconfig
> @@ -0,0 +1,14 @@
> +BR2_nds32=y
> +BR2_GLOBAL_PATCH_DIR="board/andes/patches/"
> +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz"
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="nds32le-linux"
> +BR2_TOOLCHAIN_EXTERNAL_GCC_8=y
> +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_17=y
> +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y

This should have used the external toolchain package that you added, so
I fixed that as well.

Applied with those two issues fixed.

Best regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain Nylon Chen
@ 2019-04-17  7:53   ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-17  7:53 UTC (permalink / raw)
  To: buildroot

On Tue, 16 Apr 2019 15:25:45 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> Signed-off-by: Che-Wei Chuang <cnoize@andestech.com>
> Signed-off-by: Greentime Hu <greentime@andestech.com>
> Signed-off-by: Nylon Chen <nylon7@andestech.com>
> ---
>  support/config-fragments/autobuild/andes-nds32.config    | 3 +++
>  support/config-fragments/autobuild/toolchain-configs.csv | 1 +
>  2 files changed, 4 insertions(+)
>  create mode 100644 support/config-fragments/autobuild/andes-nds32.config

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
  2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
                   ` (3 preceding siblings ...)
  2019-04-16  7:25 ` [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain Nylon Chen
@ 2019-04-17 19:22 ` Thomas Petazzoni
  2019-04-18  8:39   ` Nylon Chen
  4 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-17 19:22 UTC (permalink / raw)
  To: buildroot

Hello Nylon,

On Tue, 16 Apr 2019 15:25:41 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> Nylon Chen (4):
>   arch: add support for Andes 32-bit(nds32)
>   configs/andes_nds32_ae3xx: new defconfig
>   toolchain-external-andes-nds32: new package
>   support/config-fragments/autobuild: test the Andes nds32 toolchain

Following the merge of the nds32 architecture, two types of build
failures started to appear:

 - The target binutils package failed to build, because binutils does
   not yet have support for nds32. I tried with the latest binutils
   release, 2.32, and it was the same. So for now, I have disabled
   binutils on nds32. However, in binutils source, I see that
   bfd/elf-nds32.c is present, so there at least the beginning of some
   support. Could you comment on the status of nds32 support in
   binutils upstream ?

   Build failure: http://autobuild.buildroot.net/results/1b1/1b18acb11db4d6c4198deb7385aff3d4d524c37e/build-end.log
   Commit to disable binutils on nds32: https://git.buildroot.org/buildroot/commit/?id=b45a703078e6f3be096f24ac63848490d32d0d29

 - The libffi library does not have support for nds32 as well, so I
   made sure that we don't try to build configurations that include
   libffi on nds32. Are you planning on adding nds32 support to libffi
   upstream ?

   Build failure: http://autobuild.buildroot.net/results/128/12803a705586e82fdfb49013da2eb3b9879ccd45/build-end.log
   Commit to disable libffi on nds32: https://git.buildroot.org/buildroot/commit/?id=2e1f98d9509d869352080331e168abe5f1452e1a

Best regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
  2019-04-17 19:22 ` [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Thomas Petazzoni
@ 2019-04-18  8:39   ` Nylon Chen
  2019-04-18  9:00     ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Nylon Chen @ 2019-04-18  8:39 UTC (permalink / raw)
  To: buildroot

Hello Thomas:

Thanks for your question
On Thu, Apr 18, 2019 at 03:22:09AM +0800, Thomas Petazzoni wrote:
> Hello Nylon,
> 
> On Tue, 16 Apr 2019 15:25:41 +0800
> Nylon Chen <nylon7@andestech.com> wrote:
> 
> > Nylon Chen (4):
> >   arch: add support for Andes 32-bit(nds32)
> >   configs/andes_nds32_ae3xx: new defconfig
> >   toolchain-external-andes-nds32: new package
> >   support/config-fragments/autobuild: test the Andes nds32 toolchain
> 
> Following the merge of the nds32 architecture, two types of build
> failures started to appear:
> 
>  - The target binutils package failed to build, because binutils does
>    not yet have support for nds32. I tried with the latest binutils
>    release, 2.32, and it was the same. So for now, I have disabled
>    binutils on nds32. However, in binutils source, I see that
>    bfd/elf-nds32.c is present, so there at least the beginning of some
>    support. Could you comment on the status of nds32 support in
>    binutils upstream ?
> 
>    Build failure: http://autobuild.buildroot.net/results/1b1/1b18acb11db4d6c4198deb7385aff3d4d524c37e/build-end.log
>    Commit to disable binutils on nds32: https://git.buildroot.org/buildroot/commit/?id=b45a703078e6f3be096f24ac63848490d32d0d29
> 
I got two methods can resolve this problem

1.package/binutils/binutils.mk

+ifeq ($(BR2_nds32),y)
+GNU_TARGET_NAME=nds32le-linux
+endif
+

2.package/Makefile.in

+ifeq ($(BR2_nds32),y)
+GNU_TARGET_NAME=$(ARCH)le-$(TARGET_OS)
+else
GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
+endif

In addition to these methods, do you have any suggest?
>  - The libffi library does not have support for nds32 as well, so I
>    made sure that we don't try to build configurations that include
>    libffi on nds32. Are you planning on adding nds32 support to libffi
>    upstream ?
>
We have no plans at the moment. 
>    Build failure: http://autobuild.buildroot.net/results/128/12803a705586e82fdfb49013da2eb3b9879ccd45/build-end.log
>    Commit to disable libffi on nds32: https://git.buildroot.org/buildroot/commit/?id=2e1f98d9509d869352080331e168abe5f1452e1a
> 
> Best regards,
> 
> Thomas Petazzoni
> -- 
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
  2019-04-18  8:39   ` Nylon Chen
@ 2019-04-18  9:00     ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2019-04-18  9:00 UTC (permalink / raw)
  To: buildroot

Hello Nylon,

On Thu, 18 Apr 2019 16:39:10 +0800
Nylon Chen <nylon7@andestech.com> wrote:

> >    Build failure: http://autobuild.buildroot.net/results/1b1/1b18acb11db4d6c4198deb7385aff3d4d524c37e/build-end.log
> >    Commit to disable binutils on nds32: https://git.buildroot.org/buildroot/commit/?id=b45a703078e6f3be096f24ac63848490d32d0d29
> >   
> I got two methods can resolve this problem
> 
> 1.package/binutils/binutils.mk
> 
> +ifeq ($(BR2_nds32),y)
> +GNU_TARGET_NAME=nds32le-linux
> +endif
> +
> 
> 2.package/Makefile.in
> 
> +ifeq ($(BR2_nds32),y)
> +GNU_TARGET_NAME=$(ARCH)le-$(TARGET_OS)
> +else
> GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
> +endif

Ah, so the correct tuple for your architecture is nds32le, not nds32 ?

If that's correct, then the right change is:

diff --git a/arch/Config.in.nds32 b/arch/Config.in.nds32
index 9c5db20e6f..f268883662 100644
--- a/arch/Config.in.nds32
+++ b/arch/Config.in.nds32
@@ -1,5 +1,5 @@
 config BR2_ARCH
-       default "nds32"
+       default "nds32le"
 
 config BR2_GCC_TARGET_ARCH
        default "v3"

So that ARCH is directly equal to nds32le. Since the architecture at
the kernel level is known as nds32, you will also want the following
change:

diff --git a/Makefile b/Makefile
index 522c0b0606..86e444da98 100644
--- a/Makefile
+++ b/Makefile
@@ -439,6 +439,7 @@ KERNEL_ARCH := $(shell echo "$(ARCH)" | sed -e "s/-.*//" \
        -e s/arceb/arc/ \
        -e s/arm.*/arm/ -e s/sa110/arm/ \
        -e s/aarch64.*/arm64/ \
+       -e s/nds32.*/nds32/ \
        -e s/or1k/openrisc/ \
        -e s/parisc64/parisc/ \
        -e s/powerpc64.*/powerpc/ \

> >  - The libffi library does not have support for nds32 as well, so I
> >    made sure that we don't try to build configurations that include
> >    libffi on nds32. Are you planning on adding nds32 support to libffi
> >    upstream ?
> >  
> We have no plans at the moment. 

OK. I think you should plan to have libffi support. Without libffi, you
can't build libglib, which means a huge set of Linux
libraries/applications can't be built for your platform. Another thing
that requires libffi is Python, so without libffi support for nds32,
you can't build Python.

See https://github.com/libffi/libffi for the upstream source code. And
see https://github.com/libffi/libffi/tree/master/src for all the
folders containing architecture specific code. There is not that much
architecture specific code.

Of course, there is no urgency: Buildroot autobuilders will not try to
build any configuration that include libffi. But it means that a lot of
packages are not tested, and also that a lot of the Linux software
ecosystem is not usable on nds32.

Best regards,

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-18  9:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16  7:25 [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Nylon Chen
2019-04-16  7:25 ` [Buildroot] [PATCH v5 1/4] arch: add support for Andes 32-bit(nds32) Nylon Chen
2019-04-17  7:49   ` Thomas Petazzoni
2019-04-16  7:25 ` [Buildroot] [PATCH v5 2/4] configs/andes_nds32_ae3xx: new defconfig Nylon Chen
2019-04-17  7:53   ` Thomas Petazzoni
2019-04-16  7:25 ` [Buildroot] [PATCH v5 3/4] toolchain-external-andes-nds32: new package Nylon Chen
2019-04-17  7:52   ` Thomas Petazzoni
2019-04-16  7:25 ` [Buildroot] [PATCH v5 4/4] support/config-fragments/autobuild: test the Andes nds32 toolchain Nylon Chen
2019-04-17  7:53   ` Thomas Petazzoni
2019-04-17 19:22 ` [Buildroot] [PATCH v5 0/4] Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support Thomas Petazzoni
2019-04-18  8:39   ` Nylon Chen
2019-04-18  9:00     ` Thomas Petazzoni

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.