Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
v2 cover Add prebuilt nds32 toolchain, ae3xx board and autobuild configs support
This patchset adds basic support for Andes's nds32 ISA and nds32 family's CPU IP based on ae3xx platform. The board is entirely supported since Linux 4.17.
Nylon Chen (3):
arch: add support for Andes 32-bit (nds32) architecture configs/andes_nds32_ae3xx: new defconfig support/config-fragments: add Andes 32-bit (nds32) to autobuild
configs
DEVELOPERS | 9 ++++++ arch/Config.in | 13 ++++++++ arch/Config.in.nds32 | 31 +++++++++++++++++++ board/andes/ae3xx/ae3xx.fragment | 1 + ...0001-nds32-Fix-boot-messages-garbled.patch | 28 +++++++++++++++++ configs/andes_ae3xx_defconfig | 14 +++++++++ package/binutils/Config.in.host | 2 ++ package/gcc/Config.in.host | 4 +++ package/linux-headers/Config.in.host | 3 ++ .../autobuild/br-andes-nds32-glibc.config | 9 ++++++ .../autobuild/toolchain-configs.csv | 1 + 11 files changed, 115 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 configs/andes_ae3xx_defconfig create mode 100644 support/config-fragments/autobuild/br-andes-nds32-glibc.config
Signature · 1 line
2.18.0
PATCH v2 1/3 arch: add support for Andes 32-bit (nds32) architecture
This enables a nds32 system to be built with a Buildroot generated toolchain (gcc >= 8.0.1, binutils >= 2.30, glibc only).
This configuration has been used to successfully build a linux kernel
(git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git).
--- DEVELOPERS | 7 +++++++ arch/Config.in | 13 ++++++++++++ arch/Config.in.nds32 | 31 ++++++++++++++++++++++++++++ package/binutils/Config.in.host | 2 ++ package/gcc/Config.in.host | 4 ++++ package/linux-headers/Config.in.host | 3 +++ 6 files changed, 60 insertions(+) create mode 100644 arch/Config.in.nds32
DEVELOPERS +7 -0
@@ -2296,3 +2296,10 @@ F: package/qjson/ F: package/quazip/ F: package/shapelib/ F: package/tinc/ + +N: Nylon Chen <[email protected]> +F: arch/Config.in +F: arch/Config.in.nds32 +F: package/binutils +F: package/gcc +F: package/linux-headers
arch/Config.in +13 -0
@@ -125,6 +125,15 @@ config BR2_mips 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_mipsel bool "MIPS (little endian)" select BR2_ARCH_HAS_MMU_MANDATORY
@@ -423,6 +432,10 @@ if BR2_nios2 source "arch/Config.in.nios2" endif +if BR2_nds32 +source "arch/Config.in.nds32" +endif + if BR2_or1k source "arch/Config.in.or1k" endif
arch/Config.in.nds32 new file +31 -0
@@ -0,0 +1,31 @@ +config BR2_ARCH + default "nds32" + +choice + prompt "Target Architecture Variant" + default BR2_nds32_v3 + depends on !BR2_ARCH_IS_64 + help + Specific CPU variant to use + +comment "N series" +config BR2_nds32_v3 + bool "v3" +config BR2_nds32_v3f + bool "v3f" + +endchoice + +config BR2_GCC_TARGET_ARCH + default "v3" if BR2_nds32_v3 + default "v3f" if BR2_nds32_v3f + +config BR2_ENDIAN + default "LITTLE" + +config BR2_TOOLCHAIN_HAS_NATIVE_RPC + bool + +config BR2_READELF_ARCH_NAME + default "Andes Technology compact code size embedded RISC processor family" +
package/binutils/Config.in.host +2 -0
@@ -19,10 +19,12 @@ config BR2_BINUTILS_VERSION_2_28_X bool "binutils 2.28.1" depends on !BR2_arc depends on !BR2_riscv + depends on !BR2_nds32 config BR2_BINUTILS_VERSION_2_29_X bool "binutils 2.29.1" depends on !BR2_riscv + depends on !BR2_nds32 config BR2_BINUTILS_VERSION_2_30_X bool "binutils 2.30"
package/gcc/Config.in.host +4 -0
@@ -26,6 +26,7 @@ config BR2_GCC_VERSION_4_9_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 # musl on microblaze, ppc64 and mips64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_microblazeel || BR2_microblazebe)) depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le))
@@ -42,6 +43,7 @@ config BR2_GCC_VERSION_5_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 # musl on ppc64 and mips64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le)) depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))
@@ -55,6 +57,7 @@ config BR2_GCC_VERSION_6_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 select BR2_TOOLCHAIN_GCC_AT_LEAST_6 config BR2_GCC_VERSION_7_X
@@ -62,6 +65,7 @@ config BR2_GCC_VERSION_7_X depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 # Broken or unsupported architectures depends on !BR2_or1k + depends on !BR2_nds32 select BR2_TOOLCHAIN_GCC_AT_LEAST_7 config BR2_GCC_VERSION_8_X
package/linux-headers/Config.in.host +3 -0
@@ -31,16 +31,19 @@ config BR2_KERNEL_HEADERS_AS_KERNEL config BR2_KERNEL_HEADERS_4_4 bool "Linux 4.4.x kernel headers" depends on !BR2_riscv + depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 config BR2_KERNEL_HEADERS_4_9 bool "Linux 4.9.x kernel headers" depends on !BR2_riscv + depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9 config BR2_KERNEL_HEADERS_4_14 bool "Linux 4.14.x kernel headers" depends on !BR2_riscv + depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 config BR2_KERNEL_HEADERS_4_19
Signature · 1 line
2.18.0
PATCH v2 2/3 configs/andes_nds32_ae3xx: new defconfig
In reply to Nylon ChenAdd Andes 32-bit defconfig for AE3XX platform.
--- DEVELOPERS | 2 ++ board/andes/ae3xx/ae3xx.fragment | 1 + ...0001-nds32-Fix-boot-messages-garbled.patch | 28 +++++++++++++++++++ configs/andes_ae3xx_defconfig | 14 ++++++++++ 4 files changed, 45 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 configs/andes_ae3xx_defconfig
DEVELOPERS +2 -0
@@ -2303,3 +2303,5 @@ F: arch/Config.in.nds32 F: package/binutils F: package/gcc F: package/linux-headers +F: board/andes +F: configs/andes_ae3xx_defconfig
board/andes/ae3xx/ae3xx.fragment new file +1 -0
@@ -0,0 +1 @@ +CONFIG_NDS32_BUILTIN_DTB="ae3xx"
board/andes/patches/linux/0001-nds32-Fix-boot-messages-garbled.patch new file +28 -0
@@ -0,0 +1,28 @@ +From 90d52d180dcc5d1300dc352ca709eb6453894143 Mon Sep 17 00:00:00 2001 +From: Nylon Chen <[email protected]> +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 <[email protected]> +--- + 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 +
configs/andes_ae3xx_defconfig new file +14 -0
@@ -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_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.tar.xz" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/andes/ae3xx/ae3xx.fragment" +BR2_TARGET_ROOTFS_INITRAMFS=y
Signature · 1 line
2.18.0
PATCH v2 3/3 support/config-fragments: add Andes 32-bit (nds32) to autobuild configs
In reply to Nylon ChenAdd a minimal nds32 autobuild configuration for the internal toolchain with glibc.
--- .../autobuild/br-andes-nds32-glibc.config | 9 +++++++++ support/config-fragments/autobuild/toolchain-configs.csv | 1 + 2 files changed, 10 insertions(+) create mode 100644 support/config-fragments/autobuild/br-andes-nds32-glibc.config
support/config-fragments/autobuild/br-andes-nds32-glibc.config new file +9 -0
@@ -0,0 +1,9 @@ +BR2_nds32=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +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_GCC_8=y +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_17=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="nds32le-linux"
support/config-fragments/autobuild/toolchain-configs.csv +1 -0
@@ -74,3 +74,4 @@ support/config-fragments/autobuild/sourcery-mips.config,x86 support/config-fragments/autobuild/sourcery-nios2.config,x86 support/config-fragments/autobuild/sourcery-x86-64.config,x86 support/config-fragments/autobuild/x86_64-ctng_locales-linux-gnu.config,x86 +support/config-fragments/autobuild/br-andes-nds32-glibc.config,x86
Signature · 1 line
2.18.0
PATCH v2 1/3 arch: add support for Andes 32-bit (nds32) architecture
In reply to Nylon ChenHello,
Thanks for this second iteration. See below for some comments.
Quoted 2 lines · On Wed, 23 Jan 2019 20:39:45 +0800 Nylon Chen <[email protected]> wrote:
This enables a nds32 system to be built with a Buildroot generated toolchain (gcc >= 8.0.1, binutils >= 2.30, glibc only).
It is not clear what you want to support here. You're talking about a "Buildroot generated toolchain", so I would expect that one can build a toolchain with Buildroot for nds32. But:
- You have selected BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT, which prevents building a toolchain with Buildroot
- I don't see any upstream support for nds32 in glibc. If you have a special version of glibc (non-upstream), it can be supported as well.
DEVELOPERS F: package/qjson/ · line 2305
Quoted 6 lines
DEVELOPERS +6
-0+N: Nylon Chen <[email protected]> +F: arch/Config.in +F: arch/Config.in.nds32 +F: package/binutils +F: package/gcc +F: package/linux-headers
Only add arch/Config.in.nds32, and put this entry at the right place in the DEVELOPERS file, by alphabetic ordering of developer names.
arch/Config.in config BR2_mips · line 130
Quoted 3 lines
arch/Config.in +3
-0+config BR2_nds32 + bool "nds32" + select BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT
So that's where you have to decide: do you support building a toolchain with Buildroot or not.
arch/Config.in config BR2_mips · line 136
Quoted 6 lines
arch/Config.in +6
-0+ select BR2_ARCH_HAS_MMU_MANDATORY + help + nds32 is a 32-bit architecture developed by Andes Technology. + https://en.wikipedia.org/wiki/Andes_Technology + +
Only one empty line here please.
arch/Config.in.nds32 line 7
Quoted 13 lines
arch/Config.in.nds32 new file +7
-0@@ -0,0 +1,31 @@ +config BR2_ARCH + default "nds32" + +choice + prompt "Target Architecture Variant" + default BR2_nds32_v3 + depends on !BR2_ARCH_IS_64
Why do you have this dependency ?
Quoted 10 lines
arch/Config.in.nds32 new file +10
-0+ help + Specific CPU variant to use + +comment "N series" +config BR2_nds32_v3 + bool "v3" +config BR2_nds32_v3f + bool "v3f" + +endchoice
arch/Config.in.nds32 line 27
Quoted 10 lines
arch/Config.in.nds32 new file +10
-0+ +config BR2_GCC_TARGET_ARCH + default "v3" if BR2_nds32_v3 + default "v3f" if BR2_nds32_v3f + +config BR2_ENDIAN + default "LITTLE" + +config BR2_TOOLCHAIN_HAS_NATIVE_RPC + bool
Remove this, it doesn't make sense. This is a property of the C library, and it has nothing to do with the architecture definition
Quoted 7 lines
package/binutils/Config.in.host +0
-0@@ -19,10 +19,12 @@ config BR2_BINUTILS_VERSION_2_28_X bool "binutils 2.28.1" depends on !BR2_arc
package/binutils/Config.in.host config BR2_BINUTILS_VERSION_2_28_X · line 30
Quoted 10 lines
package/binutils/Config.in.host +2
-0depends on !BR2_riscv + depends on !BR2_nds32 config BR2_BINUTILS_VERSION_2_29_X bool "binutils 2.29.1" depends on !BR2_riscv + depends on !BR2_nds32 config BR2_BINUTILS_VERSION_2_30_X bool "binutils 2.30"
These changes are useless if you don't support building a Buildroot toolchain for nds32.
Quoted 29 lines
package/gcc/Config.in.host +3
-0@@ -26,6 +26,7 @@ config BR2_GCC_VERSION_4_9_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 # musl on microblaze, ppc64 and mips64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_microblazeel || BR2_microblazebe)) depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le))@@ -42,6 +43,7 @@ config BR2_GCC_VERSION_5_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 # musl on ppc64 and mips64 unsupported depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_powerpc64 || BR2_powerpc64le)) depends on !(BR2_TOOLCHAIN_USES_MUSL && (BR2_mips64 || BR2_mips64el))@@ -55,6 +57,7 @@ config BR2_GCC_VERSION_6_X # Broken or unsupported architectures depends on !BR2_arc depends on !BR2_or1k + depends on !BR2_nds32 select BR2_TOOLCHAIN_GCC_AT_LEAST_6 config BR2_GCC_VERSION_7_X
package/gcc/Config.in.host config BR2_GCC_VERSION_7_X · line 69
Quoted 5 lines
package/gcc/Config.in.host +1
-0@@ -62,6 +65,7 @@ config BR2_GCC_VERSION_7_X depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8 # Broken or unsupported architectures depends on !BR2_or1k + depends on !BR2_nds32 select BR2_TOOLCHAIN_GCC_AT_LEAST_7
Same thing: those changes are not needed if you don't support building a Buildroot toolchain for nds32.
If you want to support building a Buildroot toolchain for nds32, you can also drop all those changes, and just have the main BR2_nds32 option select BR2_ARCH_NEEDS_GCC_AT_LEAST_8.
Quoted 14 lines
package/linux-headers/Config.in.host +1
-0@@ -31,16 +31,19 @@ config BR2_KERNEL_HEADERS_AS_KERNEL config BR2_KERNEL_HEADERS_4_4 bool "Linux 4.4.x kernel headers" depends on !BR2_riscv + depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 config BR2_KERNEL_HEADERS_4_9 bool "Linux 4.9.x kernel headers" depends on !BR2_riscv
package/linux-headers/Config.in.host config BR2_KERNEL_HEADERS_AS_KERNEL · line 49
Quoted 10 lines
package/linux-headers/Config.in.host +2
-0+ depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9 config BR2_KERNEL_HEADERS_4_14 bool "Linux 4.14.x kernel headers" depends on !BR2_riscv + depends on !BR2_nds32 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 config BR2_KERNEL_HEADERS_4_19
Same thing: those changes are not needed if you don't support building a Buildroot toolchain for nds32.
Thanks,
Thomas Petazzoni
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 2/3 configs/andes_nds32_ae3xx: new defconfig
In reply to Nylon ChenHello,
DEVELOPERS F: arch/Config.in.nds32 · line 2307
Quoted 10 lines · On Wed, 23 Jan 2019 20:39:46 +0800 Nylon Chen <[email protected]> wrote:
DEVELOPERS +2
-0@@ -2303,3 +2303,5 @@ F: arch/Config.in.nds32 F: package/binutils F: package/gcc F: package/linux-headers +F: board/andes +F: configs/andes_ae3xx_defconfig
Please keep entries alphabetically sorted.
Quoted 7 lines
configs/andes_ae3xx_defconfig new file +1
-0@@ -0,0 +1,14 @@ +BR2_nds32=y
configs/andes_ae3xx_defconfig line 11
Quoted 10 lines
configs/andes_ae3xx_defconfig new file +10
-0+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_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.17.tar.xz"
Use BR2_LINUX_KERNEL_CUSTOM_VERSION andBR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE instead.
Also, for our defconfigs, we require a readme.txt file, in board/andes/ae3xx/readme.txt, which briefly says how to use the defconfig. See other readme.txt files in board/.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 3/3 support/config-fragments: add Andes 32-bit (nds32) to autobuild configs
In reply to Nylon ChenHello,
Quoted 2 lines · On Wed, 23 Jan 2019 20:39:47 +0800 Nylon Chen <[email protected]> wrote:
Add a minimal nds32 autobuild configuration for the internal toolchain with glibc.
This autobuild configuration is using an external toolchain, so it is not at all testing "internal toolchain with glibc".
Also, are you ok with analyzing the build failures that will be reported by our autobuilders for the nds32 architecture, investigate them and provide fixes ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v2 3/3 support/config-fragments: add Andes 32-bit (nds32) to autobuild configs
Quoted 11 lines · Thomas Petazzoni
Hello,
Quoted 2 lines · On Wed, 23 Jan 2019 20:39:47 +0800 Nylon Chen <[email protected]> wrote:
Add a minimal nds32 autobuild configuration for the internal toolchain with glibc.
This autobuild configuration is using an external toolchain, so it is not at all testing "internal toolchain with glibc".
Ok, next patch I will fix commit described avoid confusing.
Quoted 4 lines
Also, are you ok with analyzing the build failures that will be reported by our autobuilders for the nds32 architecture, investigate them and provide fixes ?
no problem, I'll help as mush as i can.
Quoted 7 lines
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com