From owner-freebsd-embedded@FreeBSD.ORG Sat Oct 11 13:12:11 2008 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED651065692 for ; Sat, 11 Oct 2008 13:12:11 +0000 (UTC) (envelope-from outbackdingo@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id D37378FC15 for ; Sat, 11 Oct 2008 13:12:10 +0000 (UTC) (envelope-from outbackdingo@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so626806fgb.35 for ; Sat, 11 Oct 2008 06:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=qmdDI43fygntNaGVLKAOexuqwgJmR2pshwWvQdfDhXI=; b=Aoo+yU83bUAOPhtLIX/L6MCsPgbITpUYAk7pf6N0d/yIangj4dTdLeLb6lLiUdM9MW P3Hia8RHV6Q+qNrNnl2JpVBEbZltK98RrVvnIBw02A5Bme040TI7WruEidk1pDo/q1jB jRzMMfbKk6Q5JtyM9TRgpBrfUaVH181bPVXHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=NLXpFXM3RzsK6wZNikdp1jbuUd2k2b+q2YW2fXjMOCvG455KVPXlWLoc+SUW3SwgxS 06OsB5/ygB0vKJ8xwrTaSmSR/z/Il3dnyFyzYUQrme330AD8btlFpo1Ov8KA1FQdB0ol kpB009cpiBeZScwsi606xdmVaWykMr0bGVmOI= Received: by 10.181.59.6 with SMTP id m6mr2855967bkk.20.1223730729437; Sat, 11 Oct 2008 06:12:09 -0700 (PDT) Received: by 10.181.32.13 with HTTP; Sat, 11 Oct 2008 06:12:09 -0700 (PDT) Message-ID: <5635aa0d0810110612l4a5abf79ic2394885d865c888@mail.gmail.com> Date: Sat, 11 Oct 2008 20:12:09 +0700 From: "Outback Dingo" To: "Bruce M. Simpson" In-Reply-To: <48F099D4.2050302@incunabulum.net> MIME-Version: 1.0 References: <48F099D4.2050302@incunabulum.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-embedded@freebsd.org Subject: Re: HOWTO: Build NSLU2 U-Boot on FreeBSD X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2008 13:12:11 -0000 I know its a bit off topic but it would be nice to see FreeBSD running on some other pieces of equiptment like a Ubiquiti NS2 or PS2 On Sat, Oct 11, 2008 at 7:19 PM, Bruce M. Simpson wrot= e: > Thanks to Rink Springer and Rafal Jaworowski. > > ---------------------- > > Building NSLU2 U-boot firmware on FreeBSD hosts > > Quick start > > Make sure you have a JTAG adapter as a get-out-of-jail-free card in case > you trash the flash, "portinstall devel/urjtag" to get a driver for it. > Recommend getting one like the Olimex OCD as it has heaps more useful > functionality than just rewriting the flash, and should also work with > OpenOCD. > > Toolchain setup > > cd /usr/ports/devel/cross-binutils > env TGTARCH=3Darm TGTABI=3Drtems make install > > cd /usr/ports/devel/cross-gcc > env TGTARCH=3Darm TGTABI=3Drtems make install > > Get stas@FreeBSD.org's updated u-boot tarball: > uboot-atamantb.tar.bz2 > Untar it > > Fetch NSLU2 patch set from NSLU2-Linux: > > http://trac.nslu2-linux.org/kernel/browser/trunk/patches/u-boot/0001-ixp-= Support-for-NSLU2.patch > > Apply (patch -p1) inside uboot-atamantb. > > Apply Ix*.diff (provided) inside cpu/ixp/npe. > U-Boot doesn't grok being built for an RTEMS target, > so it needs some sweet lovin'. > > Fetch encumbered NPE microcode from Intel: > http://downloadcenter.intel.com/ > Search for IPL_IXP400NPELIBRARY-2_1.ZIP > (Yes yes, I know, we can't redistribute it, for now anyway...there will > be a workaround) > > Unzip... > Copy ./cpu/ixp/npe/IxNpeMicrocode.c.orig into uboot-atamantb/cpu/ixp/npe= =B7 > > Remove mkimage from tools/Makefile (it needs rentokil to build on FreeBSD= ; > and besides, you can use "portinstall devel/u-boot" to get mkimage) > > Now: > > env CROSS_COMPILE=3Darm-rtems- gmake distclean > env CROSS_COMPILE=3Darm-rtems- gmake nslu2_config > env CROSS_COMPILE=3Darm-rtems- gmake > > Voila, you should have u-boot firmware images, which you can now use to > reflash an NSLU2. > > > > --- ./cpu/ixp/npe/include/IxOsalEndianess.h.orig 2008-10-03 > 12:11:18.000000000 +0100 > +++ ./cpu/ixp/npe/include/IxOsalEndianess.h 2008-10-03 > 13:11:48.000000000 +0100 > @@ -59,6 +59,32 @@ > /* get ntohl/ntohs/htohl/htons macros definitions for WinCE */ > #include > > +#elif defined (__rtems__) > + > +# ifdef htonl > +# undef htonl > +# endif > +# ifdef ntohl > +# undef ntohl > +# endif > + > +# if BYTE_ORDER =3D=3D BIG_ENDIAN > + > +# define ntohl(a) (a) > +# define htonl(a) (a) > +# elif BYTE_ORDER =3D=3D LITTLE_ENDIAN > +# define SWAP_LONG(x) \ > + ((__u32)( \ > + (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \ > + (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \ > + (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \ > + (((__u32)(x) & (__u32)0xff000000UL) >> 24) )) > +# define ntohl(a) SWAP_LONG(a) > +# define htonl(a) SWAP_LONG(a) > +# else > +# error meep > +# endif > + > #else > > #error Unknown OS, please add a section with the include file for > htonl/htons/ntohl/ntohs > @@ -123,6 +149,14 @@ > > #define IX_OSAL_WINCE_LE > > +#elif defined (__rtems__) && defined (__BIG_ENDIAN) > + > +#define IX_OSAL_LINUX_BE /* XXX */ > + > +#elif defined (__rtems__) && defined (__BIG_ENDIAN) > + > +#define IX_OSAL_LINUX_LE /* XXX */ > + > #else > > #error Unknown OS/Endianess combination - only vxWorks BE LE, Linux BE L= E, > WinCE BE LE are supported > > --- ./cpu/ixp/npe/include/IxOsalMemAccess.h.orig 2008-10-03 > 13:24:52.000000000 +0100 > +++ ./cpu/ixp/npe/include/IxOsalMemAccess.h 2008-10-03 > 13:26:07.000000000 +0100 > @@ -324,7 +324,9 @@ > > #endif /* wince */ > > -#if defined (__vxworks) || (defined (__linux) && defined > (IX_OSAL_STATIC_MEMORY_MAP)) || \ > +#if defined (__vxworks) || \ > + defined (__rtems__) || \ > + (defined (__linux) && defined > (IX_OSAL_STATIC_MEMORY_MAP)) || \ > (defined (__wince) && defined > (IX_OSAL_STATIC_MEMORY_MAP)) > > #define IX_OSAL_READ_LONG_IO(wAddr) > IX_OSAL_READ_LONG_RAW(wAddr) > > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.or= g > " > >