Introducing Nios-II architecture
v2 cover Introducing Nios-II architecture
From: Ezequiel Garcia <[email protected]>
This is the second version of the series adding basic support for Altera's Nios-II architecture.
Only basic support added so far, but more patches will hopefully follow.
Changes from v1:
* Added details about toolchain components version
* Removed Sourcery version 2013.05-12 and left 2013.05-43 only
* Excluded internal and crosstool-ng toolchains as they're not supported (yet?)
Many thanks to Zylin (www.zylin.com) for supporting this!
Ezequiel Garcia (2):
nios2: Add new architecture
toolchain-external: Add Sourcery CodeBench for Nios-II
arch/Config.in | 11 +++++++++++ arch/Config.in.nios2 | 5 +++++ toolchain/Config.in | 5 +++-- toolchain/toolchain-external/Config.in | 14 ++++++++++++++ toolchain/toolchain-external/ext-tool.mk | 3 +++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 arch/Config.in.nios2
Signature · 1 line
1.8.1.5
PATCH v2 1/2 nios2: Add new architecture
From: Ezequiel Garcia <[email protected]>
This commit adds very basic support to build for the Nios II architecture. Toolchain support is still missing and instead we need to use an external custom toolchain.
Notice that this architecture had been previously removed in Buildroot 2010.05-rc1 release (as explained in the CHANGES file) and this commit adds it back.
--- arch/Config.in | 11 +++++++++++ arch/Config.in.nios2 | 5 +++++ toolchain/Config.in | 5 +++-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 arch/Config.in.nios2
arch/Config.in +11 -0
@@ -124,6 +124,13 @@ config BR2_mips64el http://www.mips.com/ http://en.wikipedia.org/wiki/MIPS_Technologies +config BR2_nios2 + bool "Nios II" + help + Nios II is a soft core processor from Altera Corporation. + http://www.altera.com/ + http://en.wikipedia.org/wiki/Nios_II + config BR2_powerpc bool "PowerPC" help
@@ -305,6 +312,10 @@ if BR2_mips || BR2_mips64 || BR2_mipsel || BR2_mips64el source "arch/Config.in.mips" endif +if BR2_nios2 +source "arch/Config.in.nios2" +endif + if BR2_powerpc source "arch/Config.in.powerpc" endif
arch/Config.in.nios2 new file +5 -0
@@ -0,0 +1,5 @@ +config BR2_ARCH + default "nios2" + +config BR2_ENDIAN + default "LITTLE"
toolchain/Config.in +3 -2
@@ -25,7 +25,7 @@ choice config BR2_TOOLCHAIN_BUILDROOT bool "Buildroot toolchain" - depends on !BR2_microblaze && !BR2_aarch64 + depends on !BR2_microblaze && !BR2_aarch64 && !BR2_nios2 select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS config BR2_TOOLCHAIN_EXTERNAL
@@ -38,7 +38,8 @@ config BR2_TOOLCHAIN_EXTERNAL config BR2_TOOLCHAIN_CTNG bool "Crosstool-NG toolchain" depends on BR2_DEPRECATED - depends on !BR2_microblaze && !BR2_aarch64 && !BR2_xtensa && !BR2_arc + depends on !BR2_microblaze && !BR2_aarch64 && !BR2_xtensa && \ + !BR2_arc && !BR2_nios2 select BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS help Say 'y' if you want to generate the toolchain with crosstool-NG
Signature · 1 line
1.8.1.5
PATCH v2 1/2 nios2: Add new architecture
Dear Ezequiel Garcia,
Quoted 11 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
This commit adds very basic support to build for the Nios II architecture. Toolchain support is still missing and instead we need to use an external custom toolchain.
Notice that this architecture had been previously removed in Buildroot 2010.05-rc1 release (as explained in the CHANGES file) and this commit adds it back.
Signed-off-by Ezequiel Garcia <[email protected]>
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 2/2 toolchain-external: Add Sourcery CodeBench for Nios-II
In reply to Ezequiel GarciaFrom: Ezequiel Garcia <[email protected]>
This commit adds the pre-built Sourcery CodeBench toolchains currently available for the Nios-II architecture.
--- toolchain/toolchain-external/Config.in | 14 ++++++++++++++ toolchain/toolchain-external/ext-tool.mk | 3 +++ 2 files changed, 17 insertions(+)
toolchain/toolchain-external/Config.in +14 -0
@@ -402,6 +402,19 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203 comment "Sourcery CodeBench toolchains are only available for MIPS/MIPS64 o32 and n64" depends on BR2_MIPS_NABI32 +config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43 + bool "Sourcery CodeBench Nios-II 2013.05-43" + depends on BR2_nios2 + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + select BR2_TOOLCHAIN_EXTERNAL_GLIBC + select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_INSTALL_LIBSTDCPP + select BR2_HOSTARCH_NEEDS_IA32_LIBS + help + Sourcery CodeBench toolchain for the Nios-II architecture, + from Mentor Graphics. It uses gcc 4.7.3, binutils 2.23.52, + glibc 2.17, gdb 7.4.50 and kernel headers 3.7.0. + config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103 bool "Sourcery CodeBench PowerPC 2011.03" depends on BR2_powerpc
@@ -818,6 +831,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305 + default "nios2-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43 default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009 default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103 default "sh-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103
toolchain/toolchain-external/ext-tool.mk +3 -0
@@ -247,6 +247,9 @@ TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = mips-2013.05-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2 +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43),y) +TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/ +TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-43-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/powerpc-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2
Signature · 1 line
1.8.1.5
PATCH v2 2/2 toolchain-external: Add Sourcery CodeBench for Nios-II
Dear Ezequiel Garcia,
Quoted 6 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
This commit adds the pre-built Sourcery CodeBench toolchains currently available for the Nios-II architecture.
Signed-off-by Ezequiel Garcia <[email protected]>
I have a comment below, but I guess it can easily be fixed by Peter when committing, unless Ezequiel wants to send an updated version to fix it. Once it is fixed, this patch has my:
Quoted 1 line
+config
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
You should remove the _43 suffix here.
toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203 · line 406
Quoted 1 line
toolchain/toolchain-external/Config.in +1
-0+ bool "Sourcery CodeBench Nios-II 2013.05-43"
and here the -43 suffix.
Quoted 15 lines
toolchain/toolchain-external/Config.in +11
-0+ depends on BR2_nios2 + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + select BR2_TOOLCHAIN_EXTERNAL_GLIBC + select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_INSTALL_LIBSTDCPP + select BR2_HOSTARCH_NEEDS_IA32_LIBS + help + Sourcery CodeBench toolchain for the Nios-II architecture, + from Mentor Graphics. It uses gcc 4.7.3, binutils 2.23.52, + glibc 2.17, gdb 7.4.50 and kernel headers 3.7.0. + config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103 bool "Sourcery CodeBench PowerPC 2011.03" depends on BR2_powerpc
toolchain/toolchain-external/Config.in config BR2_TOOLCHAIN_EXTERNAL_PREFIX · line 834
Quoted 4 lines
toolchain/toolchain-external/Config.in +1
-0@@ -818,6 +831,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201203 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201209 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305 + default "nios2-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43
Ditto.
toolchain/toolchain-external/ext-tool.mk TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar · line 250
Quoted 12 lines
toolchain/toolchain-external/Config.in +0
-0default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009 default "powerpc-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103 default "sh-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103toolchain/toolchain-external/ext-tool.mk +1
-0@@ -247,6 +247,9 @@ TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201305),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = mips-2013.05-36-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2 +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII201305_43),y)
Same thing.
toolchain/toolchain-external/ext-tool.mk TOOLCHAIN_EXTERNAL_SOURCE = mips-2012.09-99-mips-linux-gnu-i686-pc-linux-gnu.tar · line 255
Quoted 5 lines
toolchain/toolchain-external/ext-tool.mk +2
-0+TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/nios2-linux-gnu/ +TOOLCHAIN_EXTERNAL_SOURCE = sourceryg++-2013.05-43-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/powerpc-linux-gnu/ TOOLCHAIN_EXTERNAL_SOURCE = freescale-2010.09-55-powerpc-linux-gnu-i686-pc-linux-gnu.tar.bz2
This allows to be consistent with what we do for the other external toolchains. The Config.in options designates the version of the toolchain without the patch level.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 2/2 toolchain-external: Add Sourcery CodeBench for Nios-II
Quoted 9 lines · Thomas Petazzoni
Dear Ezequiel Garcia,
Quoted 5 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
This commit adds the pre-built Sourcery CodeBench toolchains currently available for the Nios-II architecture.
Quoted 8 lines
Quoted 1 line
Signed-off-by Ezequiel Garcia <[email protected]>I have a comment below, but I guess it can easily be fixed by Peter when committing, unless Ezequiel wants to send an updated version to fix it. Once it is fixed, this patch has my:
Acked-by Thomas Petazzoni <[email protected]>
Yes, I'll fix and re-send.
Thanks,
Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur www.vanguardiasur.com.ar
v2 cover Introducing Nios-II architecture
In reply to Ezequiel GarciaDear Ezequiel Garcia,
Quoted 5 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
This is the second version of the series adding basic support for Altera's Nios-II architecture.
Only basic support added so far, but more patches will hopefully follow.
Nice!
Once this series is committed, I'll add NIOS-II to the autobuilders. Are you willing to look at the resulting package build failures?
What's nice is that the toolchain is modern: gcc 4.7, glibc 2.17, binutils 2.23. Hopefully, this will mean that the number of issues should not be too huge.
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
v2 cover Introducing Nios-II architecture
Quoted 5 lines · Thomas Petazzoni
Dear Ezequiel Garcia,
Quoted 2 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
Quoted 9 lines
Quoted 3 lines
This is the second version of the series adding basic support for Altera's Nios-II architecture.
Only basic support added so far, but more patches will hopefully follow.Nice!
Once this series is committed, I'll add NIOS-II to the autobuilders. Are you willing to look at the resulting package build failures?
Sure. However, not all of them will be easy to fix, I'm afraid.
I'm currently *trying* to port strace, which is probably one of the most important package lacks we currently have.
Quoted 4 lines
What's nice is that the toolchain is modern: gcc 4.7, glibc 2.17, binutils 2.23. Hopefully, this will mean that the number of issues should not be too huge.
Indeed. I'm trying to follow the toolchain mainline process so I hope we'll be able to support the internal toolchain soon!
Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur www.vanguardiasur.com.ar
v2 cover Introducing Nios-II architecture
In reply to Thomas PetazzoniHello
Quoted 5 lines · Thomas Petazzoni
Dear Ezequiel Garcia,
Quoted 2 lines · Ezequiel Garcia
From: Ezequiel Garcia <[email protected]>
Quoted 8 lines
Quoted 3 lines
This is the second version of the series adding basic support for Altera's Nios-II architecture.
Only basic support added so far, but more patches will hopefully follow.Nice!
Once this series is committed, I'll add NIOS-II to the autobuilders. Are you willing to look at the resulting package build failures?
I had a quick look, and unfortunately, there is no support for NIOS-II in libffi. This means that anything that uses libglib or python cannot be built for NIOS-II. This is a bit annoying as adding a 'depends on !BR2_nios2' on all reverse dependencies of libglib is a big pain.
Unfortunately, a quick google search doesn't even show the start of an effort to add NIOS-II support to libffi, so I guess we'll have to live with that.
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com