From owner-freebsd-arm@FreeBSD.ORG Wed Oct 1 08:44:49 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41CBF3CD for ; Wed, 1 Oct 2014 08:44:49 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 165C4EB8 for ; Wed, 1 Oct 2014 08:44:48 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s918imRs056274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Oct 2014 01:44:48 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s918il7d056273; Wed, 1 Oct 2014 01:44:47 -0700 (PDT) (envelope-from jmg) Date: Wed, 1 Oct 2014 01:44:47 -0700 From: John-Mark Gurney To: Russell Haley Subject: Re: Digi CCWMX53 Message-ID: <20141001084447.GR43300@funkthat.com> Mail-Followup-To: Russell Haley , Tim Kientzle , freebsd-arm@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 01 Oct 2014 01:44:48 -0700 (PDT) Cc: Tim Kientzle , freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2014 08:44:49 -0000 Russell Haley wrote this message on Mon, Sep 29, 2014 at 20:14 -0700: > Tim, > > > FreeBSD source has an 'xdev' target that builds and installs a set of > cross-tools. In particular, it can install cross-versions of the same GCC > or clang used by the rest of FreeBSD. > > Where can I find more information on cross compiling on FreeBSD? check out: https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_FreeBSD Though MAKEOBJDIRPREFIX isn't required, and neither is TARGET... now using an external tool chain is a different topic.. > On Sat, Sep 27, 2014 at 11:53 AM, Tim Kientzle wrote: > > > > > On Sep 26, 2014, at 10:38 PM, Russell Haley wrote: > > > > > 1) Can anyone give me the correct u-boot enviroment variables or > > reference > > > to the u-boot process to boot the completed freebsd kernel. Specifically > > on > > > a CCWMX53 if possible, but I have linux references to port from. Where > > > would I look for an example? > > > > There are two general approaches being used: > > > > 1) Have U-Boot load and boot the kernel directly. This can sometimes be > > done with an unmodified Linux U-Boot. > > > > 2) Have U-Boot load FreeBSDs scriptable 'ubldr' and have that load the > > kernel. This provides more flexibility in the boot process but usually > > requires rebuilding U-Boot. In particular, you'll need to: > > * Add CONFIG_CMD_ELF option to U-Boot so it can load `ubldr' which is > > an ELF executable > > * Add CONFIG_CMD_API option to U-Boot so `ubldr' can access U-Boot's > > drivers for hardware access (`ubldr' itself has to be compiled for each > > board to adjust the load address but is otherwise completely generic). > > * Adjust the U-Boot startup scripts to set FDT environment variables > > and load ubldr. You can look at the U-Boot patches for various boards > > supported by Crochet to see how this has been done elsewhere: > > github.com/kientlze/crochet-freebsd > > > > > > > 2) Do I need to create a cross compiler? Reference 1 says yes, reference > > > two says no. Help! > > > > In most cases, the FreeBSD build system will build a cross-compiler for > > it's own use, so you generally don't need to install a cross compiler to > > cross-build FreeBSD proper. However, U-Boot is not part of FreeBSD so you > > may need to install a separate cross-compiler to build that. > > > > > > > > Ref.1 Build a cross compiler > > > https://wiki.freebsd.org/FreeBSD/arm/ArndaleBoard > > > > This is using a cross-compiler from ports to build U-Boot. It uses the > > FreeBSD build machinery to cross-build the FreeBSD kernel and world. (When > > you specify TARGET_ARCH, FreeBSD's 'buildworld' target will build and use a > > suitable cross-compiler. Also, 'buildkernel' will reuse the cross-compiler > > built by 'buildworld', so you do not need 'kernel-toolchain' as long as you > > 'buildworld' first.) > > > > > > > > Ref 2. No cross compiler/ make toolchain > > > https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_FreeBSD > > > > This example only talks about building *world*, and the 'buildworld' > > target builds the necessary cross-tools transparently. In particular, > > since it doesn't talk about building out-of-tree boot loaders such as > > U-Boot, it does not need to talk about building/installing an explicit > > cross-compiler. > > > > For cross-compilers, you have three options: > > * Ports. > > * After a successful buildworld, you can 'make TARGET=xyz ... buildenv' > > to get a shell with suitable path settings to reuse the cross-tools from > > the buildworld stage. Use 'buildenvvar' to just get the environment for > > use in scripts. > > * FreeBSD source has an 'xdev' target that builds and installs a set of > > cross-tools. In particular, it can install cross-versions of the same GCC > > or clang used by the rest of FreeBSD. This facility has changed a lot > > recently, so ask if you need the current command line. > > > > Hope this clarifies things, > > > > Tim > > > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."