From owner-freebsd-arm@FreeBSD.ORG Wed Nov 28 15:32:14 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FE816A417 for ; Wed, 28 Nov 2007 15:32:14 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (dong.ci0.org [IPv6:2001:7a8:2066:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 41B5013C45B for ; Wed, 28 Nov 2007 15:32:12 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (localhost.ci0.org [127.0.0.1]) by dong.ci0.org (8.14.1/8.13.8) with ESMTP id lASGQuob027533; Wed, 28 Nov 2007 17:26:56 +0100 (CET) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.14.1/8.13.8/Submit) id lASGQtfF027532; Wed, 28 Nov 2007 17:26:55 +0100 (CET) (envelope-from mlfbsd) Date: Wed, 28 Nov 2007 17:26:55 +0100 From: Olivier Houchard To: Rafal Jaworowski Message-ID: <20071128162655.GA27260@ci0.org> References: <474D8345.30505@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <474D8345.30505@semihalf.com> User-Agent: Mutt/1.4.1i Cc: freebsd-arm@freebsd.org Subject: Re: ARM9E issues X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 15:32:14 -0000 Hi Rafal, On Wed, Nov 28, 2007 at 04:03:33PM +0100, Rafal Jaworowski wrote: > Hi, > > When trying to produce code for ARM9E variant I encountered the following > issues with building kernel: > > 1. Per earlier discussion with Warner, the CPU_ARM9E is supposed to be > mutually exclusive with CPU_ARM9 or other cpu idents, but there are some fixes > needed to build with CPU_ARM9E alone -- see attached arm9e_cpufuncs-fix.diff. > I'll take care of this. Thanks ! > 2. When the kernel is built with -mcpu=arm9e the low-level routines > (bcopy_page(), bzero_page() and friends) fail to assemble: > > src/sys/arm/arm/bcopy_page.S:190: Error: selected processor does not support > `pld [r0]' > src/sys/arm/arm/bcopy_page.S:195: Error: selected processor does not support > `pld [r0,#0x18]' > ... > ... > > Those problematic instructions appear within _ARM_ARCH_5E conditionals, which > confused me a lot since -mcpu=arm9e should be compliant with v5te, right? Upon > further investigation and comparison with equivalent NetBSD code I noticed > that all those conditional sections we now have _ARM_ARCH_5E'ed originally > were __XSCALE__ conditionals... When I revert _ARM_ARCH_5E -> __XSCALE__ > (xscale_v5te-low_level.diff) the kernel builds with -mcpu=arm9e (no assembly > errors) and works. > > I assume we have imported the NetBSD base, so what was the reason for this > conditionals change? Were all those sections of code considered to work on any > v5te and not only Xscale? > > Maybe what I'm seeing is some FreeBSD/arm toolchain problem. I'll look into > this further, but any comments or hints are appreciated. > This is a bug in gas. pld should work for ARM_ARCH_5E, however when you specify -mcpu=arm9e to gas, due to the way it works (by parsing its cpu list and doing a strncmp(list->cpuname, nameprovided, strlen(nameprovided)), it will match arm9e-r0, which is not armv5e. I don't know if this has been fixed in later revisions of binutils, I should check. As a workaround, you can compile your kernel with "-DCPU_ARM9E -march=armv5te" instead. Regards, Olivier