From owner-freebsd-ppc@FreeBSD.ORG Wed Feb 25 09:39:53 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 854F51065673 for ; Wed, 25 Feb 2009 09:39:53 +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 5F2788FC16 for ; Wed, 25 Feb 2009 09:39:53 +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 n1P9dpD9028395; Wed, 25 Feb 2009 02:39:51 -0700 Message-ID: <49A511E5.1010705@semihalf.com> Date: Wed, 25 Feb 2009 10:39:49 +0100 From: Rafal Jaworowski Organization: Semihalf MIME-Version: 1.0 To: Aleksey V Fedorov References: <49A2704F.4060703@semihalf.com> <49A42369.600@freebsd.org> 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: Wed, 25 Feb 2009 09:39:53 -0000 Aleksey V Fedorov wrote: > On Tue, 24 Feb 2009, Nathan Whitehorn wrote: > >>> What is regular method to allocate some piece of memory in >>> e500_init() for unflatten device tree structures? Board loader >>> provide pointer to to the device-tree block in r3(i.e. void *mdp >>> argument of e500_init()). >>> I can parse them, but where to store tree at this point? >> >> FreeBSD currently does not support the flattened device trees used by >> Linux. Instead, it uses a hardcoded set of board information, which >> will do fine as a temporary solution. >> >> If you wish to add support, I would suggest looking at how the PowerPC >> AIM code uses Open Firmware to obtain boot parameters, and also at the >> Open Firmware interface layer (as implemented, for example, in >> sys/dev/ofw/ofw_standard.c). This is something I've been meaning to do >> for some time in order to facilitate a Cell port. > > I know how to obtain parameters. > My question is how to store them at early boot? > For example is it possible to store them in the rest of 16MB page > after kernel and device-tree block? > > kernel start = 0xc0000100 > kernel end = 0xc0528a18 > device-tree block start = 0xc0800800 > device-tree block end = 0xc080168e > > Is it safe to store unflatten device tree after 0xc080168e ? > Is the rest of 16MB page retain unchaged or it can be used later? I'm not sure where these device-tree addresses come from, but in general you have to be very careful about placing things at this early stage of kernel initialization. You cannot arbitrarily use some range, but need to carve out an area from the available region(s), so that it is not used for other purposes. There is a number of important data located after kernel [ELF] end, see mmu_booke_bootstrap() for details about the layout. Rafal