devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v0 0/2] PCI: imx6: Enable the vaux regulator when fetch it
@ 2025-08-14  8:59 Richard Zhu
  2025-08-14  8:59 ` [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe Richard Zhu
  2025-08-14  8:59 ` [PATCH v3 2/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Zhu @ 2025-08-14  8:59 UTC (permalink / raw)
  To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, krzk+dt,
	conor+dt, bhelgaas, shawnguo, s.hauer, kernel, festevam
  Cc: linux-pci, linux-arm-kernel, devicetree, imx, linux-kernel

Refer to PCIe CEM r6.0, sec 2.3 WAKE# Singal, WAKE# signal is only
asserted by the Add-in Card when all its functions are in D3Cold state
and at least one of its functions is enabled for wakeup generation. The
3.3V auxiliary power (+3.3Vaux) must be present and used for wakeup
process. Since the main power supply would be gated off to let Add-in
Card to be in D3Cold, get the vaux and keep it enabled to power up WAKE#
circuit for the entire PCIe controller lifecycle when it's present.

v3 changes:
Add a new vaux power supply used to specify the regulator powered up the
WAKE# circuit on the connector when WAKE# is supported.

v2 changes:
Update the commit message, and add reviewed-by from Frank.
https://patchwork.kernel.org/project/linux-pci/patch/20250619072438.125921-1-hongxing.zhu@nxp.com/

[PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX
[PATCH v3 2/2] PCI: imx6: Enable the vaux regulator when fetch it

Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml |  6 ++++++
drivers/pci/controller/dwc/pci-imx6.c                            | 15 +++++++++++++++
2 files changed, 21 insertions(+)


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

* [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe
  2025-08-14  8:59 [PATCH v0 0/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu
@ 2025-08-14  8:59 ` Richard Zhu
  2025-08-14 19:02   ` Frank Li
  2025-08-14  8:59 ` [PATCH v3 2/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Zhu @ 2025-08-14  8:59 UTC (permalink / raw)
  To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, krzk+dt,
	conor+dt, bhelgaas, shawnguo, s.hauer, kernel, festevam
  Cc: linux-pci, linux-arm-kernel, devicetree, imx, linux-kernel,
	Richard Zhu

Refer to PCIe CEM r6.0, sec 2.3 WAKE# Signal, WAKE# signal is only
asserted by the Add-in Card when all its functions are in D3Cold state
and at least one of its functions is enabled for wakeup generation.

The 3.3V auxiliary power (+3.3Vaux) must be present and used for wakeup
process. Since the main power supply would be gated off to let Add-in
Card to be in D3Cold, add the vaux and keep it enabled to power up WAKE#
circuit for the entire PCIe controller lifecycle when WAKE# is supported.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 .../devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
index cddbe21f99f2b..13fddf731ab8c 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
@@ -98,6 +98,12 @@ properties:
   phy-names:
     const: pcie-phy
 
+  vaux-supply:
+    description: Should specify the regulator in charge of power source
+      of the WAKE# generation on the PCIe connector. When the WAKE# is
+      enabled, this regualor would be always on and used to power up
+      WAKE# circuit (optional required).
+
   vpcie-supply:
     description: Should specify the regulator in charge of PCIe port power.
       The regulator will be enabled when initializing the PCIe host and
-- 
2.37.1


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

* [PATCH v3 2/2] PCI: imx6: Enable the vaux regulator when fetch it
  2025-08-14  8:59 [PATCH v0 0/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu
  2025-08-14  8:59 ` [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe Richard Zhu
@ 2025-08-14  8:59 ` Richard Zhu
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Zhu @ 2025-08-14  8:59 UTC (permalink / raw)
  To: frank.li, l.stach, lpieralisi, kwilczynski, mani, robh, krzk+dt,
	conor+dt, bhelgaas, shawnguo, s.hauer, kernel, festevam
  Cc: linux-pci, linux-arm-kernel, devicetree, imx, linux-kernel,
	Richard Zhu

Enable the vaux regulator at probe time and keep it enabled for the
entire PCIe controller lifecycle. This ensures support for outbound
wake-up mechanism such as WAKE# signaling.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
 drivers/pci/controller/dwc/pci-imx6.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 5a38cfaf989b1..1c1dce2d87e44 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -159,6 +159,7 @@ struct imx_pcie {
 	u32			tx_deemph_gen2_6db;
 	u32			tx_swing_full;
 	u32			tx_swing_low;
+	struct regulator	*vaux;
 	struct regulator	*vpcie;
 	struct regulator	*vph;
 	void __iomem		*phy_base;
@@ -1739,6 +1740,20 @@ static int imx_pcie_probe(struct platform_device *pdev)
 	pci->max_link_speed = 1;
 	of_property_read_u32(node, "fsl,max-link-speed", &pci->max_link_speed);
 
+	/*
+	 * Refer to PCIe CEM r6.0, sec 2.3 WAKE# Signal, WAKE# signal is only
+	 * asserted by the Add-in Card when all its functions are in D3Cold
+	 * state and at least one of its functions is enabled for wakeup
+	 * generation. The 3.3V auxiliary power (+3.3Vaux) must be present and
+	 * used for wakeup process. Since the main power supply would be gated
+	 * off to let Add-in Card to be in D3Cold, get the vaux and keep it
+	 * enabled to power up WAKE# circuit for the entire PCIe controller
+	 * lifecycle when WAKE# is supported.
+	 */
+	ret = devm_regulator_get_enable_optional(&pdev->dev, "vaux");
+	if (ret < 0 && ret != -ENODEV)
+		return dev_err_probe(dev, ret, "failed to enable vaux");
+
 	imx_pcie->vpcie = devm_regulator_get_optional(&pdev->dev, "vpcie");
 	if (IS_ERR(imx_pcie->vpcie)) {
 		if (PTR_ERR(imx_pcie->vpcie) != -ENODEV)
-- 
2.37.1


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

* Re: [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe
  2025-08-14  8:59 ` [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe Richard Zhu
@ 2025-08-14 19:02   ` Frank Li
  2025-08-20 19:59     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2025-08-14 19:02 UTC (permalink / raw)
  To: Richard Zhu
  Cc: l.stach, lpieralisi, kwilczynski, mani, robh, krzk+dt, conor+dt,
	bhelgaas, shawnguo, s.hauer, kernel, festevam, linux-pci,
	linux-arm-kernel, devicetree, imx, linux-kernel

On Thu, Aug 14, 2025 at 04:59:19PM +0800, Richard Zhu wrote:
> Refer to PCIe CEM r6.0, sec 2.3 WAKE# Signal, WAKE# signal is only
> asserted by the Add-in Card when all its functions are in D3Cold state
> and at least one of its functions is enabled for wakeup generation.
>
> The 3.3V auxiliary power (+3.3Vaux) must be present and used for wakeup
> process. Since the main power supply would be gated off to let Add-in
> Card to be in D3Cold, add the vaux and keep it enabled to power up WAKE#
> circuit for the entire PCIe controller lifecycle when WAKE# is supported.

if it is standard, it should move to snps,dw-pcie-common.yaml.

Frank
>
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
>  .../devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml      | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
> index cddbe21f99f2b..13fddf731ab8c 100644
> --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
> +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-common.yaml
> @@ -98,6 +98,12 @@ properties:
>    phy-names:
>      const: pcie-phy
>
> +  vaux-supply:
> +    description: Should specify the regulator in charge of power source
> +      of the WAKE# generation on the PCIe connector. When the WAKE# is
> +      enabled, this regualor would be always on and used to power up
> +      WAKE# circuit (optional required).
> +
>    vpcie-supply:
>      description: Should specify the regulator in charge of PCIe port power.
>        The regulator will be enabled when initializing the PCIe host and
> --
> 2.37.1
>

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

* Re: [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe
  2025-08-14 19:02   ` Frank Li
@ 2025-08-20 19:59     ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2025-08-20 19:59 UTC (permalink / raw)
  To: Frank Li
  Cc: Richard Zhu, l.stach, lpieralisi, kwilczynski, mani, krzk+dt,
	conor+dt, bhelgaas, shawnguo, s.hauer, kernel, festevam,
	linux-pci, linux-arm-kernel, devicetree, imx, linux-kernel

On Thu, Aug 14, 2025 at 03:02:18PM -0400, Frank Li wrote:
> On Thu, Aug 14, 2025 at 04:59:19PM +0800, Richard Zhu wrote:
> > Refer to PCIe CEM r6.0, sec 2.3 WAKE# Signal, WAKE# signal is only
> > asserted by the Add-in Card when all its functions are in D3Cold state
> > and at least one of its functions is enabled for wakeup generation.
> >
> > The 3.3V auxiliary power (+3.3Vaux) must be present and used for wakeup
> > process. Since the main power supply would be gated off to let Add-in
> > Card to be in D3Cold, add the vaux and keep it enabled to power up WAKE#
> > circuit for the entire PCIe controller lifecycle when WAKE# is supported.
> 
> if it is standard, it should move to snps,dw-pcie-common.yaml.

It is standard because PCIe spec defines them. pci-bus-common.yaml 
already defines these:

  vpcie12v-supply:
    description: 12v regulator phandle for the slot

  vpcie3v3-supply:
    description: 3.3v regulator phandle for the slot

  vpcie3v3aux-supply:
    description: 3.3v AUX regulator phandle for the slot

Note that these should really be defined in the root port node rather 
than the host bridge node. We've done the latter because the RP node is 
often not defined.

Rob

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

end of thread, other threads:[~2025-08-20 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14  8:59 [PATCH v0 0/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu
2025-08-14  8:59 ` [PATCH v3 1/2] dt-bindings: PCI: fsl,imx6q-pcie: Add vaux for i.MX PCIe Richard Zhu
2025-08-14 19:02   ` Frank Li
2025-08-20 19:59     ` Rob Herring
2025-08-14  8:59 ` [PATCH v3 2/2] PCI: imx6: Enable the vaux regulator when fetch it Richard Zhu

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).