From owner-freebsd-ppc@FreeBSD.ORG Mon Feb 23 14:02:24 2009 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D21FB106566C for ; Mon, 23 Feb 2009 14:02:24 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id 92F8F8FC17 for ; Mon, 23 Feb 2009 14:02:24 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id n1NE2M2J005851; Mon, 23 Feb 2009 07:02:23 -0700 Message-ID: <49A2AC6D.80208@semihalf.com> Date: Mon, 23 Feb 2009 15:02:21 +0100 From: Rafal Jaworowski Organization: Semihalf MIME-Version: 1.0 To: Aleksey V Fedorov References: <49A2704F.4060703@semihalf.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-ppc@freebsd.org Subject: Re: boot process X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Feb 2009 14:02:25 -0000 Aleksey V Fedorov wrote: > On Mon, 23 Feb 2009, Rafal Jaworowski wrote: > >> 2. Hack e500_init() routine in the kernel to hard code some config >> data it >> normally gets from loader, like physical RAM size, memory regions >> number etc., >> CCSR base address, CCB clock frequency, maybe something more, see >> e500_init() >> for details. > > > I see that CCSRBAR address is hardcoded in vmparam.h > > /* > * Kernel CCSRBAR location. We make this the reset location. > */ > #define CCSRBAR_VA 0xfef00000 This is the final virtual address the CCSR region gets remapped to by the kernel initialization code. It shouldn't be altered unless you really need to lay out the virtual map differently. > #define CCSRBAR_SIZE 0x00100000 > > Who change them: loader(8) or U-boot ? > In Linux dts it's on another address: > > # grep CCSRBAR *.dts > mpc8540ads.dts: reg = ; // CCSRBAR 1M > mpc8541cds.dts: reg = ; // CCSRBAR 1M > mpc8544ds.dts: reg = ; // CCSRBAR 1M > mpc8548cds.dts: reg = ; // CCSRBAR 1M > mpc8555cds.dts: reg = ; // CCSRBAR 1M What you have to provide manually for the e500_init() routine is the initial location of the CCSR range, as left by the firmware at the time it passed control to the kernel; based on this the init code remaps it into the final CCSR location (above). I don't recall if DTS exposes exactly this initial setting or the final, you need to verify how it's used by the Linux code. Rafal