linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/5] PCIE support for i.MX8MQ (DT changes)
@ 2019-01-31 20:43 Andrey Smirnov
  2019-01-31 20:43 ` [RFC 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible Andrey Smirnov
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

Everyone:

This series contains all of the i.MX Device Tree changes I made to
enable support of PCIe on i.MX8MQ EVK. Marked as RFC since PCIe
support patch series is still waiting to be applied to PCI tree. I
anticipate that PCIe patches going through is just a maater of time,
so this series should be mature enough to solicit feedback.

NOTE: Immutable brach containing imx8mq-reset.h used in "arm64: dts:
Add nodes for PCIe IP blocks" is availible in [reset-imx8mq]

Feedback is welcome!

Thanks,
Andrey Smirnov

[reset-imx8mq] git://git.pengutronix.de/pza/linux reset/imx8mq

Andrey Smirnov (5):
  arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible
  arm64: dts: imx8mq: Add a node for SRC IP block
  arm64: dts: imx8mq: Combine PCIE power domains
  arm64: dts: Add nodes for PCIe IP blocks
  arm64: dts: imx8mq-evk: Enable PCIE0 interface

 arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 23 +++++
 arch/arm64/boot/dts/freescale/imx8mq.dtsi    | 97 +++++++++++++++++++-
 2 files changed, 118 insertions(+), 2 deletions(-)

-- 
2.20.1


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

* [RFC 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible
  2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
@ 2019-01-31 20:43 ` Andrey Smirnov
  2019-01-31 20:43 ` [RFC 2/5] arm64: dts: imx8mq: Add a node for SRC IP block Andrey Smirnov
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

Mark iomuxc_gpr as compatible with "fsl,imx6q-iomuxc-gpr" in order for
to allow i.MX6 PCIe driver to use it.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
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
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 892063a7c26c..f6c37bf9cbce 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -230,7 +230,7 @@
 			};
 
 			iomuxc_gpr: syscon@30340000 {
-				compatible = "fsl,imx8mq-iomuxc-gpr", "syscon";
+				compatible = "fsl,imx8mq-iomuxc-gpr", "fsl,imx6q-iomuxc-gpr", "syscon";
 				reg = <0x30340000 0x10000>;
 			};
 
-- 
2.20.1


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

* [RFC 2/5] arm64: dts: imx8mq: Add a node for SRC IP block
  2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
  2019-01-31 20:43 ` [RFC 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible Andrey Smirnov
@ 2019-01-31 20:43 ` Andrey Smirnov
  2019-01-31 20:43 ` [RFC 3/5] arm64: dts: imx8mq: Combine PCIE power domains Andrey Smirnov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

Add a node for reset controller IP block found on i.MX8MQ.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
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
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index f6c37bf9cbce..50436bd393ed 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -254,6 +254,12 @@
 				              "clk_ext3", "clk_ext4";
 			};
 
+			src: src@30390000 {
+				compatible = "fsl,imx8mq-src", "syscon";
+				reg = <0x30390000 0x10000>;
+				#reset-cells = <1>;
+			};
+
 			gpc: gpc@303a0000 {
 				compatible = "fsl,imx8mq-gpc";
 				reg = <0x303a0000 0x10000>;
-- 
2.20.1


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

* [RFC 3/5] arm64: dts: imx8mq: Combine PCIE power domains
  2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
  2019-01-31 20:43 ` [RFC 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible Andrey Smirnov
  2019-01-31 20:43 ` [RFC 2/5] arm64: dts: imx8mq: Add a node for SRC IP block Andrey Smirnov
@ 2019-01-31 20:43 ` Andrey Smirnov
  2019-01-31 20:43 ` [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks Andrey Smirnov
  2019-01-31 20:43 ` [RFC 5/5] arm64: dts: imx8mq-evk: Enable PCIE0 interface Andrey Smirnov
  4 siblings, 0 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

According to NXP's FAE feedback and a comment in ATF firmware, PCIE1
and PCIE2 power domains can't really be used independently. Due to
shared reset line both power domains have to be turned on at the same
time. Account for that quirk by combining PCIE power domains into a
single 'pgc_pcie' power domain.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
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
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 50436bd393ed..89babc531380 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -273,9 +273,28 @@
 						reg = <IMX8M_POWER_DOMAIN_MIPI>;
 					};
 
-					pgc_pcie1: power-domain@1 {
+					/*
+					 * As per comment in ATF source code:
+					 *
+					 * PCIE1 and PCIE2 share the
+					 * same reset signal, if we
+					 * power down PCIE2, PCIE1
+					 * will be held in reset too.
+					 *
+					 * So instead of creating two
+					 * separate power domains for
+					 * PCIE1 and PCIE2. We create
+					 * a link between 1 and 10 and
+					 * use what was supposed to be
+					 * domain 1 as a shared PCIE
+					 * power domain powering both
+					 * PCIE1 and PCIE2 at the same
+					 * time
+					 */
+					pgc_pcie: power-domain@1 {
 						#power-domain-cells = <0>;
 						reg = <IMX8M_POWER_DOMAIN_PCIE1>;
+						power-domains = <&pgc_pcie2>;
 					};
 
 					pgc_otg1: power-domain@2 {
-- 
2.20.1


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

* [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks
  2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
                   ` (2 preceding siblings ...)
  2019-01-31 20:43 ` [RFC 3/5] arm64: dts: imx8mq: Combine PCIE power domains Andrey Smirnov
@ 2019-01-31 20:43 ` Andrey Smirnov
  2019-02-07 14:27   ` Lucas Stach
  2019-01-31 20:43 ` [RFC 5/5] arm64: dts: imx8mq-evk: Enable PCIE0 interface Andrey Smirnov
  4 siblings, 1 reply; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

Add nodes for two PCIe controllers found on i.MX8MQ.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
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
---
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 68 +++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 89babc531380..d20e5c7e21a3 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -6,6 +6,7 @@
 
 #include <dt-bindings/clock/imx8mq-clock.h>
 #include <dt-bindings/power/imx8mq-power.h>
+#include <dt-bindings/reset/imx8mq-reset.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include "imx8mq-pinfunc.h"
@@ -539,6 +540,73 @@
 			};
 		};
 
