pinctrl: starfive: Reset pinmux settings
authorEmil Renner Berthing <kernel@esmil.dk>
Sat, 17 Jul 2021 19:50:38 +0000 (21:50 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 9 Feb 2023 18:32:38 +0000 (19:32 +0100)
commit1d4cb073fea57d91f1292c75931255619044c9b4
tree9f712f0d43ed6c99059e7e5ee2a494758883ef2b
parent7facecb7a540597ee4e0abe61cd1c660cc09cdbd
pinctrl: starfive: Reset pinmux settings

Current u-boot doesn't seem to take into account that some GPIOs are
configured as inputs/outputs of certain peripherals on power-up. This
means it ends up configuring some GPIOs as inputs to more than one
peripheral which the documentation explicitly says is illegal. Similarly
it also ends up configuring more than one GPIO as output of the same
peripheral. While not explicitly mentioned by the documentation this
also seems like a bad idea.

The easiest way to remedy this mess is to just disconnect all GPIOs from
peripherals and have our pinmux configuration set everything up
properly. This, however, means that we'd disconnect the serial console
from its pins for a while, so add a device tree property to keep
certain GPIOs from being reset.

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Documentation/devicetree/bindings/pinctrl/starfive,jh7100-pinctrl.yaml
drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c