Received: by 10.213.65.68 with SMTP id h4csp1265247imn; Mon, 26 Mar 2018 04:21:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELsRhDiy6LYoqKqsz8qiN37QJ8LP2+HmhOr5VYf1TlE+68PMfOCyQN7gCNkD2n0QUfO+T1e2 X-Received: by 10.99.175.79 with SMTP id s15mr13550034pgo.388.1522063294129; Mon, 26 Mar 2018 04:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522063294; cv=none; d=google.com; s=arc-20160816; b=MvfomeFOCFnQn003jTwwTDxokMVq1tDdO4RM0EQVtsA7jzq36UW6KNf/DAlRmDmWDg 8xrFgNajeuOV6HNlQUOag7Jvv2eTUYxy/jnc1d0FYmUT99hpinZXYKAMcwVAWp/FheVN jHK7Cb5R3VB6KhWLaFfVs7a3sgQO33ihLcfAtpFfCnP8caGax9MMU/thD5OqabVQjivy EWBOR+Gh28YZnzmfd/3+MzNkNhw2DfGS4wsZpRtR15SC9JzRgoyQnOxa5T/SQqRkbzPq qy1Y1L9cIPhm+qlXDmoXpVoxtI91JD5ZhWH8XePDNIh4J5XOIhDOiEZ+tIke5bMn5VBu 2LZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=/43E4sLx6vf16HlGtDZVPKs4Wq+hU5TvADqeZVLA8CY=; b=IWa+v6iQZs/nnjj3R6gKyUk0T0IdR0vSlQsQXrATZ9gbNxyuZGvCRrU7ipVyRl7Jnw ufldunyaNPlvapy4I6rDCKjdlAqDiH0jVHqYOwkpFriq1NivPfE/nXdicFC0yK6jS2ea z5+1z2iH6E1NUCAt6HX5fxg6dJHcB/5TbQp3pp3K0h1Gl7eKyCkvhpb2y8/5fi9jqugM 6uKkAMjfuuyxmlReTuqx+aGv7748Iso879BKDqSKhUio2ClQnjwHAf+zp0Ox14EUxa7X OYVxsTu9Rx5kGelHxqdsHNEXk2QaO3w40RaBEWGGQdOD+PtibRiNAVXubsBwMIu5zLiL ZUHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si14477669pla.342.2018.03.26.04.21.19; Mon, 26 Mar 2018 04:21:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751195AbeCZLU2 (ORCPT + 99 others); Mon, 26 Mar 2018 07:20:28 -0400 Received: from mail.bootlin.com ([62.4.15.54]:40702 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010AbeCZLUZ (ORCPT ); Mon, 26 Mar 2018 07:20:25 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id A79C7208B1; Mon, 26 Mar 2018 13:20:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 2333B20858; Mon, 26 Mar 2018 13:19:46 +0200 (CEST) Date: Mon, 26 Mar 2018 13:19:46 +0200 From: Boris Brezillon To: Geert Uytterhoeven Cc: Wolfram Sang , Linux I2C , Jonathan Corbet , linux-doc@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Vitor Soares , Linus Walleij , Xiang Lin , "open list:GPIO SUBSYSTEM" , Boris Brezillon Subject: Re: [PATCH v3 05/11] dt-bindings: i3c: Document core bindings Message-ID: <20180326131946.5513c6e2@bbrezillon> In-Reply-To: References: <20180323110020.19080-1-boris.brezillon@bootlin.com> <20180323110020.19080-6-boris.brezillon@bootlin.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Mon, 26 Mar 2018 12:22:24 +0200 Geert Uytterhoeven wrote: > Hi Boris, > > On Fri, Mar 23, 2018 at 12:00 PM, Boris Brezillon > wrote: > > From: Boris Brezillon > > > > A new I3C subsystem has been added and a generic description has been > > created to represent the I3C bus and the devices connected on it. > > > > Document this generic representation. > > > > Signed-off-by: Boris Brezillon > > Thanks for your patch! > > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/i3c/i3c.txt > > @@ -0,0 +1,140 @@ > > > +I3C devices > > +=========== > > + > > +All I3C devices are supposed to support DAA (Dynamic Address Assignment), and > > +are thus discoverable. So, by default, I3C devices do not have to be described > > +in the device tree. > > But if they're described, they should have a compatible value, no? What's the point of having a compatible here? I mean, I3C devices are already attached to the relevant drivers using the Provisional ID, why would we need a compatible if we don't parse it? > > > +This being said, one might want to attach extra resources to these devices, > > +and those resources may have to be described in the device tree, which in turn > > +means we have to describe I3C devices. > > + > > +Another use case for describing an I3C device in the device tree is when this > > +I3C device has a static address and we want to assign it a specific dynamic > > +address before the DAA takes place (so that other devices on the bus can't > > +take this dynamic address). > > + > > +The I3C device should be names @,, > > named Oops. Will fix the typo. > > So the i3c-pid in the unit address is represented as a 64-bit number, not as two > comma-separated 32-bit numbers? Right. I've changed my mind so many times that I ended up mixing the 2 representations I have considered. Here are the choices we have: 1/ expose the raw ProvisionalID which is a 48-bit integer formed by the concatenation of the vendor ID, part ID and instance ID: ProvisionalID = VendorID << 33 | PartID << 16 | InstanceID << 12 | ExtraInfo The I3C dev node name should in this case be something like @, 2/ split the fields we are really interested in in different cells: 2nd cell: vendorID 3rd cell: partID 4th cell: instanceID In this case, the node name should be @,,, Note that we can still change for the second representation if Rob is okay. > > > +Example: > > + > > + i3c-master@d040000 { > > + compatible = "cdns,i3c-master"; > > + clocks = <&coreclock>, <&i3csysclock>; > > + clock-names = "pclk", "sysclk"; > > + interrupts = <3 0>; > > + reg = <0x0d040000 0x1000>; > > + #address-cells = <3>; > > + #size-cells = <0>; > > + > > + status = "okay"; > > + i2c-scl-frequency = <100000>; > > + > > + /* I2C device. */ > > + nunchuk: nunchuk@52 { > > @52,8000001000000000? Well, I2C devs is a special case, and I'm not sure we want to add the extra LVR information + the IS_I2C_DEV bit in the node name. > > > + compatible = "nintendo,nunchuk"; > > + reg = <0x52 0x80000010 0x0>; One more detail: people are unlikely to define reg using raw values: I provide macros to do that in patch 6. > > + }; > > + > > + /* I3C device with a static address. */ > > + thermal_sensor: sensor@68,39200144004 { > > No compatible value? No, as said above, it's not needed. > > > + reg = <0x68 0x392 0x144004>; > > + assigned-address = <0xa>; > > + }; > > + > > + /* > > + * I3C device without a static address but requiring resources > > + * described in the DT. > > + */ > > + sensor@0,39200154004 { > > No compatible value? Ditto. Thanks for your review. Boris -- Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com