From owner-freebsd-arm@FreeBSD.ORG Tue Mar 31 23:08:18 2009 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 EC3901065672 for ; Tue, 31 Mar 2009 23:08:18 +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 72F038FC19 for ; Tue, 31 Mar 2009 23:08:16 +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.3/8.14.3) with ESMTP id n2VN9lsu008633; Wed, 1 Apr 2009 01:09:47 +0200 (CEST) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.14.3/8.14.3/Submit) id n2VN9kWg008632; Wed, 1 Apr 2009 01:09:46 +0200 (CEST) (envelope-from mlfbsd) Date: Wed, 1 Apr 2009 01:09:45 +0200 From: Olivier Houchard To: Guillaume Ballet Message-ID: <20090331230945.GA8584@ci0.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Cc: freebsd-arm@freebsd.org Subject: Re: locore.S question 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: Tue, 31 Mar 2009 23:08:19 -0000 On Wed, Mar 25, 2009 at 03:06:49PM +0100, Guillaume Ballet wrote: > Hello list, > Hi Guillaume, > I'm working on a FreeBSD port for the BeagleBoard. I'm starting the > kernel with u-boot and wrote my own small loader for this purpose. > That loader puts the kernel at 0x81000000 (physical address, since the > MMU is disabled at this stage). > Nice to hear you're working on that port :) > In locore.S, however, there is the following piece of code that is > executed before the MMU is disabled: > > 112 adr r7, Lunmapped > 113 bic r7, r7, #0xff000000 > 114 orr r7, r7, #PHYSADDR > > (snip, disabling MMU) > > 129 mov pc, r7 > > Since PHYSADDR is set to 0x80000000 (physical start of RAM), then r7 > is set to 0x80000000 + offset(Lunmapped) instead of 0x81000000 + > offset(Lunmapped). Of course it crashes. > > Now, bypassing the problem is relatively easy, but still I was > wondering why it is 0xff000000 instead of 0xf0000000 on line 113? > Honestly, I may have had a reason at some point, but can't remember which. So I went ahead and just committed the change, I doubt it will be a problem. Thanks for working on this ! Olivier