Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jan 2012 23:34:00 -0800
From:      Tim Kientzle <tim@kientzle.com>
To:        arm@FreeBSD.org
Cc:        Mark Murray <markm@FreeBSD.org>
Subject:   Re: FreeBSD and BeagleBone
Message-ID:  <AEF07CD1-6794-4F04-AF9C-938423FE919B@kientzle.com>
In-Reply-To: <E1RoGMT-000DkR-6a@groundzero.grondar.org>
References:  <23CB6C35-9450-40BA-9FA3-37C44B328CA8@freebsd.org> <CABt%2Bj0mB4w==h_SQ4YyDM24_wGOjcdZDK9T1N3DqjSkap0VkQw@mail.gmail.com> <E8A24EBE-967D-44F8-A884-3207B3C6F0FE@bsdimp.com> <8042D895-3B3D-431E-ADCC-A150BDC838ED@kientzle.com> <CAGW5k5ahyaTest3L0NTe1t%2B%2BYBgpLMkWZNpp=GRyz%2Bg=nMcZLg@mail.gmail.com> <7E53112E-DE29-4145-B597-D39AA77252C5@kientzle.com> <E1RoGMT-000DkR-6a@groundzero.grondar.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 20, 2012, at 7:26 AM, Mark Murray wrote:

>> For the moment, I'm more curious about just how far I can push this
>> using FreeBSD tools only.
> 
> 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.

Warner's pointer about "make xdev" helped a lot.

$ cd /usr/src && make xdev XDEV=arm XDEV_ARCH=arm

Then U-boot almost builds with

$ cd ~/u-boot
$ gmake CROSS_COMPILE=arm-freebsd-  am335x_evm_config
$ gmake CROSS_COMPILE=arm-freebsd-

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

The first fixes missing stddef.h, stdarg.h headers.  (I'm not
sure why the -nostdinc works on Linux.)

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.)

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.)

But ubldr still won't run:

U-Boot# fatload mmc 0 0x80008000 ubldr
reading ubldr
232591 bytes read
U-Boot# bootelf 0x80008000
<hang>

Anyone else used U-Boot to run ubldr on Arm?

Tim




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AEF07CD1-6794-4F04-AF9C-938423FE919B>