From owner-freebsd-arm@FreeBSD.ORG Sat Sep 27 20:43:56 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371C231A for ; Sat, 27 Sep 2014 20:43:56 +0000 (UTC) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::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 E9EDDF83 for ; Sat, 27 Sep 2014 20:43:55 +0000 (UTC) Received: by mail-qg0-f54.google.com with SMTP id a108so10437045qge.27 for ; Sat, 27 Sep 2014 13:43:55 -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=bLtibDjrkkE/vE9SnWa1c9Bxi9vTGyUhl4RUhZsqwog=; b=cYicghjpnQE/eERtigyqmrggojPr6ZWg++ppD1x6ksfdUZKD8NXHHhnR+0XN6VKpqu X87J9w0KKrAV5VZaoxoYH9LykyJMERfuO9PcszO+3sh3+iuWl6C6hmC7T0rkBaIDoNgk hYQkzxH0Sg/v6zDAZLe/BPgt0oRwOKihMBLP8z9uofv05wTCaOO4G4lfSs/7Poa4JXqA swtWaRVJPi0TTFr9VWB4EYHBBdAw5ZnZQ5TBm5ddowdqS7vqP9ZoEzfuF95JAYxgem49 CsitHEAIbvWM37LsASujbMelCQGb16GqgHXYvBBeWaKu8CdeA2vemaoMiYAUJFgIwyYk ytUA== MIME-Version: 1.0 X-Received: by 10.224.120.193 with SMTP id e1mr26295900qar.80.1411850635073; Sat, 27 Sep 2014 13:43:55 -0700 (PDT) Received: by 10.140.154.15 with HTTP; Sat, 27 Sep 2014 13:43:55 -0700 (PDT) In-Reply-To: References: Date: Sat, 27 Sep 2014 13:43:55 -0700 Message-ID: Subject: Re: Digi CCWMX53 From: Russell Haley To: Tim Kientzle , Rui Paulo 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: Sat, 27 Sep 2014 20:43:56 -0000 Tim, I'm trying to build from head because the Digi configuration only seems to exist there. Unfortunately the last couple of checkouts I've done haven't built. Can you recommend a good working revision or should I ask this on the current mailing list? On Sat, Sep 27, 2014 at 1:19 PM, Russell Haley wrote: > Tim, > > Thanks, that's clarified a large number of my hanging questions. > > I thought I had read that clang didn't support cross compiling arm for > freebsd in 10. Is this true? > > I should have some more shortly! > > 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 >> >> >