From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 31 21:38:40 2007 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A8816A421 for ; Mon, 31 Dec 2007 21:38:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id A228B13C461 for ; Mon, 31 Dec 2007 21:38:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8q) with ESMTP id 226843185-1834499 for multiple; Mon, 31 Dec 2007 16:41:01 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id lBVLcQhI099591; Mon, 31 Dec 2007 16:38:29 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Marcel Moolenaar Date: Mon, 31 Dec 2007 16:06:24 -0500 User-Agent: KMail/1.9.6 References: <200712281500.55155.jhb@freebsd.org> <2ADEF6FE-DC65-489A-A948-81E1A0455CA7@juniper.net> In-Reply-To: <2ADEF6FE-DC65-489A-A948-81E1A0455CA7@juniper.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200712311606.25424.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 31 Dec 2007 16:38:29 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5311/Mon Dec 31 12:05:08 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-embedded@freebsd.org Subject: Re: ocpbus(4) X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2007 21:38:40 -0000 On Friday 28 December 2007 04:49:59 pm Marcel Moolenaar wrote: > > On Dec 28, 2007, at 12:00 PM, John Baldwin wrote: > > >> Hints can be used to implement the device tree or > >> device list, but is rather limited. I'd like us to > >> implement something richer in the future. For that > >> reason I don't want to expose hints to the driver, > >> but rather abstract the implementation of the device > >> tree or the device list behind IVARs. That makes it > >> possible to implement the "bus" in many different > >> ways without having to change the device drivers that > >> attach to the bus. > > > > So to jump in here. I've been thinking more since the last hints > > debacle and > > am thinking of replacing hints with the generic device metadata we'd > > discussed some at the end of the last thread: > > > > device.FOO.= > > > > where any driver or unit wiring is a new property rather than > > encoded into > > FOO's name. Thus: > > > > device.COM1.at=isa0 > > device.COM1.irq=4 > > device.COM1.port=0x3f8 > > device.COM1.driver=sio > > device.COM1.unit=0 > > > > or some such. > > Just a comment: there's a lot of value in taking a look at language > and DB theory. Both syntax and semantics can be very important > properties in the applicability and success of the new description. > Yes, we may want to be able to compile it into some binary form > for embedding it into the kernel... > > For example: busses may nest and may need to be described. This > is especially true in the embedded space. The e500 has a local > bus within the CCSR, which may contain i2c busses for example. > > Using the hints-way of describing hardware is just not going to > fly in that case, because you're still keying off of device names > and unit numbers. Let that be a consequence of the metadata, not > an integral part of... (device.COM1.* does exactly that). Redo the 'at' hints like this (pci was already this way in the existing hint wiring stuff anyway, i.e. it's _not_ a new-bus device name in 'at'). I'll use all-caps to make it stand out: device.COM1.at=ISA device.USBA.at=PCI0:4:0 // domain 0 is implicit if not specified device.FOO.at=BAR Bus drivers would be responsible for parsing the 'at' and deciding whether or not to "claim" a set of device properties. They may then either bind those properties to an existing device enumerated elsewhere (ACPI/PNPBIOS/PCI) based on 1 or more property values or create a new device entirely described by the property values. You could even support something like this: device.BAR.at=PCI0.13.0 device.FOO.at=BAR:42 If you wanted if the driver for 'BAR' (or a child device that was a bus if the PCI device_t is not a bus itself) by letting the driver for BAR query it's "property name" and use that when evaluating "at". Some other possible locations (which is what "at" is in this context): device.COM1.at=ACPI:_SB_.PCI0.LPC0.COMA (and possibly it could take the short name as well:) device.COM1.at=ACPI:COMA -- John Baldwin