Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Aug 2008 14:49:20 +0000
From:      Arnar Mar Sig <antab@valka.is>
To:        current@FreeBSD.org
Cc:        "Wojciech A. Koszek" <wkoszek@freebsd.org>, "M. Warner Losh" <imp@bsdimp.com>, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: FreeBSD/AVR32 port
Message-ID:  <4E6DF728-C81C-43F9-B99C-12DD0BD4A570@valka.is>
In-Reply-To: <20080809.214357.1707063132.imp@bsdimp.com>
References:  <67389BC1-FBD5-4D39-97CA-056FFC3B3B01@valka.is> <20080809.214357.1707063132.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-21--359207516
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit

Attached are instruction how to get binutils, gcc and uboot mkimage  
for avr32 working on FreeBSD.
Dont be put off by the avr32-linux target, the avr32 target is broken  
or at last i haven't been able to get it working, and it dosen't  
matter because no linux specific code is included in the end.

I have no intrest in trying to get the toolchain into the freebsd tree  
until Atmel has submitted they're changes upstream, and the fact that  
some Atmel gcc patches seem to break other arch builds.

I will post patches for FreeBSD/AVR32 later today.


--Apple-Mail-21--359207516
Content-Disposition: attachment;
	filename=build-avr32-gcc.txt
Content-Type: text/plain;
	x-unix-mode=0644;
	name="build-avr32-gcc.txt"
Content-Transfer-Encoding: 7bit

Assuming all files are downloaded to the same folder and toolchain will be installed to /crosstools and that /crosstools/bin is in you PATH. At the moment i got a hardcoded paths to /crosstools to build the kernel.

Downloads for binutils:
	http://avr32linux.org/twiki/pub/Main/BinutilsPatches/binutils-2.17.atmel.1.2.6.tar.bz2
	http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
	http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD

Downloads for gcc:
	http://avr32linux.org/twiki/pub/Main/GccPatches/gcc-4.2.2.atmel.1.0.8.tar.bz2
	http://avr32linux.org/twiki/pub/Main/GccPatches/901-avr32-fix-no-cond-exec-before-reload.patch
	http://avr32linux.org/twiki/pub/Main/GccPatches/902-avr32-fix-sync-insn-instructions.patch
	http://avr32linux.org/twiki/pub/Main/GccPatches/903-avr32-fix-removal-of-redundant-cast-operations.patch

Download for uboot:
	http://avr32linux.org/twiki/pub/Main/UbootPatches/u-boot-1.3.1.atmel.1.tar.bz2

Building bintuils:
$ tar xvjf binutils-2.17.atmel.1.2.6.tar.bz2
Move config.sub and config.guess into binutils-2.17.atmel.1.2.6/
$ mkdir binutils-build
$ cd binutils-build
$ ../binutils-2.17.atmel.1.2.6/configure --target=avr32-linux --prefix=/crosstools
$ gmake
$ gmake install

Building gcc:
$ tar xvjf gcc-4.2.2.atmel.1.0.8.tar.bz2
$ cd gcc-4.2.2.atmel.1.0.8
$ patch -p1 < ../901-avr32-fix-no-cond-exec-before-reload.patch
$ patch -p1 < ../902-avr32-fix-sync-insn-instructions.patch
$ patch -p1 < ../903-avr32-fix-removal-of-redundant-cast-operations.patch
$ cd ..
$ mkdir gcc-build
$ cd gcc-build
$ ../gcc-4.2.2.atmel.1.0.8/configure --target=avr32-linux --prefix=/crosstools --with-gmp=/usr/local --with-mpfr=/usr/local --enable-shared --disable-nls --with-system-zlib --disable-threads --enable-languages=c --disable-libmudflap --disable-libssp --disable-libgomp
$ gmake
$ gmake install

Building uboot:
$ tar xvjf u-boot-1.3.1.atmel.1.tar.bz2
$ cd u-boot-1.3.1.atmel.1
$ gmake atngw100_config
It will probably fail with some linking errors, it dosen't matter if tools/mkimage has been built.
$ cp tools/mkimage /crosstools/bin

Other:
	GDB can be built on freebsd but it dosen't do you any good at the moment, you still need avr32gdbproxy to use JTAG, and that app is closed source and only avilable for linux and windows. Maybe it works with the linux emulation, but i haven't been able to get it working on amd64 (only 32bit binaries avilable, but 64bit binaries are one the way). If you wanna try then the avr32gdbproxy app is avilable from atmels site (included in the toolchain packages) and more info about how to use it on: http://avr32linux.org/twiki/bin/view/Main/KernelDebugging

--Apple-Mail-21--359207516
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed
Content-Transfer-Encoding: 7bit



Greets
	Arnar Mar Sig
	Valka ehf


--Apple-Mail-21--359207516--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E6DF728-C81C-43F9-B99C-12DD0BD4A570>