[U-Boot] nds32: toolchains for building ?

where can we actually get a toolchain to build nds32 ? support doesn't appear to be in the mainline FSF projects ... -mike

Hi Mike,
2011/11/4 Mike Frysinger vapier@gentoo.org:
where can we actually get a toolchain to build nds32 ? support doesn't appear to be in the mainline FSF projects ... -mike
Unfortunately both the toolchain and the Linux kernel haven't commit back to mainline yet. You can only found it in autotools which is in FSF projects. :-( The official explanation is that the company has put the code commit activity in schedule. But I and my colledgue are not sure when will it be started. :-( We don't know if the CEO has signed the agreement with FSF already or not. :-(
Current toolchain we're using is gcc-4.5, binutils-2.19, the newer version is still under developing.
It's pity that only you can found the toolchain with full source from public is very old. I can give you the url as follows. http://osdk.andestech.com/
Currently, only the customers and universities could be able to get the newest toolchain and BSP right now.
U-boot is the first project which Andestech to commit the source code into mainline. Hope this could encourage the company to commit the source code into mainline more active.
Thanks.

On Friday 04 November 2011 04:24:51 馬克泡 wrote:
It's pity that only you can found the toolchain with full source from public is very old. I can give you the url as follows. http://osdk.andestech.com/
yes, i d/l-ed that monster of a .rar (which contains .tar.gz which themselves contain .tar.gz .....), but the linker in there segfaults for me :(
for people who want to try building u-boot but skip d/lin a 100MB+ rar, i've ripped things apart and posted it here as 3MiB: http://dev.gentoo.org/~vapier/u-boot/nds32.tar.xz
Configuring for adp-ag101 board... board.c:107: warning: 'pmu_init' defined but not used cmd_bdinfo.c:489: warning: 'print_lnum' defined but not used cmd_mmc.c: In function `do_mmcops': cmd_mmc.c:230: warning: comparison is always false due to limited range of data type cmd_mmc.c:245: warning: comparison is always false due to limited range of data type ns16550.c: In function `NS16550_init': ns16550.c:44: warning: passing arg 2 of `writeb' makes pointer from integer without a cast /bin/sh: line 1: 28408 Segmentation fault (core dumped) nds32le-linux-ld --gc-sections --relax -T u-boot.lds -Bstatic -Ttext 0x03200000 $UNDEF_SYM arch/nds32/cpu/n1213/start.o --start-group api/libapi.o arch/nds32/cpu/n1213/ag101/libag101.o arch/nds32/cpu/n1213/libn1213.o arch/nds32/lib/libnds32.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/AndesTech/adp-ag101/libadp- ag101.o --end-group -L /usr/local/src/u-boot/toolchains/nds32le- linux/bin/../lib/gcc/nds32le-linux/3.4.4 -lgcc -Map u-boot.map -o u-boot make: *** [u-boot] Error 139 -mike

On Friday 04 November 2011 18:22:32 Mike Frysinger wrote:
On Friday 04 November 2011 04:24:51 馬克泡 wrote:
It's pity that only you can found the toolchain with full source from public is very old. I can give you the url as follows. http://osdk.andestech.com/
yes, i d/l-ed that monster of a .rar (which contains .tar.gz which themselves contain .tar.gz .....), but the linker in there segfaults for me :(
seems to partially be due to the nds32 u-boot.lds not handling .data.rel sections which a few objects have, so the linker just arbitrarily appends them. you should probably tweak the linker script, perhaps like so:
--- a/arch/nds32/cpu/n1213/u-boot.lds +++ b/arch/nds32/cpu/n1213/u-boot.lds @@ -41,7 +41,7 @@ SECTIONS .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
. = ALIGN(4); - .data : { *(.data) } + .data : { *(.data*) }
. = ALIGN(4);
fixing that though just gets me a diff bug: nds32le-linux-ld: BFD 2.16.91 internal error, aborting at ../../bfd/section.c line 1229 in bfd_map_over_sections nds32le-linux-ld: Please report this bug. -mike

Hi Mike,
2011/11/5 Mike Frysinger vapier@gentoo.org:
On Friday 04 November 2011 18:22:32 Mike Frysinger wrote:
On Friday 04 November 2011 04:24:51 馬克泡 wrote:
It's pity that only you can found the toolchain with full source from public is very old. I can give you the url as follows. http://osdk.andestech.com/
yes, i d/l-ed that monster of a .rar (which contains .tar.gz which themselves contain .tar.gz .....), but the linker in there segfaults for me :(
The old toolchain contains a lot of bugs, even the implementation of rpath has problems. Please do not waste your time! I'll try to get one for you next week. :)

On Friday 04 November 2011 21:35:02 馬克泡 wrote:
2011/11/5 Mike Frysinger vapier@gentoo.org:
On Friday 04 November 2011 18:22:32 Mike Frysinger wrote:
On Friday 04 November 2011 04:24:51 馬克泡 wrote:
It's pity that only you can found the toolchain with full source from public is very old. I can give you the url as follows. http://osdk.andestech.com/
yes, i d/l-ed that monster of a .rar (which contains .tar.gz which themselves contain .tar.gz .....), but the linker in there segfaults for me :(
The old toolchain contains a lot of bugs, even the implementation of rpath has problems. Please do not waste your time! I'll try to get one for you next week. :)
thanks. i think you should still fix that linker script issue i pointed out as it seems like the linker is putting stuff after the _end/.bss in your u-boot image ... not that i can double check as i can't link the final ELF and analyze it :). -mike

Hi Mike,
2011/11/6 Mike Frysinger vapier@gentoo.org:
thanks. i think you should still fix that linker script issue i pointed out as it seems like the linker is putting stuff after the _end/.bss in your u-boot image ... not that i can double check as i can't link the final ELF and analyze it :). -mike
I'm very thanks for your great help. I've updated the linker script, and...
The toolchain binaries are available at the following url. http://osdk.andestech.com/pre-release.html
The latest toolchain version is gcc 4.5 built on 2011.07. Which you can downloaded is gcc 4.5 built on 2011.02
Thanks!

On Thursday 10 November 2011 01:22:10 Macpaul Lin wrote:
The toolchain binaries are available at the following url. http://osdk.andestech.com/pre-release.html
awesome !
The latest toolchain version is gcc 4.5 built on 2011.07. Which you can downloaded is gcc 4.5 built on 2011.02
what's the difference between v0 v1 v1f ? -mike

Hi Mike,
2011/11/11 Mike Frysinger vapier@gentoo.org:
On Thursday 10 November 2011 01:22:10 Macpaul Lin wrote:
The toolchain binaries are available at the following url. http://osdk.andestech.com/pre-release.html
awesome !
The latest toolchain version is gcc 4.5 built on 2011.07. Which you can downloaded is gcc 4.5 built on 2011.02
what's the difference between v0 v1 v1f ? -mike
It should be described in detail in the README, however, the v0 toolchain will be phased out in recent. So it becomes not so important. XD
The version numbers v0, v1, v1f, v2, v2f, v3, and v3m are meant to instruction set (ISA) versions. Currently, the first SoC ag101 can be adapted with v0 toolchain only. The second SoC is soft core ag101p, which can run the most compatible v1 instruction sets. While v1f means v1 ISA + floating point ISA. Other details of v2 and v3 ISA should be able to be found though url http://www.andestech.com/
However, I don't know where exactly url of the document is. :p Please use v0 toolchain to play with adp-ag101 board. Although you can use v1 toolchain to build the binary for ag101 SoC, it couldn't be booted up. For the backward compatibility, of course, you can use v0 and v1 toolchain to build binary for ag101p SoC. Both of the binaries could run correctly.

On Thursday 10 November 2011 12:01:46 Macpaul Lin wrote:
2011/11/11 Mike Frysinger vapier@gentoo.org:
what's the difference between v0 v1 v1f ?
It should be described in detail in the README, however, the v0 toolchain will be phased out in recent. So it becomes not so important. XD
The version numbers v0, v1, v1f, v2, v2f, v3, and v3m are meant to instruction set (ISA) versions. Currently, the first SoC ag101 can be adapted with v0 toolchain only. The second SoC is soft core ag101p, which can run the most compatible v1 instruction sets. While v1f means v1 ISA + floating point ISA. Other details of v2 and v3 ISA should be able to be found though url http://www.andestech.com/
However, I don't know where exactly url of the document is. :p Please use v0 toolchain to play with adp-ag101 board. Although you can use v1 toolchain to build the binary for ag101 SoC, it couldn't be booted up. For the backward compatibility, of course, you can use v0 and v1 toolchain to build binary for ag101p SoC. Both of the binaries could run correctly.
so the ISA version only affects the generated libraries right ? i can still use any of the compilers to output any ISA version ?
i grabbed the v1f and it seems to build the one nds32 board in the tree fine.
i ripped it down to the min needed for u-boot, so people can grab the 4.3MiB: http://dev.gentoo.org/~vapier/u-boot/nds32.tar.xz -mike

HI Mike,
2011/11/11 Mike Frysinger vapier@gentoo.org:
so the ISA version only affects the generated libraries right ? i can still use any of the compilers to output any ISA version ?
i grabbed the v1f and it seems to build the one nds32 board in the tree fine.
i ripped it down to the min needed for u-boot, so people can grab the 4.3MiB: http://dev.gentoo.org/~vapier/u-boot/nds32.tar.xz -mike
Unfortunately, wrong.
ISA will affect the assembly and binary patterns, also some basic stack operation. You cannot run v1 v1f binary on the adp-ag101 board. You also cannot run v1f on the chip which didn't have floating point unit. So, you cannot run v1f binary on adp-ag101p board. There will decode floating related ISA as non-floating point then lead fault.
The capability is listed as follows. adp-ag101: v0 binary only. adp-ag101p: v0 and v1 binary. adp-ag102: v0, v1, v1f

Hi Mike
Unfortunately, wrong.
ISA will affect the assembly and binary patterns, also some basic stack operation. You cannot run v1 v1f binary on the adp-ag101 board. You also cannot run v1f on the chip which didn't have floating point unit. So, you cannot run v1f binary on adp-ag101p board. There will decode floating related ISA as non-floating point then lead fault.
In much more detail, v0 has stack conflict will all other toolchain since the program counter register was designed forbidden to access directly in 3 years ago.
V1 and later ISA has a common behavior on stack operation since the program counter is available directly.
However, I don't know if there are parameters to turn-off the floating binary generation in v1f toolchain. Even I don't know if there are parameters to generation v0's binary with v1 toolchain. I think they are defined in compiling time when the toolchain is built.

On Thursday 10 November 2011 21:01:37 Macpaul Lin wrote:
2011/11/11 Mike Frysinger:
so the ISA version only affects the generated libraries right ? i can still use any of the compilers to output any ISA version ?
Unfortunately, wrong.
ISA will affect the assembly and binary patterns, also some basic stack operation.
right, which is why gcc ports have options like -march=, -mcpu=, -mtune=, etc... this way you only need 1 gcc to support all these different ISAs.
nds32le-linux-gcc -march=v0 -c ...... nds32le-linux-gcc -march=v1 -c ...... nds32le-linux-gcc -march=v1f -c ......
what i meant was that you don't have to configure gcc for a specific ISA. -mike

Hi Mike,
2011/11/11 Mike Frysinger vapier@gentoo.org:
right, which is why gcc ports have options like -march=, -mcpu=, -mtune=, etc... this way you only need 1 gcc to support all these different ISAs.
nds32le-linux-gcc -march=v0 -c ...... nds32le-linux-gcc -march=v1 -c ...... nds32le-linux-gcc -march=v1f -c ......
what i meant was that you don't have to configure gcc for a specific ISA. -mike
I just checked it out with my toolchain collegues, they said the option is -mbaseline. Please use 'nds32le-linux-gcc --target-help' to check what machine related options could be used. But, they remineded me, if you don't use the default baseline setting of the toolchain, the behavior might lead crash or some unknown problem. I'll check it later.
However, you cannot generate v0 baseline with any other toolchains, only v0 toolchain can do. Sorry. :-(
participants (3)
-
Macpaul Lin
-
Mike Frysinger
-
馬克泡