From owner-freebsd-arch@FreeBSD.ORG Wed Feb 13 23:48:31 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9EED645B for ; Wed, 13 Feb 2013 23:48:31 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6744186D for ; Wed, 13 Feb 2013 23:48:30 +0000 (UTC) Received: from lrust-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.6/8.14.6) with ESMTP id r1DNmRf3065999 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 13 Feb 2013 15:48:28 -0800 (PST) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: FDT on x86 and for non-fdtbus devices. From: Marcel Moolenaar In-Reply-To: <77486082-2D96-49CC-9841-2D1572F86DEE@bsdimp.com> Date: Wed, 13 Feb 2013 15:48:21 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <03A622DA-EFD4-4984-8FC3-CD8B4832C32E@xcllnt.net> <77486082-2D96-49CC-9841-2D1572F86DEE@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1499) Cc: "freebsd-arch@FreeBSD.org Arch" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2013 23:48:31 -0000 On Feb 13, 2013, at 3:21 PM, Warner Losh wrote: >> What we like to do is to use the FDT to define properties for >> pretty much any kind of device. Examples are: >> 1. Allow the FDT to define the name by which an interface is >> to be created. >=20 > This might be hard... Perhaps you could flesh out a bit how you'd = propose to do this. The thought so far is to use an "interface-name" property in FDT node that provides the name to give to if_initname(). With a single function like if_initname(), you can actually put the logic there, provided we then also pass the device_t (or something similar) to if_initname(). >> 2. Enumerate smb devices so that we can attach drivers for them >> under smbus when we don't need FDT to find ichsmb itself. >=20 > If there's a 1-1 correspondence in the the FDT between the smb bridge = driver (ichsmb) and the sub devices, this could work. Exactly: I'd like this to work for iicbus as well so that we can actually describe the whole i2c bus hierarchy/hierarchies. Using indirect I/O (i.e. always pass requests to the parent), you can have drivers in arbitrarily complex hierarchies (i.e. with i2c muxes) do I/O, and as such provide whatever interface is beneficial, without having to expose H/W details to the consumers. >=20 >> I think one way to state the problem in a generic way is: How >> can we obtain the FDT pnode_t given an arbitrary device_t and >> use the pnode_t to query for properties, etc. >=20 > Yes. What's the naming conventions we need to use here, especially = since names in the FDT don't necessarily match our driver names. Crazy = idea: define freebsd,driver-name properlty to make this association = explicit. >=20 >> Are people already doing things like this? >=20 > only a little. >=20 >> Is there an interest in being able to do things like this? >=20 > Yes. >=20 >> Are changes to drivers to have them query FDT contributable at >> all or do people think such would be "pollution"? >=20 > I like this idea, but others may not be so open to it. While our aim is to build JUNOS on a pristine FreeBSD, we will always have local changes. As long as the changes are contained we're fine. So if we can't change a driver, but we can contribute the infrastructure, we're very happy. >> Thoughts? >> Ideas? >=20 > "Go speed racer! Go!" Roger that :-) --=20 Marcel Moolenaar marcel@xcllnt.net