Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 17:26:55 +0100
From:      Olivier Houchard <mlfbsd@ci0.org>
To:        Rafal Jaworowski <raj@semihalf.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: ARM9E issues
Message-ID:  <20071128162655.GA27260@ci0.org>
In-Reply-To: <474D8345.30505@semihalf.com>
References:  <474D8345.30505@semihalf.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071128162655.GA27260>