linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] pinctrl: mvebu: reset pins to an UNKNOWN state on startup
@ 2012-10-24 19:18 Thomas Petazzoni
  2012-10-24 19:38 ` Sebastian Hesselbarth
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2012-10-24 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

Note: this patch is a *RFC*, it is not intended for merging, only to
get a discussion started. The code is horrible, makes terrible
assumptions and so on.

On many platforms, most of the pinmux initialization is done in the
bootloader, and therefore persists when we boot the Linux kernel. This
prevents us from making sure that the pinmux configuration in the
board device trees is correct.

One idea to make sure our device trees are correct in terms of
pinmuxing is to set the state of each pin to an unavailable function
during the initialization of the pinctrl driver. This way, only pins
that are explicitly configured through proper device tree attributes
will actually be functional.

Remaining questions to solve:

 * Is this useful?

 * How to figure out what function number is a good function number to
   set all pins to at startup? It could be passed by the SoC-specific
   pinctrl drivers.

 * Maybe some pins should be excluded for this, especially if the
   console serial port pins are muxed. On Armada XP, it's not the
   case: UART0 RX/UART0 TX pins are not part of MPPs, so we can clear
   all pins. But on other mvebu platforms, it may be the case.

 * If this sounds like an interesting thing, should we keep it only at
   the mvebu driver level, or make it something more generically
   available in the pinctrl subsystem?

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/pinctrl/pinctrl-mvebu.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-mvebu.c b/drivers/pinctrl/pinctrl-mvebu.c
index 8e6266c..32a9cbe 100644
--- a/drivers/pinctrl/pinctrl-mvebu.c
+++ b/drivers/pinctrl/pinctrl-mvebu.c
@@ -739,6 +739,9 @@ int __devinit mvebu_pinctrl_probe(struct platform_device *pdev)
 
 	dev_info(&pdev->dev, "registered pinctrl driver\n");
 
+	for (n = 0; n < pctl->num_groups; n++)
+		mvebu_pinconf_group_set(pctl->pctldev, n, 7);
+
 	/* register gpio ranges */
 	for (n = 0; n < soc->ngpioranges; n++)
 		pinctrl_add_gpio_range(pctl->pctldev, &soc->gpioranges[n]);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-25 15:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24 19:18 [PATCH] [RFC] pinctrl: mvebu: reset pins to an UNKNOWN state on startup Thomas Petazzoni
2012-10-24 19:38 ` Sebastian Hesselbarth
2012-10-24 19:51   ` Thomas Petazzoni
2012-10-24 20:15 ` Andrew Lunn
2012-10-24 20:21   ` Thomas Petazzoni
2012-10-25  6:51     ` Linus Walleij
2012-10-25  6:46 ` Linus Walleij
2012-10-25 10:27   ` Mark Brown
2012-10-25 15:47 ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).