From owner-freebsd-embedded@FreeBSD.ORG Tue Jan 1 20:33:55 2008 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 0C5FC16A419 for ; Tue, 1 Jan 2008 20:33:55 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from smtpoutm.mac.com (smtpoutm.mac.com [17.148.16.77]) by mx1.freebsd.org (Postfix) with ESMTP id E9B4513C447 for ; Tue, 1 Jan 2008 20:33:54 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from mac.com (asmtp006-s [10.150.69.69]) by smtpoutm.mac.com (Xserve/smtpout014/MantshX 4.0) with ESMTP id m01K9qcM005228; Tue, 1 Jan 2008 12:09:52 -0800 (PST) Received: from [192.168.1.100] (209-128-86-226.bayarea.net [209.128.86.226]) (authenticated bits=0) by mac.com (Xserve/asmtp006/MantshX 4.0) with ESMTP id m01K9owR017311 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 1 Jan 2008 12:09:50 -0800 (PST) Message-Id: From: Marcel Moolenaar To: John Baldwin In-Reply-To: <200712311606.25424.jhb@freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Tue, 1 Jan 2008 12:09:50 -0800 References: <200712281500.55155.jhb@freebsd.org> <2ADEF6FE-DC65-489A-A948-81E1A0455CA7@juniper.net> <200712311606.25424.jhb@freebsd.org> X-Mailer: Apple Mail (2.915) 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: Tue, 01 Jan 2008 20:33:55 -0000 On Dec 31, 2007, at 1:06 PM, John Baldwin wrote: >> 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: While I think that's a good thing, the confusion to the user when it comes to the unit number is already present. People already assume that if they have hint.sio.0.at="isa" that they expect to see device sio0. I fear that it's exactly the same with "device.COM1.at=ISA. If the 1 on COM1 is just a means to distinguish multiple COM devices, then it's much better to use a more structural approach, eliminate the unit and instead key-off of something that's truly identifying. In other words: hints historically mix the hardware description with the assignment of the driver and the unit number. Your proposal has the same flaws. The whole thing is just awkward for the user and impossible to implement unambiguously. > 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. This is the part I don't like. There's no clear definition of who or what is in control. In other words: how do we distinguish a description that is to amend or correct from a description that is to define a new device. That's the fundamental problem. In RDB terms: We're still combining unrelated pieces of information in a single table. It has problems. We already have them and we will not resolve them if we don't fix the fundamental problems. Seriously: you need multiple independent descriptions or tables. You need one to enumerate hardware -- a table that describes hardware not already described and ideally usable across OSes (just so that it's clear that there are no FreeBSD specifics embedded). You need another tabke to assign hardware to drivers (i.e. wiring) -- a table that's processed by the newbus architecture and bus drivers so that the wildcard nodes created as the result of enumerating the hardware are mapped to devclasses and are assigned unit numbers. You need a third table for driver- specific information -- a table that is consumed by drivers and which comtains flags, options or directives to the driver so that it can work with the hardware in question. With ACPI optional and describing the LPC bus, we probably want to be able to describe the LPC bus in case we don't use ACPI. This means we need some way to make hardware descriptions optional or to active descriptions conditionally. This is also a feature we can use to support SoCs: we enable hardware descriptions based on some CPU ID, board ID or through some other means. Let's just fix this right... -- Marcel Moolenaar xcllnt@mac.com