From owner-freebsd-arm@FreeBSD.ORG Sat Jan 21 10:30:39 2012 Return-Path: Delivered-To: arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3EB7106564A; Sat, 21 Jan 2012 10:30:39 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 50D828FC0A; Sat, 21 Jan 2012 10:30:39 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 10E61EF63A; Sat, 21 Jan 2012 11:13:34 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id tuNd-vJVmagK; Sat, 21 Jan 2012 11:13:33 +0100 (CET) Received: from [10.0.0.112] (nat3-133.ghnet.pl [91.150.222.133]) by smtp.semihalf.com (Postfix) with ESMTPSA id 116F2EF60F; Sat, 21 Jan 2012 11:13:33 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: Date: Sat, 21 Jan 2012 11:13:32 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <23CB6C35-9450-40BA-9FA3-37C44B328CA8@freebsd.org> <8042D895-3B3D-431E-ADCC-A150BDC838ED@kientzle.com> <7E53112E-DE29-4145-B597-D39AA77252C5@kientzle.com> To: Tim Kientzle X-Mailer: Apple Mail (2.1084) Cc: arm@FreeBSD.org, Mark Murray Subject: Re: FreeBSD and BeagleBone X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 10:30:39 -0000 On 2012-01-21, at 08:34, Tim Kientzle wrote: > On Jan 20, 2012, at 7:26 AM, Mark Murray wrote: >=20 >>> For the moment, I'm more curious about just how far I can push this >>> using FreeBSD tools only. >>=20 >> I've locally updated cross-(binutils|gcc|gdb) to the latest stable >> versions, and they seem to work really well for u-boot, OpenPilot and = a >> couple of other things. >=20 > Warner's pointer about "make xdev" helped a lot. >=20 > $ cd /usr/src && make xdev XDEV=3Darm XDEV_ARCH=3Darm >=20 > Then U-boot almost builds with >=20 > $ cd ~/u-boot > $ gmake CROSS_COMPILE=3Darm-freebsd- am335x_evm_config > $ gmake CROSS_COMPILE=3Darm-freebsd- >=20 > To actually get it to build, I've had to make two changes to U-Boot = sources: > * In config.mk, remove "-nostdinc" from CPPFLAGS > * In Makefile, add /usr/arm-freebsd/usr/lib/libc.a to PLATFORM_LIBS >=20 > The first fixes missing stddef.h, stdarg.h headers. (I'm not > sure why the -nostdinc works on Linux.) >=20 > The second is needed to resolve __umodsi3, __udivsi3, etc, > functions. (These might be defined in libgcc on Linux, and > there's some logic here to try to locate libgcc.) >=20 > With these, I've been able to rebuild u-boot for > the BeagleBone from TI's sources to add the "bootelf" > command. (The same changes seem to allow the current source > from denx.de to build on FreeBSD.) >=20 > But ubldr still won't run: >=20 > U-Boot# fatload mmc 0 0x80008000 ubldr > reading ubldr > 232591 bytes read > U-Boot# bootelf 0x80008000 > >=20 > Anyone else used U-Boot to run ubldr on Arm? Looking at memory addresses you use for loading etc. the problem you = might be hitting is with a linking address range: ubldr by default is = linked against 0x1000000, and the bootelf command would follow this = while parsing ELF and placing code/data in memory. If your system config = does not allow available RAM in this range it would crash / hang. If = this is the case, please try to adjust linking addr range in = sys/boot/arm/uboot/ldscript.arm to fit your layout and see if this = helps. Rafal