From owner-freebsd-current@FreeBSD.ORG Sat Jul 7 16:17:04 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6914B1065670 for ; Sat, 7 Jul 2012 16:17:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1080D8FC16 for ; Sat, 7 Jul 2012 16:17:03 +0000 (UTC) Received: by yenl8 with SMTP id l8so10847736yen.13 for ; Sat, 07 Jul 2012 09:17:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=Lc+g/Opi0Ip7hD9PsWczrOW19lpvV+q7hAhwVfaSRmo=; b=PyUi5rtvQ4hZgYPzyZs/3htH6ivGH/pQSdeLIh7x/4I18Aptb4k6EvhaofyGEuHyEa L3llzNrSDxhZ4VqnhgNREdXEKlQ+vBPFDG4p46shPIeOs5xFUObk0Im+/YYLTrxzj+T6 Rdm4JrJmF1Jo8hTq0+2Md7YbexKLSC1V36Qk1/p4nDz+pYVW2ZFZ41NmG/jlStECPOQ6 7dC35w5DZQOezRuYx+1O5keXZl7pYmPvGqS8cYSR371R0T6mRqM97VKK0S6wL/0RYB8b gzW/7+QFAs5v7in3CPhzYYkzWbpfGw8UpYlN3+Q+StSdKBhiKZYC54obeXMOYUQkVzso WSRw== Received: by 10.50.212.66 with SMTP id ni2mr4768026igc.66.1341677823235; Sat, 07 Jul 2012 09:17:03 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id nh1sm4966628igc.11.2012.07.07.09.17.02 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Jul 2012 09:17:02 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1341601751.70246.7.camel@revolution.hippie.lan> Date: Sat, 7 Jul 2012 10:17:01 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <9855720B-9965-4A3B-B106-0A25EF3CA56F@bsdimp.com> References: <1341601751.70246.7.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQlISv2QO6MPUn27AQAaizBwSe4keKGwWMDEA6bZo/Futm9K37w/q6famF4FSOY1XzuKZ3MC Cc: FreeBSD Hackers , FreeBSD Current , Arnaud Lacombe Subject: Re: Interfacing devices with multiple parents within newbus X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2012 16:17:04 -0000 On Jul 6, 2012, at 1:09 PM, Ian Lepore wrote: > Just blue-sky dreaming here on the fly... what we really have is a > resource-management problem. A device comes along that needs a GPIO > resource, how does it find and use that resource? =20 I rather like that idea. The connection between devices is more like = meta-data needed to obtain the resources/services that other devices = provide. You really want to talk in those terms, rather than in newbus = attachments. The platform told me that pin AT91_PIOA_12 is my interrupt line. I'd = like to wire up an ISR to that please. The platform told me that pin AT91_PIOC_33 is the data pin for my two = wire bus. An error happened and to reset it I need to tell the pin = muxing service to take it off line. then I need to tell the GPIO = service I have to force it high, let it flow, and force it low. The platform told me that this NIC is connected to PHY 2 on miibus 3. = I'm the NIC driver and want to connect. I'm the USB subsystem. I'd like to know if one or two usb ports are = connected to the HUB. The hardware can't tell me, so the platform code = has to give me hints. If I allocate the pins for each of those two = ports I'll know. In some configurations, I can get both sets. In = others, I can only get one set. All of those problems could be solved with newbus kobj connections. Or = they could be solved by the platform and/or drivers registering = resources and services and the other drivers in the system using it. = Multipass would help a lot with that, since you could probe/attach all = the service providers first, then everybody else could talk the higher = level interfaces. Warner P.S. multipass could solve the dependency problem, but in kinda a poor = way...