Re: [PATCH v7 08/13] PCI: tegra194: Apply pinctrl settings for both PCIe RP and EP

From: Manikanta Maddireddy

Date: Sun Mar 15 2026 - 23:42:16 EST




On 16/03/26 7:01 am, Manivannan Sadhasivam wrote:
On Sun, Mar 15, 2026 at 07:24:48PM +0530, Manikanta Maddireddy wrote:


On 05/03/26 3:49 pm, Manivannan Sadhasivam wrote:
On Tue, Mar 03, 2026 at 12:24:43PM +0530, Manikanta Maddireddy wrote:
From: Vidya Sagar <vidyas@xxxxxxxxxx>

PERST# and CLKREQ# pinctrl settings should be applied for both Root Port
and Endpoint mode. Move pinctrl_pm_select_default_state() function call
from Root Port specific configuration function to probe().


Why should this driver care about setting default pinctrl state? Why can't it
rely on the pinctrl framework as like other drivers?

- Mani

pinctrl framework doesn't know if PCIe controller is going to be configured
in Endpoint or Root port mode. In Root port mode PERST# signal should be
configured as special function IO pin(SFIO) and in Endpoint mode it should
be configured as general purpose IO pin(GPIO). So, PCIe driver should
request appropriate pinctl values.


So you are saying that irrespective of board design, you can configure the
controller in host/endpoint mode? Is it possible? Dual mode controllers are
quite common in other SoCs, but they rely on devicetree to either configure the
controller in host or endpoint mode.

If the devicetree enables the endpoint node, why can't it also define the
pinctrl config?

- Mani


Root Port and Endpoint role switch is through device tree only.
pinctrl settings are defined in Root Port/Endpoint device tree node, but to apply the pinctrl settings respective driver need to call pinctrl_pm_select_default_state().

arch/arm64/boot/dts/nvidia/tegra234.dtsi

pcie-ep@140e0000 {
compatible = "nvidia,tegra234-pcie-ep";
...

pinctrl-names = "default";
pinctrl-0 = <&pex_rst_c10_in_state>;
...
}

arch/arm64/boot/dts/nvidia/tegra194.dtsi
pcie@141a0000 {
compatible = "nvidia,tegra194-pcie";
...

pinctrl-names = "default";
pinctrl-0 = <&pex_rst_c5_out_state>, <&pex_clkreq_c5_bi_dir_state>;
...
}
- Manikanta

--
nvpublic