Linux-ARM-Kernel Archive on lore.kernel.org
 help / Atom feed
* [PATCH 0/2] "pcie_aux" clock for i.MX8MQ
@ 2019-02-12  1:51 Andrey Smirnov
  2019-02-12  1:51 ` [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq Andrey Smirnov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrey Smirnov @ 2019-02-12  1:51 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: A.s. Dong, Rob Herring, Richard Zhu, linux-arm-kernel,
	devicetree, Andrey Smirnov, linux-pci, linux-kernel,
	Fabio Estevam, linux-imx, Bjorn Helgaas, Leonard Crestez,
	Chris Healy, Lucas Stach

Lorenzo:

This small series adds code to control "pcie_aux" clock. This is an
oversight from original submission [pcie-imx8mq-v7], which was only
discovered once I submitted an RFC for corresponding DT changes going
via i.MX tree [imx-dt-rfc].

Thanks,
Andrey Smirnov

[imx-dt-rfc] https://lore.kernel.org/lkml/20190131204333.31846-1-andrew.smirnov@gmail.com
[pcie-imx8mq-v7] https://lore.kernel.org/lkml/20190202001523.12517-1-andrew.smirnov@gmail.com

Andrey Smirnov (2):
  dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq
  PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ

 .../devicetree/bindings/pci/fsl,imx6q-pcie.txt   |  4 ++++
 drivers/pci/controller/dwc/pci-imx6.c            | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq
  2019-02-12  1:51 [PATCH 0/2] "pcie_aux" clock for i.MX8MQ Andrey Smirnov
@ 2019-02-12  1:51 ` Andrey Smirnov
  2019-02-12  8:57   ` Lucas Stach
  2019-02-12  1:51 ` [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ Andrey Smirnov
  2019-02-19 12:42 ` [PATCH 0/2] " Lorenzo Pieralisi
  2 siblings, 1 reply; 7+ messages in thread
From: Andrey Smirnov @ 2019-02-12  1:51 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: A.s. Dong, Rob Herring, Richard Zhu, linux-arm-kernel,
	devicetree, Andrey Smirnov, linux-pci, linux-kernel,
	Fabio Estevam, linux-imx, Bjorn Helgaas, Leonard Crestez,
	Chris Healy, Lucas Stach

Add a binding for an extra clock required on i.MX8MQ.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: "A.s. Dong" <aisheng.dong@nxp.com>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
 Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
index 920ca93870a8..933d98328e07 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
@@ -55,6 +55,10 @@ Additional required properties for imx7d-pcie and imx8mq-pcie:
 	       - "apps"
 	       - "turnoff"
 
+Additional required properties for imx8mq-pcie:
+- clock-names: Must include the following additional entries:
+	- "pcie_aux"
+
 Example:
 
 	pcie@01000000 {
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ
  2019-02-12  1:51 [PATCH 0/2] "pcie_aux" clock for i.MX8MQ Andrey Smirnov
  2019-02-12  1:51 ` [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq Andrey Smirnov
@ 2019-02-12  1:51 ` Andrey Smirnov
  2019-02-12  9:36   ` Lucas Stach
  2019-02-19 12:42 ` [PATCH 0/2] " Lorenzo Pieralisi
  2 siblings, 1 reply; 7+ messages in thread
From: Andrey Smirnov @ 2019-02-12  1:51 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: A.s. Dong, Rob Herring, Richard Zhu, linux-arm-kernel,
	devicetree, Andrey Smirnov, linux-pci, linux-kernel,
	Fabio Estevam, linux-imx, Bjorn Helgaas, Leonard Crestez,
	Chris Healy, Lucas Stach

PCIe IP block has additional clock, "pcie_aux", that needs to be
controlled by the driver. Add code to support that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: "A.s. Dong" <aisheng.dong@nxp.com>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: linux-imx@nxp.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
---
 drivers/pci/controller/dwc/pci-imx6.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 7cdf8f9ab244..1a7031782846 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -65,6 +65,7 @@ struct imx6_pcie {
 	struct clk		*pcie_phy;
 	struct clk		*pcie_inbound_axi;
 	struct clk		*pcie;
+	struct clk		*pcie_aux;
 	struct regmap		*iomuxc_gpr;
 	u32			controller_id;
 	struct reset_control	*pciephy_reset;
@@ -421,6 +422,12 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
 	case IMX7D:
 		break;
 	case IMX8MQ:
+		ret = clk_prepare_enable(imx6_pcie->pcie_aux);
+		if (ret) {
+			dev_err(dev, "unable to enable pcie_aux clock\n");
+			break;
+		}
+
 		offset = imx6_pcie_grp_offset(imx6_pcie);
 		/*
 		 * Set the over ride low and enabled
@@ -904,6 +911,9 @@ static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)
 				   IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
 				   IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
 		break;
+	case IMX8MQ:
+		clk_disable_unprepare(imx6_pcie->pcie_aux);
+		break;
 	default:
 		break;
 	}
@@ -1049,6 +1059,12 @@ static int imx6_pcie_probe(struct platform_device *pdev)
 			dev_err(dev, "Failed to get PCIE APPS reset control\n");
 			return PTR_ERR(imx6_pcie->apps_reset);
 		}
+
+		imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
+		if (IS_ERR(imx6_pcie->pcie_aux)) {
+			dev_err(dev, "pcie_aux clock source missing or invalid\n");
+			return PTR_ERR(imx6_pcie->pcie_aux);
+		}
 		break;
 	default:
 		break;
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq
  2019-02-12  1:51 ` [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq Andrey Smirnov
@ 2019-02-12  8:57   ` Lucas Stach
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2019-02-12  8:57 UTC (permalink / raw)
  To: Andrey Smirnov, Lorenzo Pieralisi
  Cc: A.s. Dong, Rob Herring, Richard Zhu, devicetree, linux-pci,
	linux-kernel, Fabio Estevam, linux-imx, Bjorn Helgaas,
	Leonard Crestez, Chris Healy, linux-arm-kernel

Am Montag, den 11.02.2019, 17:51 -0800 schrieb Andrey Smirnov:
> Add a binding for an extra clock required on i.MX8MQ.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Leonard Crestez <leonard.crestez@nxp.com>
> Cc: "A.s. Dong" <aisheng.dong@nxp.com>
> Cc: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt 
> b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
> index 920ca93870a8..933d98328e07 100644
> --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
> +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
> @@ -55,6 +55,10 @@ Additional required properties for imx7d-pcie and
> imx8mq-pcie:
>  	       - "apps"
>  	       - "turnoff"
>  
> +Additional required properties for imx8mq-pcie:
> +- clock-names: Must include the following additional entries:
> +	- "pcie_aux"
> +
>  Example:
>  
>  	pcie@01000000 {

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ
  2019-02-12  1:51 ` [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ Andrey Smirnov
@ 2019-02-12  9:36   ` Lucas Stach
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2019-02-12  9:36 UTC (permalink / raw)
  To: Andrey Smirnov, Lorenzo Pieralisi
  Cc: A.s. Dong, Rob Herring, Richard Zhu, devicetree, linux-pci,
	linux-kernel, Fabio Estevam, linux-imx, Bjorn Helgaas,
	Leonard Crestez, Chris Healy, linux-arm-kernel

Am Montag, den 11.02.2019, 17:51 -0800 schrieb Andrey Smirnov:
> PCIe IP block has additional clock, "pcie_aux", that needs to be
> controlled by the driver. Add code to support that.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Chris Healy <cphealy@gmail.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Leonard Crestez <leonard.crestez@nxp.com>
> Cc: "A.s. Dong" <aisheng.dong@nxp.com>
> Cc: Richard Zhu <hongxing.zhu@nxp.com>
> Cc: linux-imx@nxp.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: devicetree@vger.kernel.org

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/pci/controller/dwc/pci-imx6.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 7cdf8f9ab244..1a7031782846 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -65,6 +65,7 @@ struct imx6_pcie {
>  	struct clk		*pcie_phy;
>  	struct clk		*pcie_inbound_axi;
>  	struct clk		*pcie;
> +	struct clk		*pcie_aux;
>  	struct regmap		*iomuxc_gpr;
>  	u32			controller_id;
>  	struct reset_control	*pciephy_reset;
> @@ -421,6 +422,12 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
>  	case IMX7D:
>  		break;
>  	case IMX8MQ:
> +		ret = clk_prepare_enable(imx6_pcie->pcie_aux);
> +		if (ret) {
> +			dev_err(dev, "unable to enable pcie_aux clock\n");
> +			break;
> +		}
> +
>  		offset = imx6_pcie_grp_offset(imx6_pcie);
>  		/*
>  		 * Set the over ride low and enabled
> @@ -904,6 +911,9 @@ static void imx6_pcie_clk_disable(struct imx6_pcie *imx6_pcie)
>  				   IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
>  				   IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
>  		break;
> +	case IMX8MQ:
> +		clk_disable_unprepare(imx6_pcie->pcie_aux);
> +		break;
>  	default:
>  		break;
>  	}
> @@ -1049,6 +1059,12 @@ static int imx6_pcie_probe(struct platform_device *pdev)
>  			dev_err(dev, "Failed to get PCIE APPS reset control\n");
>  			return PTR_ERR(imx6_pcie->apps_reset);
>  		}
> +
> +		imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
> +		if (IS_ERR(imx6_pcie->pcie_aux)) {
> +			dev_err(dev, "pcie_aux clock source missing or invalid\n");
> +			return PTR_ERR(imx6_pcie->pcie_aux);
> +		}
>  		break;
>  	default:
>  		break;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] "pcie_aux" clock for i.MX8MQ
  2019-02-12  1:51 [PATCH 0/2] "pcie_aux" clock for i.MX8MQ Andrey Smirnov
  2019-02-12  1:51 ` [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq Andrey Smirnov
  2019-02-12  1:51 ` [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ Andrey Smirnov
@ 2019-02-19 12:42 ` " Lorenzo Pieralisi
  2019-02-19 12:46   ` Lucas Stach
  2 siblings, 1 reply; 7+ messages in thread
From: Lorenzo Pieralisi @ 2019-02-19 12:42 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: A.s. Dong, Rob Herring, Richard Zhu, linux-arm-kernel,
	devicetree, linux-pci, linux-kernel, Fabio Estevam, linux-imx,
	Bjorn Helgaas, Leonard Crestez, Chris Healy, Lucas Stach

On Mon, Feb 11, 2019 at 05:51:06PM -0800, Andrey Smirnov wrote:
> Lorenzo:
> 
> This small series adds code to control "pcie_aux" clock. This is an
> oversight from original submission [pcie-imx8mq-v7], which was only
> discovered once I submitted an RFC for corresponding DT changes going
> via i.MX tree [imx-dt-rfc].
> 
> Thanks,
> Andrey Smirnov
> 
> [imx-dt-rfc] https://lore.kernel.org/lkml/20190131204333.31846-1-andrew.smirnov@gmail.com
> [pcie-imx8mq-v7] https://lore.kernel.org/lkml/20190202001523.12517-1-andrew.smirnov@gmail.com
> 
> Andrey Smirnov (2):
>   dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq
>   PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ
> 
>  .../devicetree/bindings/pci/fsl,imx6q-pcie.txt   |  4 ++++
>  drivers/pci/controller/dwc/pci-imx6.c            | 16 ++++++++++++++++
>  2 files changed, 20 insertions(+)

Hi Andrey,

I have applied it to pci/dwc for v5.1, however it looks like it would
break the driver with an old dts - I assume that's expected but let
me know if there is a better way to handle this.

Lorenzo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] "pcie_aux" clock for i.MX8MQ
  2019-02-19 12:42 ` [PATCH 0/2] " Lorenzo Pieralisi
@ 2019-02-19 12:46   ` Lucas Stach
  0 siblings, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2019-02-19 12:46 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Andrey Smirnov
  Cc: A.s. Dong, Rob Herring, Richard Zhu, devicetree, linux-pci,
	linux-kernel, Fabio Estevam, linux-imx, Bjorn Helgaas,
	Leonard Crestez, Chris Healy, linux-arm-kernel

Hi Lorenzo,

Am Dienstag, den 19.02.2019, 12:42 +0000 schrieb Lorenzo Pieralisi:
> On Mon, Feb 11, 2019 at 05:51:06PM -0800, Andrey Smirnov wrote:
> > Lorenzo:
> > 
> > This small series adds code to control "pcie_aux" clock. This is an
> > oversight from original submission [pcie-imx8mq-v7], which was only
> > discovered once I submitted an RFC for corresponding DT changes going
> > via i.MX tree [imx-dt-rfc].
> > 
> > Thanks,
> > Andrey Smirnov
> > 
> > [imx-dt-rfc] https://lore.kernel.org/lkml/20190131204333.31846-1-andrew.smirnov@gmail.com
> > [pcie-imx8mq-v7] https://lore.kernel.org/lkml/20190202001523.12517-1-andrew.smirnov@gmail.com
> > 
> > Andrey Smirnov (2):
> >   dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq
> >   PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ
> > 
> >  .../devicetree/bindings/pci/fsl,imx6q-pcie.txt   |  4 ++++
> >  drivers/pci/controller/dwc/pci-imx6.c            | 16 ++++++++++++++++
> >  2 files changed, 20 insertions(+)
> 
> Hi Andrey,
> 
> I have applied it to pci/dwc for v5.1, however it looks like it would
> break the driver with an old dts - I assume that's expected but let
> me know if there is a better way to handle this.

There is no upstream DT using the imx8mq binding, yet. We've actually
noticed the issue due to the DT patches adding the PCIe nodes and those
2 patches fix the driver _before_ we introduce any DT using it. So I
think it's okay not to worry about backwards compatibility here.

Regards,
Lucas


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12  1:51 [PATCH 0/2] "pcie_aux" clock for i.MX8MQ Andrey Smirnov
2019-02-12  1:51 ` [PATCH 1/2] dt-bindings: imx6q-pcie: Add "pcie_aux" clock for imx8mq Andrey Smirnov
2019-02-12  8:57   ` Lucas Stach
2019-02-12  1:51 ` [PATCH 2/2] PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ Andrey Smirnov
2019-02-12  9:36   ` Lucas Stach
2019-02-19 12:42 ` [PATCH 0/2] " Lorenzo Pieralisi
2019-02-19 12:46   ` Lucas Stach

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox