From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 7 16:17:04 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 506CA106566B 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 F1DB78FC15 for ; Sat, 7 Jul 2012 16:17:03 +0000 (UTC) Received: by yenl8 with SMTP id l8so10847735yen.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=Du4bYjbOByvUuDexOeJ7OMaUIpiTon93tjmbgkGGETtn5OepHP6yv6YL7VUGpPi0E6 veqQoVz7nMG7XsSBaI8j15iXJzzjXkIvIRuKpV0Hzv9ZsqfPchrQQLeVUouOHN7mH4xs VehBKexqc8vwExpIwg+hKb2qmImKfmZmFIIsHWNq+fFFBeyaoYgaTdjnl4NyiawgkaWb 0XM8xyGxsacw7QndD+Jp3s1jhPPAcE2nR4wXObHnVELJlPjYEJPfCO+ZhysD61Vj/fMz AHSNrC9wZJxf6knT+Cu00GPAj3qdREYTnGdUZMwDaCAp8kjJgfvRvzky8KkXEA3FtUwS qD9Q== 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: ALoCoQn2EawzaJS1O4kbQ6PrYj2KindHRa+9ADoo8UwFvTRr6auM//1JRA2wKO6wOkjdkc0qhAJh Cc: FreeBSD Hackers , FreeBSD Current , Arnaud Lacombe Subject: Re: Interfacing devices with multiple parents within newbus X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD 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...