From mboxrd@z Thu Jan 1 00:00:00 1970 From: tony@atomide.com (Tony Lindgren) Date: Wed, 18 Jan 2012 08:29:43 -0800 Subject: Pinmux bindings proposal In-Reply-To: <20120118153256.GB22818@atomide.com> References: <74CDBE0F657A3D45AFBB94109FB122FF17801D202F@HQMAIL01.nvidia.com> <20120116182808.GG4223@ponder.secretlab.ca> <20120118141329.GA22818@atomide.com> <20120118153256.GB22818@atomide.com> Message-ID: <20120118162943.GC22818@atomide.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org * Tony Lindgren [120118 07:00]: > * Shawn Guo [120118 05:57]: > > On 18 January 2012 22:13, Tony Lindgren wrote: > > > Hi, > > > > > > * Grant Likely [120116 09:55]: > > >> On Fri, Jan 13, 2012 at 12:39:42PM -0800, Stephen Warren wrote: > > >> > ? ? ? ? ? ? ? ? pinmux = > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"default" &pmx_sdhci_active> > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"suspend" &pmx_sdhci_suspend>; > > >> > > > >> > ? ? ? ? ? ? ? ? /* 1:n example: */ > > >> > ? ? ? ? ? ? ? ? pinmux = > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"default" &pmx_sdhci_mux_a> > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"default" &pmx_sdhci_pincfg_a> > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"suspend" &pmx_sdhci_mux_a> > > >> > ? ? ? ? ? ? ? ? ? ? ? ? <"suspend" &pmx_sdhci_pincfg_a_suspend>; > > >> > > >> > > >> Yeah, don't do this. ?Mixing phandle, string and cell values in a > > >> property gets messy and could become troublesome to parse. ?I've > > >> backed away from it in the clk binding. > > > > > > Yup, that's because the string is embedded directly into the mixed > > > mode array and will likely make the following data unaligned. That > > > means it's extremely flakey to parse, and will lead into horrible > > > errors if you have typos in the .dts file.. Tried that and gave up > > > on it. > > > > > > I think I've found a way to avoid using names at all, assuming we set > > > each pin as a phandle for the drivers to use :) > > > > > The problem with doing that is we will have to represent each pin as a > > node in device tree. For imx6q case, we have 197 pins. Doing so will > > bloat the device tree. > > Sure there's some overhead. I've got it working with 220 pins, it's > not too bad as threre's not much string parsing involved. > > I don't have all the devices mapping the pins though. The .dtb for > omap4 is about 25k now. > > If we wanted to avoid adding phandles for each pin, then we could do: > > serial at 0x48020000 { > compatible = "ti,8250"; > reg = <0x48020000 0x100>; > reg-shift = <2>; > interrupts = <106>; > > /* controller, offset, value */ > pins = <&mux1 0xabcd 0x10 > &mux1 0xabcf 0x0>; > }; > > But then the .dts file becomes an unreadable matrix unless we have > a preprocessor.. Forgot to mention that as long as we all standardize to use something common for #pin-args and of_parse_phandle_with_args(), the pin mapping could depend on the pinmux driver for selecting whether or not to use a phandle for each pin. Tony From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: Pinmux bindings proposal Date: Wed, 18 Jan 2012 08:29:43 -0800 Message-ID: <20120118162943.GC22818@atomide.com> References: <74CDBE0F657A3D45AFBB94109FB122FF17801D202F@HQMAIL01.nvidia.com> <20120116182808.GG4223@ponder.secretlab.ca> <20120118141329.GA22818@atomide.com> <20120118153256.GB22818@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Content-Disposition: inline In-Reply-To: <20120118153256.GB22818-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Shawn Guo Cc: "linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org" , "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org" , "kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org" , "cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org" , "s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , Dong Aisheng List-Id: devicetree@vger.kernel.org KiBUb255IExpbmRncmVuIDx0b255QGF0b21pZGUuY29tPiBbMTIwMTE4IDA3OjAwXToKPiAqIFNo YXduIEd1byA8c2hhd24uZ3VvQGxpbmFyby5vcmc+IFsxMjAxMTggMDU6NTddOgo+ID4gT24gMTgg SmFudWFyeSAyMDEyIDIyOjEzLCBUb255IExpbmRncmVuIDx0b255QGF0b21pZGUuY29tPiB3cm90 ZToKPiA+ID4gSGksCj4gPiA+Cj4gPiA+ICogR3JhbnQgTGlrZWx5IDxncmFudC5saWtlbHlAc2Vj cmV0bGFiLmNhPiBbMTIwMTE2IDA5OjU1XToKPiA+ID4+IE9uIEZyaSwgSmFuIDEzLCAyMDEyIGF0 IDEyOjM5OjQyUE0gLTA4MDAsIFN0ZXBoZW4gV2FycmVuIHdyb3RlOgo+ID4gPj4gPiDCoCDCoCDC oCDCoCDCoCDCoCDCoCDCoCBwaW5tdXggPQo+ID4gPj4gPiDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoCDCoCA8ImRlZmF1bHQiICZwbXhfc2RoY2lfYWN0aXZlPgo+ID4gPj4gPiDCoCDC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCA8InN1c3BlbmQiICZwbXhfc2RoY2lfc3Vz cGVuZD47Cj4gPiA+PiA+Cj4gPiA+PiA+IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIC8qIDE6biBl eGFtcGxlOiAqLwo+ID4gPj4gPiDCoCDCo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cj4gCXJlZy1z aGlmdCA9IDwyPjsKPiAJaW50ZXJydXB0cyA9IDwxMDY+Owo+IAo+IAkvKiBjb250cm9sbGVyLCBv ZmZzZXQsIHZhbHVlICovCj4gCXBpbnMgPSA8Jm11eDEgMHhhYmNkIDB4MTAKPiAgICAgICAgICAg ICAgICAgJm11eDEgMHhhYmNmIDB4MD47Cj4gfTsKPiAKPiBCdXQgdGhlbiB0aGUgLmR0cyBmaWxl IGJlY29tZXMgYW4gdW5yZWFkYWJsZSBtYXRyaXggdW5sZXNzIHdlIGhhdmUKPiBhIHByZXByb2Nl c3Nvci4uCgpGb3Jnb3QgdG8gbWVudGlvbiB0aGF0IGFzIGxvbmcgYXMgd2UgYWxsIHN0YW5kYXJk aXplIHRvIHVzZSBzb21ldGhpbmcKY29tbW9uIGZvciAjcGluLWFyZ3MgYW5kIG9mX3BhcnNlX3Bo YW5kbGVfd2l0aF9hcmdzKCksIHRoZSBwaW4gbWFwcGluZwpjb3VsZCBkZXBlbmQgb24gdGhlIHBp bm11eCBkcml2ZXIgZm9yIHNlbGVjdGluZyB3aGV0aGVyIG9yIG5vdCB0byB1c2UKYSBwaGFuZGxl IGZvciBlYWNoIHBpbi4KClRvbnkKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX18KZGV2aWNldHJlZS1kaXNjdXNzIG1haWxpbmcgbGlzdApkZXZpY2V0cmVlLWRp c2N1c3NAbGlzdHMub3psYWJzLm9yZwpodHRwczovL2xpc3RzLm96bGFicy5vcmcvbGlzdGluZm8v ZGV2aWNldHJlZS1kaXNjdXNzCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758004Ab2ARQ34 (ORCPT ); Wed, 18 Jan 2012 11:29:56 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:30582 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397Ab2ARQ3y (ORCPT ); Wed, 18 Jan 2012 11:29:54 -0500 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19/RABbwaNlNUhkOxUP0bwy Date: Wed, 18 Jan 2012 08:29:43 -0800 From: Tony Lindgren To: Shawn Guo Cc: Grant Likely , "linus.walleij@stericsson.com" , "devicetree-discuss@lists.ozlabs.org" , "s.hauer@pengutronix.de" , "linux-kernel@vger.kernel.org" , "rob.herring@calxeda.com" , "kernel@pengutronix.de" , "cjb@laptop.org" , "linux-arm-kernel@lists.infradead.org" , Dong Aisheng Subject: Re: Pinmux bindings proposal Message-ID: <20120118162943.GC22818@atomide.com> References: <74CDBE0F657A3D45AFBB94109FB122FF17801D202F@HQMAIL01.nvidia.com> <20120116182808.GG4223@ponder.secretlab.ca> <20120118141329.GA22818@atomide.com> <20120118153256.GB22818@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120118153256.GB22818@atomide.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [120118 07:00]: > * Shawn Guo [120118 05:57]: > > On 18 January 2012 22:13, Tony Lindgren wrote: > > > Hi, > > > > > > * Grant Likely [120116 09:55]: > > >> On Fri, Jan 13, 2012 at 12:39:42PM -0800, Stephen Warren wrote: > > >> >                 pinmux = > > >> >                         <"default" &pmx_sdhci_active> > > >> >                         <"suspend" &pmx_sdhci_suspend>; > > >> > > > >> >                 /* 1:n example: */ > > >> >                 pinmux = > > >> >                         <"default" &pmx_sdhci_mux_a> > > >> >                         <"default" &pmx_sdhci_pincfg_a> > > >> >                         <"suspend" &pmx_sdhci_mux_a> > > >> >                         <"suspend" &pmx_sdhci_pincfg_a_suspend>; > > >> > > >> > > >> Yeah, don't do this.  Mixing phandle, string and cell values in a > > >> property gets messy and could become troublesome to parse.  I've > > >> backed away from it in the clk binding. > > > > > > Yup, that's because the string is embedded directly into the mixed > > > mode array and will likely make the following data unaligned. That > > > means it's extremely flakey to parse, and will lead into horrible > > > errors if you have typos in the .dts file.. Tried that and gave up > > > on it. > > > > > > I think I've found a way to avoid using names at all, assuming we set > > > each pin as a phandle for the drivers to use :) > > > > > The problem with doing that is we will have to represent each pin as a > > node in device tree. For imx6q case, we have 197 pins. Doing so will > > bloat the device tree. > > Sure there's some overhead. I've got it working with 220 pins, it's > not too bad as threre's not much string parsing involved. > > I don't have all the devices mapping the pins though. The .dtb for > omap4 is about 25k now. > > If we wanted to avoid adding phandles for each pin, then we could do: > > serial@0x48020000 { > compatible = "ti,8250"; > reg = <0x48020000 0x100>; > reg-shift = <2>; > interrupts = <106>; > > /* controller, offset, value */ > pins = <&mux1 0xabcd 0x10 > &mux1 0xabcf 0x0>; > }; > > But then the .dts file becomes an unreadable matrix unless we have > a preprocessor.. Forgot to mention that as long as we all standardize to use something common for #pin-args and of_parse_phandle_with_args(), the pin mapping could depend on the pinmux driver for selecting whether or not to use a phandle for each pin. Tony