+		pcie0: pcie@33800000 {
+			compatible = "fsl,imx8mq-pcie";
+			reg = <0x33800000 0x400000>,
+			      <0x1ff00000 0x80000>;
+			reg-names = "dbi", "config";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			device_type = "pci";
+			bus-range = <0x00 0xff>;
+			ranges = <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000 /* downstream I/O 64KB */
+			          0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
+			num-lanes = <1>;
+			interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+			             <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */
+			interrupt-names = "msi";
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0x7>;
+			interrupt-map = <0 0 0 1 &gic GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 2 &gic GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 3 &gic GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+			                <0 0 0 4 &gic GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk IMX8MQ_CLK_PCIE1_ROOT>,
+			         <&clk IMX8MQ_CLK_PCIE1_AUX>,
+			         <&clk IMX8MQ_CLK_PCIE1_PHY>;
+			clock-names = "pcie", "pcie_bus", "pcie_phy";
+			fsl,max-link-speed = <2>;
+			power-domains = <&pgc_pcie>;
+			resets = <&src IMX8MQ_RESET_PCIEPHY>,
+			         <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
+			         <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
+			reset-names = "pciephy", "apps", "turnoff";
+			status = "disabled";
+		};
+
+		pcie1: pcie@0x33c00000 {
+			compatible = "fsl,imx8mq-pcie";
+			reg = <0x33c00000 0x400000>,
+			      <0x27f00000 0x80000>;
+			reg-names = "dbi", "config";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			device_type = "pci";
+			ranges =  <0x81000000 0 0x00000000 0x27f80000 0 0x00010000 /* downstream I/O 64KB */
+				   0x82000000 0 0x20000000 0x20000000 0 0x07f00000>; /* non-prefetchable memory */
+			num-lanes = <1>;
+			interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */
+			interrupt-names = "msi";
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 0x7>;
+			interrupt-map = <0 0 0 1 &gic GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 2 &gic GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 3 &gic GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+					<0 0 0 4 &gic GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk IMX8MQ_CLK_PCIE2_ROOT>,
+				 <&clk IMX8MQ_CLK_PCIE2_AUX>,
+				 <&clk IMX8MQ_CLK_PCIE2_PHY>;
+			clock-names = "pcie", "pcie_bus", "pcie_phy";
+			fsl,max-link-speed = <2>;
+			power-domains = <&pgc_pcie>;
+			resets = <&src IMX8MQ_RESET_PCIEPHY2>,
+			         <&src IMX8MQ_RESET_PCIE2_CTRL_APPS_EN>,
+			         <&src IMX8MQ_RESET_PCIE2_CTRL_APPS_TURNOFF>;
+			reset-names = "pciephy", "apps", "turnoff";
+			status = "disabled";
+		};
+
 		gic: interrupt-controller@38800000 {
 			compatible = "arm,gic-v3";
 			reg = <0x38800000 0x10000>,	/* GIC Dist */
-- 
2.20.1


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

* [RFC 5/5] arm64: dts: imx8mq-evk: Enable PCIE0 interface
  2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
                   ` (3 preceding siblings ...)
  2019-01-31 20:43 ` [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks Andrey Smirnov
@ 2019-01-31 20:43 ` Andrey Smirnov
  4 siblings, 0 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-01-31 20:43 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Andrey Smirnov, Fabio Estevam, Chris Healy, Lucas Stach,
	Leonard Crestez, A.s. Dong, Richard Zhu, linux-imx,
	linux-arm-kernel, linux-kernel

Enable PCIE0 interface connected to BCM4356 WiFi/Bluetooth module.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Shawn Guo <shawnguo@kernel.org>
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
---
 arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
index 64acccc4bfcb..6c7af6c0c9a6 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
@@ -40,6 +40,14 @@
 	status = "okay";
 };
 
+&gpio5 {
+ 	wl-reg-on {
+		gpio-hog;
+		gpios = <29 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
+};
+
 &i2c1 {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
@@ -131,6 +139,13 @@
 	};
 };
 
+&pcie0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pcie0>;
+	reset-gpio = <&gpio5 28 GPIO_ACTIVE_LOW>;
+	status = "okay";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
@@ -195,6 +210,14 @@
 		>;
 	};
 
+	pinctrl_pcie0: pcie0grp {
+		fsl,pins = <
+			MX8MQ_IOMUXC_I2C4_SCL_PCIE1_CLKREQ_B		0x76
+			MX8MQ_IOMUXC_UART4_TXD_GPIO5_IO29		0x16
+			MX8MQ_IOMUXC_UART4_RXD_GPIO5_IO28		0x16
+		>;
+	};
+
 	pinctrl_reg_usdhc2: regusdhc2grpgpio {
 		fsl,pins = <
 			MX8MQ_IOMUXC_SD2_RESET_B_GPIO2_IO19		0x41
-- 
2.20.1


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

* Re: [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks
  2019-01-31 20:43 ` [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks Andrey Smirnov
@ 2019-02-07 14:27   ` Lucas Stach
  2019-02-07 21:22     ` Andrey Smirnov
  0 siblings, 1 reply; 8+ messages in thread
From: Lucas Stach @ 2019-02-07 14:27 UTC (permalink / raw)
  To: Andrey Smirnov, Shawn Guo
  Cc: Fabio Estevam, Chris Healy, Leonard Crestez, A.s. Dong,
	Richard Zhu, linux-imx, linux-arm-kernel, linux-kernel

Am Donnerstag, den 31.01.2019, 12:43 -0800 schrieb Andrey Smirnov:
> Add nodes for two PCIe controllers found on i.MX8MQ.
> 
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Cc: Shawn Guo <shawnguo@kernel.org>
> > 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
> ---
>  arch/arm64/boot/dts/freescale/imx8mq.dtsi | 68 +++++++++++++++++++++++
>  1 file changed, 68 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> index 89babc531380..d20e5c7e21a3 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> @@ -6,6 +6,7 @@
>  
>  #include <dt-bindings/clock/imx8mq-clock.h>
>  #include <dt-bindings/power/imx8mq-power.h>
> +#include <dt-bindings/reset/imx8mq-reset.h>
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
>  #include "imx8mq-pinfunc.h"
> @@ -539,6 +540,73 @@
>  			};
>  	
> 	};
>  
> +		pcie0: pcie@33800000 {
> +			compatible = "fsl,imx8mq-pcie";
> +			reg = <0x33800000 0x400000>,
> +			      <0x1ff00000 0x80000>;
> +			reg-names = "dbi", "config";
> +			#address-cells = <3>;
> +			#size-cells = <2>;
> +			device_type = "pci";
> +			bus-range = <0x00 0xff>;
> +			ranges = <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000 /* downstream I/O 64KB */
> +			          0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
> +			num-lanes = <1>;
> +			interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
> +			             <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */

I don't think this IRQ is documented in any binding yet.

> +			interrupt-names = "msi";
> +			#interrupt-cells = <1>;
> +			interrupt-map-mask = <0 0 0 0x7>;
> +			interrupt-map = <0 0 0 1 &gic GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
> +			                <0 0 0 2 &gic GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
> +			                <0 0 0 3 &gic GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
> +			                <0 0 0 4 &gic GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&clk IMX8MQ_CLK_PCIE1_ROOT>,
> +			         <&clk IMX8MQ_CLK_PCIE1_AUX>,

This is not the PCIe bus clock. The bus clock is whatever drives the
ref clock of the external bus. So on the i.MX8M-EVK this would be the
fixed clock generated by U1302.

The right thing to properly describe the HW is to extend the PCIe
driver to look for the aux clock on i.MX8M, just like we do with the
axi_inbound_clk on i.MX6SX.

Regards,
Lucas

> +			         <&clk IMX8MQ_CLK_PCIE1_PHY>;
> +			clock-names = "pcie", "pcie_bus", "pcie_phy";
> +			fsl,max-link-speed = <2>;
> +			power-domains = <&pgc_pcie>;
> +			resets = <&src IMX8MQ_RESET_PCIEPHY>,
> +			         <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
> +			         <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
> +			reset-names = "pciephy", "apps", "turnoff";
> +			status = "disabled";
> +		};
> 

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

* Re: [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks
  2019-02-07 14:27   ` Lucas Stach
@ 2019-02-07 21:22     ` Andrey Smirnov
  0 siblings, 0 replies; 8+ messages in thread
From: Andrey Smirnov @ 2019-02-07 21:22 UTC (permalink / raw)
  To: Lucas Stach
  Cc: Shawn Guo, Fabio Estevam, Chris Healy, Leonard Crestez,
	A.s. Dong, Richard Zhu, dl-linux-imx, linux-arm-kernel,
	linux-kernel

On Thu, Feb 7, 2019 at 6:27 AM Lucas Stach <l.stach@pengutronix.de> wrote:
>
> Am Donnerstag, den 31.01.2019, 12:43 -0800 schrieb Andrey Smirnov:
> > Add nodes for two PCIe controllers found on i.MX8MQ.
> >
> > > Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> > > Cc: Shawn Guo <shawnguo@kernel.org>
> > > 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
> > ---
> >  arch/arm64/boot/dts/freescale/imx8mq.dtsi | 68 +++++++++++++++++++++++
> >  1 file changed, 68 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > index 89babc531380..d20e5c7e21a3 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
> > @@ -6,6 +6,7 @@
> >
> >  #include <dt-bindings/clock/imx8mq-clock.h>
> >  #include <dt-bindings/power/imx8mq-power.h>
> > +#include <dt-bindings/reset/imx8mq-reset.h>
> >  #include <dt-bindings/gpio/gpio.h>
> >  #include <dt-bindings/interrupt-controller/arm-gic.h>
> >  #include "imx8mq-pinfunc.h"
> > @@ -539,6 +540,73 @@
> >                       };
> >
> >       };
> >
> > +             pcie0: pcie@33800000 {
> > +                     compatible = "fsl,imx8mq-pcie";
> > +                     reg = <0x33800000 0x400000>,
> > +                           <0x1ff00000 0x80000>;
> > +                     reg-names = "dbi", "config";
> > +                     #address-cells = <3>;
> > +                     #size-cells = <2>;
> > +                     device_type = "pci";
> > +                     bus-range = <0x00 0xff>;
> > +                     ranges = <0x81000000 0 0x00000000 0x1ff80000 0 0x00010000 /* downstream I/O 64KB */
> > +                               0x82000000 0 0x18000000 0x18000000 0 0x07f00000>; /* non-prefetchable memory */
> > +                     num-lanes = <1>;
> > +                     interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
> > +                                  <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */
>
> I don't think this IRQ is documented in any binding yet.
>

A leftover from vendor tree. Will drop in v2.

> > +                     interrupt-names = "msi";
> > +                     #interrupt-cells = <1>;
> > +                     interrupt-map-mask = <0 0 0 0x7>;
> > +                     interrupt-map = <0 0 0 1 &gic GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
> > +                                     <0 0 0 2 &gic GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
> > +                                     <0 0 0 3 &gic GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
> > +                                     <0 0 0 4 &gic GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
> > +                     clocks = <&clk IMX8MQ_CLK_PCIE1_ROOT>,
> > +                              <&clk IMX8MQ_CLK_PCIE1_AUX>,
>
> This is not the PCIe bus clock. The bus clock is whatever drives the
> ref clock of the external bus. So on the i.MX8M-EVK this would be the
> fixed clock generated by U1302.
>
> The right thing to properly describe the HW is to extend the PCIe
> driver to look for the aux clock on i.MX8M, just like we do with the
> axi_inbound_clk on i.MX6SX.
>

OK, will update it in v2 and send a corresponding patch to PCI tree
once everything is agreed upon.

Thanks,
Andrey Smirnov

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

end of thread, other threads:[~2019-02-07 21:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 20:43 [RFC 0/5] PCIE support for i.MX8MQ (DT changes) Andrey Smirnov
2019-01-31 20:43 ` [RFC 1/5] arm64: dts: imx8mq: Mark iomuxc_gpr as i.MX6Q compatible Andrey Smirnov
2019-01-31 20:43 ` [RFC 2/5] arm64: dts: imx8mq: Add a node for SRC IP block Andrey Smirnov
2019-01-31 20:43 ` [RFC 3/5] arm64: dts: imx8mq: Combine PCIE power domains Andrey Smirnov
2019-01-31 20:43 ` [RFC 4/5] arm64: dts: Add nodes for PCIe IP blocks Andrey Smirnov
2019-02-07 14:27   ` Lucas Stach
2019-02-07 21:22     ` Andrey Smirnov
2019-01-31 20:43 ` [RFC 5/5] arm64: dts: imx8mq-evk: Enable PCIE0 interface Andrey Smirnov

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