All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator
@ 2014-07-18 18:14 Lucas Stach
  2014-07-22  2:57 ` Shawn Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Stach @ 2014-07-18 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

Everything in the PCI specification assumes devices to be
enumerable on startup. This is only possible if they have
power available.

A future improvement may allow this regulator to be switched
off for D3hot and D3cold power states, but there is a lot
of work to do the pcie host controller side for this to work.
To keep things simple always enable the regulator for now.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index ec43dde78525..bbbd501098e6 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -54,6 +54,17 @@
 			gpio = <&gpio4 10 0>;
 			enable-active-high;
 		};
+
+		reg_pcie: regulator at 3 {
+			compatible = "regulator-fixed";
+			reg = <3>;
+			regulator-name = "pcie-supply";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio3 19 0>;
+			regulator-always-on;
+			enable-active-high;
+		};
 	};
 
 	gpio-keys {
@@ -323,6 +334,7 @@
 				MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
 				MX6QDL_PAD_EIM_D22__GPIO3_IO22  0x80000000
 				MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000
+				MX6QDL_PAD_EIM_D19__GPIO3_IO19  0x80000000
 			>;
 		};
 
-- 
2.0.1

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

* [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator
  2014-07-18 18:14 [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator Lucas Stach
@ 2014-07-22  2:57 ` Shawn Guo
  2014-07-22  7:51   ` Lucas Stach
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn Guo @ 2014-07-22  2:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 18, 2014 at 08:14:30PM +0200, Lucas Stach wrote:
> Everything in the PCI specification assumes devices to be
> enumerable on startup. This is only possible if they have
> power available.
> 
> A future improvement may allow this regulator to be switched
> off for D3hot and D3cold power states, but there is a lot
> of work to do the pcie host controller side for this to work.
> To keep things simple always enable the regulator for now.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Just curious if this fixes any known PCIe issue?

> ---
>  arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> index ec43dde78525..bbbd501098e6 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> @@ -54,6 +54,17 @@
>  			gpio = <&gpio4 10 0>;
>  			enable-active-high;
>  		};
> +
> +		reg_pcie: regulator at 3 {
> +			compatible = "regulator-fixed";
> +			reg = <3>;
> +			regulator-name = "pcie-supply";

I would start asking to name the regulator in the same way that board
document like schematics names it.  In this case, it should be
"MPCIE_3V3".

> +			regulator-min-microvolt = <3300000>;
> +			regulator-max-microvolt = <3300000>;
> +			gpio = <&gpio3 19 0>;
> +			regulator-always-on;
> +			enable-active-high;
> +		};
>  	};
>  
>  	gpio-keys {
> @@ -323,6 +334,7 @@
>  				MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
>  				MX6QDL_PAD_EIM_D22__GPIO3_IO22  0x80000000
>  				MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000
> +				MX6QDL_PAD_EIM_D19__GPIO3_IO19  0x80000000

No more GPIO setup in hog group, and no more 0x80000000 on pad config.
Please have a dedicate pinctrl entry for it with a proper config value,
and refer to the entry in that reg_pcie node.

Shawn

>  			>;
>  		};
>  
> -- 
> 2.0.1
> 

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

* [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator
  2014-07-22  2:57 ` Shawn Guo
@ 2014-07-22  7:51   ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2014-07-22  7:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Shawn,

Am Dienstag, den 22.07.2014, 10:57 +0800 schrieb Shawn Guo:
> On Fri, Jul 18, 2014 at 08:14:30PM +0200, Lucas Stach wrote:
> > Everything in the PCI specification assumes devices to be
> > enumerable on startup. This is only possible if they have
> > power available.
> > 
> > A future improvement may allow this regulator to be switched
> > off for D3hot and D3cold power states, but there is a lot
> > of work to do the pcie host controller side for this to work.
> > To keep things simple always enable the regulator for now.
> > 
> > Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> 
> Just curious if this fixes any known PCIe issue?

