From owner-freebsd-arm@FreeBSD.ORG Fri Jun 13 16:15:29 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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B023E25 for ; Fri, 13 Jun 2014 16:15:29 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEA02BD1 for ; Fri, 13 Jun 2014 16:15:28 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WvU8V-000PUy-8U; Fri, 13 Jun 2014 16:15:27 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s5DGFLrr002771; Fri, 13 Jun 2014 10:15:21 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19nWNuytGyrzAn/W3QuU+UJ Subject: Re: Compilation for ARM From: Ian Lepore To: Stepan Dyatkovskiy In-Reply-To: <539A62E2.20003@narod.ru> References: <53935D02.2030604@narod.ru> <6D7645D2-9C08-4B5D-BAA5-5B6EC8F66F0B@kientzle.com> <5393FF7B.4020407@narod.ru> <1402428857.20883.177.camel@revolution.hippie.lan> <5398B1A2.3010007@narod.ru> <1402591005.20883.213.camel@revolution.hippie.lan> <539A2261.4070705@narod.ru> <539A62E2.20003@narod.ru> Content-Type: text/plain; charset="us-ascii" Date: Fri, 13 Jun 2014 10:15:21 -0600 Message-ID: <1402676121.20883.231.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Tim Kientzle , freebsd-arm@FreeBSD.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 16:15:29 -0000 On Fri, 2014-06-13 at 08:33 +0600, Stepan Dyatkovskiy wrote: > Hi all, > > Currently I'm trying to compile kernel, with activated cortex-a9 or a15 > options (TARGET_CPUTYPE=cortex-a9). > Currently "as" from buildworld gives me tons of "unknown instruction" > errors. That happens, I suppose, due to its release date (2007). > It makes no sense that you are getting such problems. I've never used TARGET_CPUTYPE at all, and there's no problem compiling the kernel with the tools in base. All you need to build the kernel is make buildkernel TARGET_ARCH=armv6 KERNCONF=PANDABOARD -- Ian > So I have tried newer versions of binutils: > 1. devel/cross-binutils from ports. I have built it with TGTARCH=armv6 > and TGTABI=none-eabi. > 2. Binutils from http://ftp.gnu.org/gnu/binutils/ > > I did it in several steps: > 1. I have built them. > 2. I have entered buildenv: "make TARGET_CPUTYPE=armv6 buildenv" > 3. # which as > 4. # cp /usr/obj/arm.armv6/usr/src/tmp/usr/bin/as > /usr/obj/arm.armv6/usr/src/tmp/usr/bin/as.bak > > Below I tried several ways to replace as/ld/and-friends: > 5. cp /usr/local/bin/armv6-none-eabi-as > /usr/obj/arm.armv6/usr/src/tmp/usr/bin/as > 6. I have also tried "ln -s" > > 7. # make KERNCONF=PANDABOARD TARGET_CPUTYPE=cortex-a9 buildkernel > > Whatever I did, it always ended up with > > /usr/src/sys/arm/arm/locore.S: Assembler messages: > /usr/src/sys/arm/arm/locore.S:79: Error: duplicate .fnstart directive > /usr/src/sys/arm/arm/locore.S:255: Error: .fnend directive without .fnstart > > So, may be, you guys know how to deal with that? > > Currently I have no idea :-(.. May be sleep a bit :-) > > Thanks! > > -Stepan > > Stepan Dyatkovskiy wrote: > > Hi all, > > > > Thanks for advices! > > > > That's interesting. I have managed to launch kernel, using these u-boot > > binaries: > > http://people.freebsd.org/~gonzo/pandaboard/ > > > > Looks like specific MLO. But I'm not sure. > > > > With regular linaro u-boot, I load kernel.bin, then try start it with > > "go", and nothing happens. With binaries of this Gonzo guy, I did the > > same, and everything works fine :-/ Do you know who is it (I mean > > Gonzo)? I would like to ask him, what he did in his binaries. > > > > Another question: > > I would like to build FreeBSD, using latest clang. Currently I have > > tried to build it latest svn version of FreeBSD: > > svn://svn.freebsd.org/base/head/ > > With command: > > make TARGET_ARCH=armv6 buildworld TARGET_CPUTYPE=cortex-a9 > > > > But got next error (repeated several > > times):/tmp/jemalloc_atomic-22cc38.s:21: Error: garbage following > > instruction -- `dmb ish' > > > > So perhaps, its better to use stable version (10.0.0), but with new > > clang. Currently, I'm going to copy clang sources from HEAD into 10.0.0 > > sources tree. But perhaps there is better way to do it? > > > > Thanks! > > > > -Stepan > > > > Ian Lepore wrote: > >> On Thu, 2014-06-12 at 01:44 +0600, Stepan Dyatkovskiy wrote: > >>> Hi guys, > >>> Thank you! I have built it successfully. It was really simple. Currently > >>> I'm trying to launch with u-boot. Are here any instructions/manual how > >>> to run kernel with u-boot? > >>> Thanks! > >>> -Stepan > >> > >> If you compile the dtb into the kernel, you can launch the kernel > >> directly from u-boot. If you don't, then you need u-boot to launch > >> ubldr (loader(8) that uses the u-boot API, which requires a u-boot with > >> the API option enabled). > >> > >> The kernel can be loaded at any 1MB-boundary address, and can be > >> launched by jumping to the load address + 0x100, such as: > >> > >> fatload 11000000; go 11000100 > >> > >> If you are using a modern u-boot that enables data caches, you need to > >> turn them off manually, like: > >> > >> fatload 11000000 > >> dcache off; dcache flush > >> go 11000100 > >> > >> This is just a u-boot quirk, it disables caches on bootm and bootelf > >> commands, but not on a "go" command. > >> > >> -- Ian > >> > > >