From owner-freebsd-ppc@FreeBSD.ORG Thu Jul 24 12:17:39 2008 Return-Path: Delivered-To: powerpc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4058106567F for ; Thu, 24 Jul 2008 12:17:39 +0000 (UTC) (envelope-from philip.s.schulz@googlemail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by mx1.freebsd.org (Postfix) with ESMTP id 9077F8FC19 for ; Thu, 24 Jul 2008 12:17:39 +0000 (UTC) (envelope-from philip.s.schulz@googlemail.com) Received: by an-out-0708.google.com with SMTP id b33so962557ana.13 for ; Thu, 24 Jul 2008 05:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=8oiekoNPu0RRdZzzra+Iubgx8sAz97vE/8cqWOv5D7E=; b=VeIhnlh+KHbDqi3045F9pjxP8VvUxO5NwhHn9aXzhuzelfAO8BtXf4CGIBurRTr1nc eESGBnZMMyGl/7cO0Sx4MGsuWHVtWNerWeBjWq/zjdhLmnO3D1pH7tLC7ZTkBVdEo/Al 7OEB2Tp4bkNhP0qWowgzsTSTB9al8F+eO9D4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=cxTh3EgIx1gcO7oMVdTd6ucD+ch+6w3UkXw1Sq1BU25HyXYkLTRAAw0asWD1Dz/v3P 0O4b3fdv9hQMPKRaefdyq7/cmNUQ5UBcZuqcvAOeEE5QzSHwWuTzN8CyDidMhFgNTWYX gtuNty1iqn8GNWs2unWoEbgpuyrRPKQrAbLD4= Received: by 10.100.140.15 with SMTP id n15mr317716and.110.1216900294062; Thu, 24 Jul 2008 04:51:34 -0700 (PDT) Received: by 10.100.121.14 with HTTP; Thu, 24 Jul 2008 04:51:33 -0700 (PDT) Message-ID: <1c66db910807240451n5c181956rfe82b2ba4e80c5ae@mail.gmail.com> Date: Thu, 24 Jul 2008 13:51:33 +0200 From: "Philip Schulz" To: "M. Warner Losh" In-Reply-To: <20080723.213817.1661913390.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080723.164741.163264646.imp@bsdimp.com> <20080723.213817.1661913390.imp@bsdimp.com> Cc: powerpc@freebsd.org Subject: Re: Device trees 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: Thu, 24 Jul 2008 12:17:40 -0000 2008/7/24 M. Warner Losh : > In message: > Benno Rice writes: > : > : On 24/07/2008, at 8:47 AM, M. Warner Losh wrote: > : > : > Does FreeBSD/powerpc on the MPC85xx machine use the fake device open > : > firmware tree stuff from uboot (aka dts in the linux kernel sources)? > : > : I've got a machine (Mikrotik RouterBOARD 333, uses MPC8321) that has > : this. I've been working with one of the dtc developers to port their > : code over to FreeBSD. > > Cool! > > : I'm trying to hide it underneath our existing > : OpenFirmware stuff. I've got a few more bugs to get out of it but I > : can probably send you some patches early next week... > > That's basically what Linux does. They force the boot loader to pass > in all kinds of information about the system. This makes a lot of > sense, I think. > Unless I misunderstood what you guys said, I think it should be done the other way around. It's my understanding that Linux always uses the FDT internally. If it finds that it's being booted from a full Open Firmware implementation with device tree, it will first parse the device tree and convert it to an FDT. That way, Linux doesn't have to do any client interface calls once it's past the device tree parsing stage. I think that's good, see below. > Are you booting /boot/loader? Or directly booting the kernel from > uboot? > > In message: <106CEF8A-EA8A-48BC-BAF7-B9C112F58A92@mac.com> > Marcel Moolenaar writes: > : No, it doesn't. > > Is there any reason it doesn't? Having looked at the dtc stuff, it > seems to have all the requirements of device enumeration that we > talked about at BSDcan... > Don't know what happened at BSDcan, but... Since the FDT encodes pretty much all information the full device tree does, but doesn't provide the methods, I don't see a problem with device enumeration in FreeBSD. I.e. all devices that appear in the full device tree would also appear in the FDT, but you can't use their methods. So while this may be a problem for the FreeBSD loader, it certainly shouldn't be for the kernel. I personally think that the Linux design makes a lot of sense and I think that you should hide the real Open Firmware device tree behind the flattened device tree (FDT). From my point of view, doing so will prepare and strengthen FreeBSD on the embedded PowerPC front and also, as Nathan noted, simplify ports to other PowerPC-based platforms. Regards, Philip