lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111211193400.GD31337@atomide.com>
Date:	Sun, 11 Dec 2011 11:34:01 -0800
From:	Tony Lindgren <tony@...mide.com>
To:	Stephen Warren <swarren@...dia.com>
Cc:	Dong Aisheng <dongas86@...il.com>,
	Shawn Guo <shawn.guo@...escale.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Linus Walleij <linus.walleij@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH] [RFC] pinctrl: add a driver for Energy Micro's efm32
 SoCs

* Stephen Warren <swarren@...dia.com> [111209 15:42]:
> Tony Lindgren wrote at Friday, December 09, 2011 10:53 AM:
> > * Tony Lindgren <tony@...mide.com> [111209 08:53]:
> ...
> > > For letting a device do it's pingroup in DT, I've played with the
> > > following:
> > >
> > > 	/*      mux func phandle mux func name    hw initial flags */
> > > 	pins = <&uart3_rx_irrx>, "uart3_rx_irrx", <0xdeadbeef>,
> > > 		<&uart3_tx_irtx>, "uart3_tx_irtx", <0xdeadbeef>;
> > >
> > > But it seems that doing mixed-property arrays gets nasty as any
> ...
> > > So I've pretty much come to the conclusion that we would have to
> > > use something like this instead:
> > >
> > > 	/*      phandle        f hw specific initial flags */
> > > 	pins = <&uart3_rx_irrx 0 0xdeadbeef
> > > 		&uart3_tx_irtx 0 0xdeadbeef>;
> > >
> > > This however has a problem for cases where we may not have a phandle
> > > in DT for the mux function. For example, let's assume that we'll have
> > > tens of thousands of lines of mux data for omaps (we already have
> > > over 6k LOC) and just want to load that from /lib/firmware to avoid
> > > bloating the kernel. In that case we won't have the phandle for the
> > > mux function in DT.
> ...
> > Oh forgot to mention of course what Benoit came up which is reg-names.
> > That of course is doable with both phandles and pin names:
> > 
> > So optionally either
> > 
> > 	pins = <&uart3_rx_irrx &uart3_tx_irtx>;
> > or
> > 
> > 	pin-names = "uart3_rx_irrx",  "uart3_tx_irtx";
> 
> Tony,
> 
> It sounds like you've already started working on some DT bindings for
> pin muxing. Are you just at the thinking stage as above, or do you have
> any concrete code? I'd obviously be interested in looking at any early
> bindings to see if I can port the Tegra pinctrl driver to use them.

Yeah I have some code but it still needs a bit more work.. The DT bindings
part I have only briefly played with so far. Mostly to verify that trying
to use the mixed-property arrays will get messy.

For parsing the pins as phandles, drivers/of/gpio.c is a nice example.

After still thinking more about it, I think the cleanest and most flexible
option is using both the pins phandle array or pin-names string array,
combined with a separate pin-flags initial value array. That way we can
use the DT generated maps also for non-dt pinmux drivers where we don't
have phandles around.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