Yes this allows PCIe devices to work on my SabreSD board. I don't know
if it's required for all revisions, the schematics certainly show a
mounting option where the load switch isn't populated but bridged by 0R
resistor.

> 
> > ---
> >  arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> > index ec43dde78525..bbbd501098e6 100644
> > --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> > +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
> > @@ -54,6 +54,17 @@
> >  			gpio = <&gpio4 10 0>;
> >  			enable-active-high;
> >  		};
> > +
> > +		reg_pcie: regulator at 3 {
> > +			compatible = "regulator-fixed";
> > +			reg = <3>;
> > +			regulator-name = "pcie-supply";
> 
> I would start asking to name the regulator in the same way that board
> document like schematics names it.  In this case, it should be
> "MPCIE_3V3".
> 
> > +			regulator-min-microvolt = <3300000>;
> > +			regulator-max-microvolt = <3300000>;
> > +			gpio = <&gpio3 19 0>;
> > +			regulator-always-on;
> > +			enable-active-high;
> > +		};
> >  	};
> >  
> >  	gpio-keys {
> > @@ -323,6 +334,7 @@
> >  				MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
> >  				MX6QDL_PAD_EIM_D22__GPIO3_IO22  0x80000000
> >  				MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000
> > +				MX6QDL_PAD_EIM_D19__GPIO3_IO19  0x80000000
> 
> No more GPIO setup in hog group, and no more 0x80000000 on pad config.
> Please have a dedicate pinctrl entry for it with a proper config value,
> and refer to the entry in that reg_pcie node.
> 
Ok, will fix.

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

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

* [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator
  2014-07-23 17:29 Lucas Stach
@ 2014-07-29  7:36 ` Shawn Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2014-07-29  7:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 23, 2014 at 07:29:11PM +0200, Lucas Stach wrote:
> Everything in the PCI specification assumes devices to be
> enumerable on startup. This is only possible if they have
> power available.
> 
> A future improvement may allow this regulator to be switched
> off for D3hot and D3cold power states, but there is a lot
> of work to do the pcie host controller side for this to work.
> To keep things simple always enable the regulator for now.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

Applied, thanks.

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

* [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator
@ 2014-07-23 17:29 Lucas Stach
  2014-07-29  7:36 ` Shawn Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Lucas Stach @ 2014-07-23 17:29 UTC (permalink / raw)
  To: linux-arm-kernel

Everything in the PCI specification assumes devices to be
enumerable on startup. This is only possible if they have
power available.

A future improvement may allow this regulator to be switched
off for D3hot and D3cold power states, but there is a lot
of work to do the pcie host controller side for this to work.
To keep things simple always enable the regulator for now.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
v2: - rename to MPCIE_3V3
    - add proper pinctrl
---
 arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index 40ea36534643..f35c06102969 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -54,6 +54,19 @@
 			gpio = <&gpio4 10 0>;
 			enable-active-high;
 		};
+
+		reg_pcie: regulator at 3 {
+			compatible = "regulator-fixed";
+			reg = <3>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_pcie_reg>;
+			regulator-name = "MPCIE_3V3";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			gpio = <&gpio3 19 0>;
+			regulator-always-on;
+			enable-active-high;
+		};
 	};
 
 	gpio-keys {
@@ -399,6 +412,12 @@
 			>;
 		};
 
+		pinctrl_pcie_reg: pciereggrp {
+			fsl,pins = <
+				MX6QDL_PAD_EIM_D19__GPIO3_IO19	0x1b0b0
+			>;
+		};
+
 		pinctrl_pwm1: pwm1grp {
 			fsl,pins = <
 				MX6QDL_PAD_SD1_DAT3__PWM1_OUT		0x1b0b1
-- 
2.0.1

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

end of thread, other threads:[~2014-07-29  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-18 18:14 [PATCH] ARM: dts: imx6qdl-sabresd: add always on pcie regulator Lucas Stach
2014-07-22  2:57 ` Shawn Guo
2014-07-22  7:51   ` Lucas Stach
2014-07-23 17:29 Lucas Stach
2014-07-29  7:36 ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.