mbox series

[v3,0/4] pinctrl: tegra: Separate Tegra194 instances

Message ID 20221104142345.1562750-1-thierry.reding@gmail.com
Headers show
Series pinctrl: tegra: Separate Tegra194 instances | expand

Message

Thierry Reding Nov. 4, 2022, 2:23 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

This patch series changes the pin controller DT description on Tegra194
in order to properly describe how the hardware works. Currently a
simplified description is used that merges two pin controller instances
(called AON and main) into a single DT node. This has some disadvantages
such as creating a complicated mapping between the pins in those pin
controllers and the corresponding GPIO controllers (which are already
separated).

As a prerequisite, the first patch in this series converts the device
tree bindings to json-schema. A second patch then adds an additional
compatible string for the AON instance (along with more details about
each controller's pins) and finally patch 3 converts the driver to
cope with these changes. A fourth patch makes the corresponding
changes in the Tegra194 DTS file.

Note that while this changes the DT node in an incompatible way, this
doesn't have any practical implications for backwards-compatibility. The
reason for this is that device trees have only reconfigured a very
narrow subset of pins of the main controller, so the new driver will
remain backwards-compatible with old device trees.

Changes in v3:
- address more review comments by Rob Herring and make validation work

Changes in v2[0]:
- address Rob's review comments on the DT bindings

Thierry

[0]: https://lore.kernel.org/all/20220704165802.129717-1-thierry.reding@gmail.com/

Thierry Reding (4):
  dt-bindings: pinctrl: tegra: Convert to json-schema
  dt-bindings: pinctrl: tegra194: Separate instances
  pinctrl: tegra: Separate Tegra194 instances
  arm64: tegra: Separate AON pinmux from main pinmux on Tegra194

 .../bindings/clock/nvidia,tegra124-dfll.yaml  |   2 +-
 .../pinctrl/nvidia,tegra-pinmux-common.yaml   | 178 +++++++++++
 .../pinctrl/nvidia,tegra114-pinmux.txt        | 131 --------
 .../pinctrl/nvidia,tegra114-pinmux.yaml       | 155 ++++++++++
 .../pinctrl/nvidia,tegra124-pinmux.txt        | 153 ----------
 .../pinctrl/nvidia,tegra124-pinmux.yaml       | 176 +++++++++++
 .../pinctrl/nvidia,tegra194-pinmux.txt        | 107 -------
 .../pinctrl/nvidia,tegra194-pinmux.yaml       | 284 +++++++++++++++++
 .../pinctrl/nvidia,tegra20-pinmux.txt         | 143 ---------
 .../pinctrl/nvidia,tegra20-pinmux.yaml        | 112 +++++++
 .../pinctrl/nvidia,tegra210-pinmux.txt        | 166 ----------
 .../pinctrl/nvidia,tegra210-pinmux.yaml       | 142 +++++++++
 .../pinctrl/nvidia,tegra30-pinmux.txt         | 144 ---------
 .../pinctrl/nvidia,tegra30-pinmux.yaml        | 176 +++++++++++
 arch/arm64/boot/dts/nvidia/tegra194.dtsi      |  13 +-
 drivers/pinctrl/tegra/pinctrl-tegra.c         |  33 +-
 drivers/pinctrl/tegra/pinctrl-tegra.h         |   2 +
 drivers/pinctrl/tegra/pinctrl-tegra194.c      | 286 ++++++++++--------
 18 files changed, 1407 insertions(+), 996 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra-pinmux-common.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra114-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra114-pinmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra124-pinmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra194-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra194-pinmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra20-pinmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra210-pinmux.yaml
 delete mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/nvidia,tegra30-pinmux.yaml

Comments

Linus Walleij Nov. 8, 2022, 2:10 p.m. UTC | #1
On Fri, Nov 4, 2022 at 3:23 PM Thierry Reding <thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> This patch series changes the pin controller DT description on Tegra194
> in order to properly describe how the hardware works. Currently a
> simplified description is used that merges two pin controller instances
> (called AON and main) into a single DT node. This has some disadvantages
> such as creating a complicated mapping between the pins in those pin
> controllers and the corresponding GPIO controllers (which are already
> separated).
>
> As a prerequisite, the first patch in this series converts the device
> tree bindings to json-schema. A second patch then adds an additional
> compatible string for the AON instance (along with more details about
> each controller's pins) and finally patch 3 converts the driver to
> cope with these changes. A fourth patch makes the corresponding
> changes in the Tegra194 DTS file.
>
> Note that while this changes the DT node in an incompatible way, this
> doesn't have any practical implications for backwards-compatibility. The
> reason for this is that device trees have only reconfigured a very
> narrow subset of pins of the main controller, so the new driver will
> remain backwards-compatible with old device trees.
>
> Changes in v3:
> - address more review comments by Rob Herring and make validation work

This looks good to me!

I tried to apply them to the pinctrl devel branch but this happens:

$ git am --signoff
./v3_20221104_thierry_reding_pinctrl_tegra_separate_tegra194_instances.mbx
Applying: dt-bindings: pinctrl: tegra: Convert to json-schema
error: Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.yaml:
does not exist in index
Patch failed at 0001 dt-bindings: pinctrl: tegra: Convert to json-schema

I guess there are some prerequisites?

Yours,
Linus Walleij
Thierry Reding Nov. 11, 2022, 3:19 p.m. UTC | #2
On Tue, Nov 08, 2022 at 03:10:01PM +0100, Linus Walleij wrote:
> On Fri, Nov 4, 2022 at 3:23 PM Thierry Reding <thierry.reding@gmail.com> wrote:
> 
> > From: Thierry Reding <treding@nvidia.com>
> >
> > This patch series changes the pin controller DT description on Tegra194
> > in order to properly describe how the hardware works. Currently a
> > simplified description is used that merges two pin controller instances
> > (called AON and main) into a single DT node. This has some disadvantages
> > such as creating a complicated mapping between the pins in those pin
> > controllers and the corresponding GPIO controllers (which are already
> > separated).
> >
> > As a prerequisite, the first patch in this series converts the device
> > tree bindings to json-schema. A second patch then adds an additional
> > compatible string for the AON instance (along with more details about
> > each controller's pins) and finally patch 3 converts the driver to
> > cope with these changes. A fourth patch makes the corresponding
> > changes in the Tegra194 DTS file.
> >
> > Note that while this changes the DT node in an incompatible way, this
> > doesn't have any practical implications for backwards-compatibility. The
> > reason for this is that device trees have only reconfigured a very
> > narrow subset of pins of the main controller, so the new driver will
> > remain backwards-compatible with old device trees.
> >
> > Changes in v3:
> > - address more review comments by Rob Herring and make validation work
> 
> This looks good to me!
> 
> I tried to apply them to the pinctrl devel branch but this happens:
> 
> $ git am --signoff
> ./v3_20221104_thierry_reding_pinctrl_tegra_separate_tegra194_instances.mbx
> Applying: dt-bindings: pinctrl: tegra: Convert to json-schema
> error: Documentation/devicetree/bindings/clock/nvidia,tegra124-dfll.yaml:
> does not exist in index
> Patch failed at 0001 dt-bindings: pinctrl: tegra: Convert to json-schema
> 
> I guess there are some prerequisites?

Yeah, I noticed the same thing as I was just testing to cherry-pick just
the first three patches to a vanilla upstream branch. So yes, that pre-
requisite is another json-schema conversion that I have in my tree but
which hasn't been merged yet.

The good news is that my testing confirms what I recollect about the DT
backwards-compatibility not being an issue. In practice the only pins
from this that are being used are in the first controller, so if we
change the driver to only take control of one of them, the second will
be ignored and that's really a no-op.

What that also implies is that the pinctrl driver patch is completely
standalone, so you can apply that whenever you want and I can apply the
DT patch to the Tegra tree. I can then also pick up the DT bindings
patches and resolve the conflict there. That is, if you don't mind.

Thierry
Linus Walleij Nov. 14, 2022, 1:18 p.m. UTC | #3
On Fri, Nov 11, 2022 at 4:19 PM Thierry Reding <thierry.reding@gmail.com> wrote:

> What that also implies is that the pinctrl driver patch is completely
> standalone, so you can apply that whenever you want and I can apply the
> DT patch to the Tegra tree.

OK I applied patch 3/4 "pinctrl: tegra: Separate Tegra194 instances"
to the pinctrl tree for v6.2.

> I can then also pick up the DT bindings
> patches and resolve the conflict there. That is, if you don't mind.

Let's proceed like this.

patches 1, 2, 4 are
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij