From owner-freebsd-arm@FreeBSD.ORG Tue Sep 30 03:14:26 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 192EC3A5 for ; Tue, 30 Sep 2014 03:14:26 +0000 (UTC) Received: from mail-yh0-x236.google.com (mail-yh0-x236.google.com [IPv6:2607:f8b0:4002:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D115EE3C for ; Tue, 30 Sep 2014 03:14:25 +0000 (UTC) Received: by mail-yh0-f54.google.com with SMTP id f10so2846351yha.27 for ; Mon, 29 Sep 2014 20:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YfmvJ9OHBjgX3pJpxv1mXq2k/jZfGrTaPVaHftsg6Ts=; b=ftqp5gplYplpnGCp+kteR8FKq1gZAyhtx2m9PGSEUXeWO9MCTZCwKrYXnQAm9EAnY5 SUO7v+lQTRJvlz+2NW4vciottVvABZcP9mGPBKeUup60Ud+kcMgWNYxjdEU/JujBhXsL 21Im4y4zuqc6XyNE3sfAwTgx+gNZC4YSL7fD4JW3pvjMh+Wr0H2f0Rx35cQQRBg8QfRa GjngfUqSZK6bPrRy+gR0Ve3+RJFj9EM7rValLY2kW/fVkM2vo67p7Fup8NMJzMyL3x6c mLbteR9Y3cmkfxBgGxRTz7Fp6pqtbcLLn9C7XZhqL4fyTRLs0djTRHxePvD3d/Z6QTMv ioDg== MIME-Version: 1.0 X-Received: by 10.236.1.167 with SMTP id 27mr62181868yhd.21.1412046864822; Mon, 29 Sep 2014 20:14:24 -0700 (PDT) Received: by 10.170.208.13 with HTTP; Mon, 29 Sep 2014 20:14:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Sep 2014 20:14:24 -0700 Message-ID: Subject: Re: Digi CCWMX53 From: Russell Haley To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: 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: Tue, 30 Sep 2014 03:14:26 -0000 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? Thanks Russ 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 > >