* [PATCH v5 01/14] dt-bindings: imx6q-pcie: Add i.MX8MM PCIe EP mode compatible string
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 02/14] dt-bindings: imx6q-pcie: Add i.MX8MQ " Richard Zhu
` (13 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MM PCIe endpoint mode compatible string.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
index bad980902f66..6a547aabe729 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
@@ -24,6 +24,7 @@ properties:
- fsl,imx8mq-pcie
- fsl,imx8mm-pcie
- fsl,imx8mp-pcie
+ - fsl,imx8mm-pcie-ep
reg:
items:
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 02/14] dt-bindings: imx6q-pcie: Add i.MX8MQ PCIe EP mode compatible string
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
2023-01-16 5:41 ` [PATCH v5 01/14] dt-bindings: imx6q-pcie: Add i.MX8MM PCIe EP mode compatible string Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 03/14] dt-bindings: imx6q-pcie: Add i.MX8MP " Richard Zhu
` (12 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MQ PCIe endpoint mode compatible string.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
index 6a547aabe729..b57f748acafa 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
@@ -25,6 +25,7 @@ properties:
- fsl,imx8mm-pcie
- fsl,imx8mp-pcie
- fsl,imx8mm-pcie-ep
+ - fsl,imx8mq-pcie-ep
reg:
items:
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 03/14] dt-bindings: imx6q-pcie: Add i.MX8MP PCIe EP mode compatible string
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
2023-01-16 5:41 ` [PATCH v5 01/14] dt-bindings: imx6q-pcie: Add i.MX8MM PCIe EP mode compatible string Richard Zhu
2023-01-16 5:41 ` [PATCH v5 02/14] dt-bindings: imx6q-pcie: Add i.MX8MQ " Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support Richard Zhu
` (11 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MP PCIe endpoint mode compatible string.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
index b57f748acafa..f13f87fddb3d 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
@@ -26,6 +26,7 @@ properties:
- fsl,imx8mp-pcie
- fsl,imx8mm-pcie-ep
- fsl,imx8mq-pcie-ep
+ - fsl,imx8mp-pcie-ep
reg:
items:
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (2 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 03/14] dt-bindings: imx6q-pcie: Add i.MX8MP " Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-26 6:47 ` Shawn Guo
2023-01-16 5:41 ` [PATCH v5 05/14] arm64: dts: Add i.MX8MM PCIe EP support on EVK board Richard Zhu
` (10 subsequent siblings)
14 siblings, 1 reply; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MM PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index 4ee89fdcf59b..8124761f629c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -1293,6 +1293,26 @@ pcie0: pcie@33800000 {
status = "disabled";
};
+ pcie0_ep: pcie_ep@33800000 {
+ compatible = "fsl,imx8mm-pcie-ep";
+ reg = <0x33800000 0x400000>,
+ <0x18000000 0x8000000>;
+ reg-names = "regs", "addr_space";
+ num-lanes = <1>;
+ interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "dma";
+ fsl,max-link-speed = <2>;
+ power-domains = <&pgc_pcie>;
+ resets = <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
+ <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
+ reset-names = "apps", "turnoff";
+ phys = <&pcie_phy>;
+ phy-names = "pcie-phy";
+ num-ib-windows = <4>;
+ num-ob-windows = <4>;
+ status = "disabled";
+ };
+
gpu_3d: gpu@38000000 {
compatible = "vivante,gc";
reg = <0x38000000 0x8000>;
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support
2023-01-16 5:41 ` [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support Richard Zhu
@ 2023-01-26 6:47 ` Shawn Guo
2023-01-26 8:37 ` Shawn Guo
0 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2023-01-26 6:47 UTC (permalink / raw)
To: Richard Zhu
Cc: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, kishon, kw,
frank.li, linux-pci, devicetree, linux-arm-kernel, linux-kernel,
kernel, linux-imx
On Mon, Jan 16, 2023 at 01:41:14PM +0800, Richard Zhu wrote:
> Add i.MX8MM PCIe EP support.
>
> Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> ---
> arch/arm64/boot/dts/freescale/imx8mm.dtsi | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index 4ee89fdcf59b..8124761f629c 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -1293,6 +1293,26 @@ pcie0: pcie@33800000 {
> status = "disabled";
> };
>
> + pcie0_ep: pcie_ep@33800000 {
Hyphen is more preferable than underscore in name node.
I fixed it (and the other two patches) up, and applied all DTS patches.
Shawn
> + compatible = "fsl,imx8mm-pcie-ep";
> + reg = <0x33800000 0x400000>,
> + <0x18000000 0x8000000>;
> + reg-names = "regs", "addr_space";
> + num-lanes = <1>;
> + interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "dma";
> + fsl,max-link-speed = <2>;
> + power-domains = <&pgc_pcie>;
> + resets = <&src IMX8MQ_RESET_PCIE_CTRL_APPS_EN>,
> + <&src IMX8MQ_RESET_PCIE_CTRL_APPS_TURNOFF>;
> + reset-names = "apps", "turnoff";
> + phys = <&pcie_phy>;
> + phy-names = "pcie-phy";
> + num-ib-windows = <4>;
> + num-ob-windows = <4>;
> + status = "disabled";
> + };
> +
> gpu_3d: gpu@38000000 {
> compatible = "vivante,gc";
> reg = <0x38000000 0x8000>;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support
2023-01-26 6:47 ` Shawn Guo
@ 2023-01-26 8:37 ` Shawn Guo
0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2023-01-26 8:37 UTC (permalink / raw)
To: Richard Zhu
Cc: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, kishon, kw,
frank.li, linux-pci, devicetree, linux-arm-kernel, linux-kernel,
kernel, linux-imx
On Thu, Jan 26, 2023 at 2:47 PM Shawn Guo <shawnguo@kernel.org> wrote:
>
> On Mon, Jan 16, 2023 at 01:41:14PM +0800, Richard Zhu wrote:
> > Add i.MX8MM PCIe EP support.
> >
> > Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
> > ---
> > arch/arm64/boot/dts/freescale/imx8mm.dtsi | 20 ++++++++++++++++++++
> > 1 file changed, 20 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > index 4ee89fdcf59b..8124761f629c 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > @@ -1293,6 +1293,26 @@ pcie0: pcie@33800000 {
> > status = "disabled";
> > };
> >
> > + pcie0_ep: pcie_ep@33800000 {
>
> Hyphen is more preferable than underscore in name node.
>
> I fixed it (and the other two patches) up, and applied all DTS patches.
Dropped them, as I just noticed there is v6 of DTS patches being discussed.
Shawn
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v5 05/14] arm64: dts: Add i.MX8MM PCIe EP support on EVK board
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (3 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 04/14] arm64: dts: Add i.MX8MM PCIe EP support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 06/14] arm64: dts: Add i.MX8MQ PCIe EP support Richard Zhu
` (9 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MM PCIe EP support on EVK board.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
index e0b604ac0da4..894118704156 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
@@ -372,6 +372,20 @@ &pcie0 {
status = "okay";
};
+&pcie0_ep{
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pcie0>;
+ clocks = <&clk IMX8MM_CLK_PCIE1_ROOT>, <&clk IMX8MM_CLK_PCIE1_AUX>,
+ <&pcie0_refclk>;
+ clock-names = "pcie", "pcie_aux", "pcie_bus";
+ assigned-clocks = <&clk IMX8MM_CLK_PCIE1_AUX>,
+ <&clk IMX8MM_CLK_PCIE1_CTRL>;
+ assigned-clock-rates = <10000000>, <250000000>;
+ assigned-clock-parents = <&clk IMX8MM_SYS_PLL2_50M>,
+ <&clk IMX8MM_SYS_PLL2_250M>;
+ status = "disabled";
+};
+
&sai2 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 06/14] arm64: dts: Add i.MX8MQ PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (4 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 05/14] arm64: dts: Add i.MX8MM PCIe EP support on EVK board Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 07/14] arm64: dts: Add i.MX8MQ PCIe EP support on EVK board Richard Zhu
` (8 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MQ PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
index 7ce99c084e54..90a1f026ea48 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi
@@ -1583,6 +1583,33 @@ pcie1: pcie@33c00000 {
status = "disabled";
};
+ pcie1_ep: pcie_ep@33c00000 {
+ compatible = "fsl,imx8mq-pcie-ep";
+ reg = <0x33c00000 0x000400000>,
+ <0x20000000 0x08000000>;
+ reg-names = "regs", "addr_space";
+ num-lanes = <1>;
+ interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "dma";
+ 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";
+ assigned-clocks = <&clk IMX8MQ_CLK_PCIE2_CTRL>,
+ <&clk IMX8MQ_CLK_PCIE2_PHY>,
+ <&clk IMX8MQ_CLK_PCIE2_AUX>;
+ assigned-clock-parents = <&clk IMX8MQ_SYS2_PLL_250M>,
+ <&clk IMX8MQ_SYS2_PLL_100M>,
+ <&clk IMX8MQ_SYS1_PLL_80M>;
+ assigned-clock-rates = <250000000>, <100000000>,
+ <10000000>;
+ num-ib-windows = <4>;
+ num-ob-windows = <4>;
+ status = "disabled";
+ };
+
gic: interrupt-controller@38800000 {
compatible = "arm,gic-v3";
reg = <0x38800000 0x10000>, /* GIC Dist */
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 07/14] arm64: dts: Add i.MX8MQ PCIe EP support on EVK board
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (5 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 06/14] arm64: dts: Add i.MX8MQ PCIe EP support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 08/14] arm64: dts: Add i.MX8MP PCIe EP support Richard Zhu
` (7 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MQ PCIe EP support on EVK board.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
index 78937910f403..c815c4b8907e 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
@@ -378,6 +378,18 @@ &pcie1 {
status = "okay";
};
+&pcie1_ep {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pcie1>;
+ clocks = <&clk IMX8MQ_CLK_PCIE2_ROOT>,
+ <&clk IMX8MQ_CLK_PCIE2_AUX>,
+ <&clk IMX8MQ_CLK_PCIE2_PHY>,
+ <&pcie0_refclk>;
+ clock-names = "pcie", "pcie_aux", "pcie_phy", "pcie_bus";
+ vph-supply = <&vgen5_reg>;
+ status = "disabled";
+};
+
&pgc_gpu {
power-supply = <&sw1a_reg>;
};
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 08/14] arm64: dts: Add i.MX8MP PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (6 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 07/14] arm64: dts: Add i.MX8MQ PCIe EP support on EVK board Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 09/14] arm64: dts: Add i.MX8MP PCIe EP support on EVK board Richard Zhu
` (6 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MP PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 26 +++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 4ef36ebc6bfe..9ad9edd18e09 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1217,6 +1217,32 @@ pcie: pcie@33800000 {
status = "disabled";
};
+ pcie_ep: pcie_ep@33800000 {
+ compatible = "fsl,imx8mp-pcie-ep";
+ reg = <0x33800000 0x000400000>, <0x18000000 0x08000000>;
+ reg-names = "regs", "addr_space";
+ clocks = <&clk IMX8MP_CLK_HSIO_ROOT>,
+ <&clk IMX8MP_CLK_PCIE_ROOT>,
+ <&clk IMX8MP_CLK_HSIO_AXI>;
+ clock-names = "pcie", "pcie_aux", "pcie_bus";
+ assigned-clocks = <&clk IMX8MP_CLK_PCIE_AUX>;
+ assigned-clock-rates = <10000000>;
+ assigned-clock-parents = <&clk IMX8MP_SYS_PLL2_50M>;
+ num-lanes = <1>;
+ interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; /* eDMA */
+ interrupt-names = "dma";
+ fsl,max-link-speed = <3>;
+ power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_PCIE>;
+ resets = <&src IMX8MP_RESET_PCIE_CTRL_APPS_EN>,
+ <&src IMX8MP_RESET_PCIE_CTRL_APPS_TURNOFF>;
+ reset-names = "apps", "turnoff";
+ phys = <&pcie_phy>;
+ phy-names = "pcie-phy";
+ num-ib-windows = <4>;
+ num-ob-windows = <4>;
+ status = "disabled";
+ };
+
gpu3d: gpu@38000000 {
compatible = "vivante,gc";
reg = <0x38000000 0x8000>;
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 09/14] arm64: dts: Add i.MX8MP PCIe EP support on EVK board
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (7 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 08/14] arm64: dts: Add i.MX8MP PCIe EP support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 10/14] misc: pci_endpoint_test: Add i.MX8 PCIe EP device support Richard Zhu
` (5 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MP PCIe EP support on EVK board.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
index c4ed505b8707..c0dd04d9f106 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
@@ -404,6 +404,12 @@ &pcie {
status = "okay";
};
+&pcie_ep{
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pcie0>;
+ status = "disabled";
+};
+
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 10/14] misc: pci_endpoint_test: Add i.MX8 PCIe EP device support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (8 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 09/14] arm64: dts: Add i.MX8MP PCIe EP support on EVK board Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 11/14] PCI: imx6: Add i.MX PCIe EP mode support Richard Zhu
` (4 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Set the DEVICE_ID of i.MX8 PCIe and add i.MX8 PCIE EP device support in
pci_endpoint_test driver.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
drivers/misc/pci_endpoint_test.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 11530b4ec389..e2687229955d 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -72,6 +72,7 @@
#define PCI_DEVICE_ID_TI_J7200 0xb00f
#define PCI_DEVICE_ID_TI_AM64 0xb010
#define PCI_DEVICE_ID_LS1088A 0x80c0
+#define PCI_DEVICE_ID_IMX8 0x0808
#define is_am654_pci_dev(pdev) \
((pdev)->device == PCI_DEVICE_ID_TI_AM654)
@@ -980,6 +981,7 @@ static const struct pci_device_id pci_endpoint_test_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, 0x81c0),
.driver_data = (kernel_ulong_t)&default_data,
},
+ { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_IMX8),},
{ PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, PCI_DEVICE_ID_LS1088A),
.driver_data = (kernel_ulong_t)&default_data,
},
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 11/14] PCI: imx6: Add i.MX PCIe EP mode support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (9 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 10/14] misc: pci_endpoint_test: Add i.MX8 PCIe EP device support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 12/14] PCI: imx6: Add i.MX8MQ PCIe EP support Richard Zhu
` (3 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
i.MX PCIe is one dual mode PCIe controller.
Add i.MX PCIe EP mode support here, and split the PCIe modes to the Root
Complex mode and Endpoint mode.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
drivers/pci/controller/dwc/Kconfig | 23 ++++-
drivers/pci/controller/dwc/pci-imx6.c | 128 +++++++++++++++++++++++---
2 files changed, 137 insertions(+), 14 deletions(-)
diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig
index a0d2713f0e88..dffd7fbdfb98 100644
--- a/drivers/pci/controller/dwc/Kconfig
+++ b/drivers/pci/controller/dwc/Kconfig
@@ -92,10 +92,31 @@ config PCI_EXYNOS
functions to implement the driver.
config PCI_IMX6
- bool "Freescale i.MX6/7/8 PCIe controller"
+ bool
+
+config PCI_IMX6_HOST
+ bool "Freescale i.MX6/7/8 PCIe controller host mode"
depends on ARCH_MXC || COMPILE_TEST
depends on PCI_MSI
select PCIE_DW_HOST
+ select PCI_IMX6
+ help
+ Enables support for the PCIe controller in the i.MX SoCs to
+ work in Root Complex mode. The PCI controller on i.MX is based
+ on DesignWare hardware and therefore the driver re-uses the
+ DesignWare core functions to implement the driver.
+
+config PCI_IMX6_EP
+ bool "Freescale i.MX6/7/8 PCIe controller endpoint mode"
+ depends on ARCH_MXC || COMPILE_TEST
+ depends on PCI_ENDPOINT
+ select PCIE_DW_EP
+ select PCI_IMX6
+ help
+ Enables support for the PCIe controller in the i.MX SoCs to
+ work in endpoint mode. The PCI controller on i.MX is based
+ on DesignWare hardware and therefore the driver re-uses the
+ DesignWare core functions to implement the driver.
config PCIE_SPEAR13XX
bool "STMicroelectronics SPEAr PCIe controller"
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 1dde5c579edc..572faa91eea7 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -60,6 +60,7 @@ enum imx6_pcie_variants {
struct imx6_pcie_drvdata {
enum imx6_pcie_variants variant;
+ enum dw_pcie_device_mode mode;
u32 flags;
int dbi_length;
const char *gpr;
@@ -159,17 +160,20 @@ static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie)
static void imx6_pcie_configure_type(struct imx6_pcie *imx6_pcie)
{
- unsigned int mask, val;
+ unsigned int mask, val, mode;
+
+ if (imx6_pcie->drvdata->mode == DW_PCIE_EP_TYPE)
+ mode = PCI_EXP_TYPE_ENDPOINT;
+ else
+ mode = PCI_EXP_TYPE_ROOT_PORT;
if (imx6_pcie->drvdata->variant == IMX8MQ &&
imx6_pcie->controller_id == 1) {
mask = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE;
- val = FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE,
- PCI_EXP_TYPE_ROOT_PORT);
+ val = FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, mode);
} else {
mask = IMX6Q_GPR12_DEVICE_TYPE;
- val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE,
- PCI_EXP_TYPE_ROOT_PORT);
+ val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode);
}
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, mask, val);
@@ -1003,8 +1007,99 @@ static const struct dw_pcie_host_ops imx6_pcie_host_ops = {
static const struct dw_pcie_ops dw_pcie_ops = {
.start_link = imx6_pcie_start_link,
+ .stop_link = imx6_pcie_stop_link,
+};
+
+static void imx6_pcie_ep_init(struct dw_pcie_ep *ep)
+{
+ enum pci_barno bar;
+ struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
+
+ for (bar = BAR_0; bar <= BAR_5; bar++)
+ dw_pcie_ep_reset_bar(pci, bar);
+}
+
+static int imx6_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
+ enum pci_epc_irq_type type,
+ u16 interrupt_num)
+{
+ struct dw_pcie *pci = to_dw_pcie_from_ep(ep);
+
+ switch (type) {
+ case PCI_EPC_IRQ_LEGACY:
+ return dw_pcie_ep_raise_legacy_irq(ep, func_no);
+ case PCI_EPC_IRQ_MSI:
+ return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
+ case PCI_EPC_IRQ_MSIX:
+ return dw_pcie_ep_raise_msix_irq(ep, func_no, interrupt_num);
+ default:
+ dev_err(pci->dev, "UNKNOWN IRQ type\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static const struct pci_epc_features imx8m_pcie_epc_features = {
+ .linkup_notifier = false,
+ .msi_capable = true,
+ .msix_capable = false,
+ .reserved_bar = 1 << BAR_1 | 1 << BAR_3,
+ .align = SZ_64K,
+};
+
+static const struct pci_epc_features*
+imx6_pcie_ep_get_features(struct dw_pcie_ep *ep)
+{
+ return &imx8m_pcie_epc_features;
+}
+
+static const struct dw_pcie_ep_ops pcie_ep_ops = {
+ .ep_init = imx6_pcie_ep_init,
+ .raise_irq = imx6_pcie_ep_raise_irq,
+ .get_features = imx6_pcie_ep_get_features,
};
+static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
+ struct platform_device *pdev)
+{
+ int ret;
+ unsigned int pcie_dbi2_offset;
+ struct dw_pcie_ep *ep;
+ struct resource *res;
+ struct dw_pcie *pci = imx6_pcie->pci;
+ struct dw_pcie_rp *pp = &pci->pp;
+ struct device *dev = pci->dev;
+
+ imx6_pcie_host_init(pp);
+ ep = &pci->ep;
+ ep->ops = &pcie_ep_ops;
+
+ switch (imx6_pcie->drvdata->variant) {
+ default:
+ pcie_dbi2_offset = SZ_4K;
+ break;
+ }
+ pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset;
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
+ if (!res)
+ return -EINVAL;
+
+ ep->phys_base = res->start;
+ ep->addr_size = resource_size(res);
+ ep->page_size = SZ_64K;
+
+ ret = dw_pcie_ep_init(ep);
+ if (ret) {
+ dev_err(dev, "failed to initialize endpoint\n");
+ return ret;
+ }
+ /* Start LTSSM. */
+ imx6_pcie_ltssm_enable(dev);
+
+ return 0;
+}
+
static void imx6_pcie_pm_turnoff(struct imx6_pcie *imx6_pcie)
{
struct device *dev = imx6_pcie->pci->dev;
@@ -1279,15 +1374,22 @@ static int imx6_pcie_probe(struct platform_device *pdev)
if (ret)
return ret;
- ret = dw_pcie_host_init(&pci->pp);
- if (ret < 0)
- return ret;
+ if (imx6_pcie->drvdata->mode == DW_PCIE_EP_TYPE) {
+ ret = imx6_add_pcie_ep(imx6_pcie, pdev);
+ if (ret < 0)
+ return ret;
+ } else {
+ ret = dw_pcie_host_init(&pci->pp);
+ if (ret < 0)
+ return ret;
+
+ if (pci_msi_enabled()) {
+ u8 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_MSI);
- if (pci_msi_enabled()) {
- u8 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_MSI);
- val = dw_pcie_readw_dbi(pci, offset + PCI_MSI_FLAGS);
- val |= PCI_MSI_FLAGS_ENABLE;
- dw_pcie_writew_dbi(pci, offset + PCI_MSI_FLAGS, val);
+ val = dw_pcie_readw_dbi(pci, offset + PCI_MSI_FLAGS);
+ val |= PCI_MSI_FLAGS_ENABLE;
+ dw_pcie_writew_dbi(pci, offset + PCI_MSI_FLAGS, val);
+ }
}
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 12/14] PCI: imx6: Add i.MX8MQ PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (10 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 11/14] PCI: imx6: Add i.MX PCIe EP mode support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 13/14] PCI: imx6: Add i.MX8MM " Richard Zhu
` (2 subsequent siblings)
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MQ PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 38 +++++++++++++++++++++++----
1 file changed, 33 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 572faa91eea7..8190b1de67f9 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -52,6 +52,7 @@ enum imx6_pcie_variants {
IMX8MQ,
IMX8MM,
IMX8MP,
+ IMX8MQ_EP,
};
#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0)
@@ -153,6 +154,7 @@ struct imx6_pcie {
static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie)
{
WARN_ON(imx6_pcie->drvdata->variant != IMX8MQ &&
+ imx6_pcie->drvdata->variant != IMX8MQ_EP &&
imx6_pcie->drvdata->variant != IMX8MM &&
imx6_pcie->drvdata->variant != IMX8MP);
return imx6_pcie->controller_id == 1 ? IOMUXC_GPR16 : IOMUXC_GPR14;
@@ -167,13 +169,22 @@ static void imx6_pcie_configure_type(struct imx6_pcie *imx6_pcie)
else
mode = PCI_EXP_TYPE_ROOT_PORT;
- if (imx6_pcie->drvdata->variant == IMX8MQ &&
- imx6_pcie->controller_id == 1) {
- mask = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE;
- val = FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE, mode);
- } else {
+ switch (imx6_pcie->drvdata->variant) {
+ case IMX8MQ:
+ case IMX8MQ_EP:
+ if (imx6_pcie->controller_id == 1) {
+ mask = IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE;
+ val = FIELD_PREP(IMX8MQ_GPR12_PCIE2_CTRL_DEVICE_TYPE,
+ mode);
+ } else {
+ mask = IMX6Q_GPR12_DEVICE_TYPE;
+ val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode);
+ }
+ break;
+ default:
mask = IMX6Q_GPR12_DEVICE_TYPE;
val = FIELD_PREP(IMX6Q_GPR12_DEVICE_TYPE, mode);
+ break;
}
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12, mask, val);
@@ -315,6 +326,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
*/
break;
case IMX8MQ:
+ case IMX8MQ_EP:
/*
* TODO: Currently this code assumes external
* oscillator is being used
@@ -566,6 +578,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
break;
case IMX8MM:
case IMX8MQ:
+ case IMX8MQ_EP:
case IMX8MP:
ret = clk_prepare_enable(imx6_pcie->pcie_aux);
if (ret) {
@@ -611,6 +624,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
break;
case IMX8MM:
case IMX8MQ:
+ case IMX8MQ_EP:
case IMX8MP:
clk_disable_unprepare(imx6_pcie->pcie_aux);
break;
@@ -676,6 +690,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
switch (imx6_pcie->drvdata->variant) {
case IMX7D:
case IMX8MQ:
+ case IMX8MQ_EP:
reset_control_assert(imx6_pcie->pciephy_reset);
fallthrough;
case IMX8MM:
@@ -717,6 +732,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
switch (imx6_pcie->drvdata->variant) {
case IMX8MQ:
+ case IMX8MQ_EP:
reset_control_deassert(imx6_pcie->pciephy_reset);
break;
case IMX7D:
@@ -804,6 +820,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
break;
case IMX7D:
case IMX8MQ:
+ case IMX8MQ_EP:
case IMX8MM:
case IMX8MP:
reset_control_deassert(imx6_pcie->apps_reset);
@@ -824,6 +841,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
break;
case IMX7D:
case IMX8MQ:
+ case IMX8MQ_EP:
case IMX8MM:
case IMX8MP:
reset_control_assert(imx6_pcie->apps_reset);
@@ -1076,6 +1094,9 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
ep->ops = &pcie_ep_ops;
switch (imx6_pcie->drvdata->variant) {
+ case IMX8MQ_EP:
+ pcie_dbi2_offset = SZ_1M;
+ break;
default:
pcie_dbi2_offset = SZ_4K;
break;
@@ -1261,6 +1282,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
"pcie_inbound_axi clock missing or invalid\n");
break;
case IMX8MQ:
+ case IMX8MQ_EP:
imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
if (IS_ERR(imx6_pcie->pcie_aux))
return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux),
@@ -1445,6 +1467,11 @@ static const struct imx6_pcie_drvdata drvdata[] = {
.flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
.gpr = "fsl,imx8mp-iomuxc-gpr",
},
+ [IMX8MQ_EP] = {
+ .variant = IMX8MQ_EP,
+ .mode = DW_PCIE_EP_TYPE,
+ .gpr = "fsl,imx8mq-iomuxc-gpr",
+ },
};
static const struct of_device_id imx6_pcie_of_match[] = {
@@ -1455,6 +1482,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
{ .compatible = "fsl,imx8mq-pcie", .data = &drvdata[IMX8MQ], },
{ .compatible = "fsl,imx8mm-pcie", .data = &drvdata[IMX8MM], },
{ .compatible = "fsl,imx8mp-pcie", .data = &drvdata[IMX8MP], },
+ { .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], },
{},
};
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 13/14] PCI: imx6: Add i.MX8MM PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (11 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 12/14] PCI: imx6: Add i.MX8MQ PCIe EP support Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 5:41 ` [PATCH v5 14/14] PCI: imx6: Add i.MX8MP " Richard Zhu
2023-01-16 9:45 ` (subset) [PATCH v5 0/14] Add i.MX PCIe EP mode support Lorenzo Pieralisi
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add i.MX8MM PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 8190b1de67f9..eab332eb4c36 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -53,6 +53,7 @@ enum imx6_pcie_variants {
IMX8MM,
IMX8MP,
IMX8MQ_EP,
+ IMX8MM_EP,
};
#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0)
@@ -156,6 +157,7 @@ static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie)
WARN_ON(imx6_pcie->drvdata->variant != IMX8MQ &&
imx6_pcie->drvdata->variant != IMX8MQ_EP &&
imx6_pcie->drvdata->variant != IMX8MM &&
+ imx6_pcie->drvdata->variant != IMX8MM_EP &&
imx6_pcie->drvdata->variant != IMX8MP);
return imx6_pcie->controller_id == 1 ? IOMUXC_GPR16 : IOMUXC_GPR14;
}
@@ -319,6 +321,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
{
switch (imx6_pcie->drvdata->variant) {
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
/*
* The PHY initialization had been done in the PHY
@@ -577,6 +580,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
case IMX7D:
break;
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MP:
@@ -623,6 +627,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
break;
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MP:
@@ -694,6 +699,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
reset_control_assert(imx6_pcie->pciephy_reset);
fallthrough;
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
reset_control_assert(imx6_pcie->apps_reset);
break;
@@ -771,6 +777,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
break;
case IMX6Q: /* Nothing to do */
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
break;
}
@@ -822,6 +829,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
reset_control_deassert(imx6_pcie->apps_reset);
break;
@@ -843,6 +851,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
reset_control_assert(imx6_pcie->apps_reset);
break;
@@ -1095,6 +1104,7 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
switch (imx6_pcie->drvdata->variant) {
case IMX8MQ_EP:
+ case IMX8MM_EP:
pcie_dbi2_offset = SZ_1M;
break;
default:
@@ -1307,6 +1317,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
}
break;
case IMX8MM:
+ case IMX8MM_EP:
case IMX8MP:
imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
if (IS_ERR(imx6_pcie->pcie_aux))
@@ -1472,6 +1483,11 @@ static const struct imx6_pcie_drvdata drvdata[] = {
.mode = DW_PCIE_EP_TYPE,
.gpr = "fsl,imx8mq-iomuxc-gpr",
},
+ [IMX8MM_EP] = {
+ .variant = IMX8MM_EP,
+ .mode = DW_PCIE_EP_TYPE,
+ .gpr = "fsl,imx8mm-iomuxc-gpr",
+ },
};
static const struct of_device_id imx6_pcie_of_match[] = {
@@ -1483,6 +1499,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
{ .compatible = "fsl,imx8mm-pcie", .data = &drvdata[IMX8MM], },
{ .compatible = "fsl,imx8mp-pcie", .data = &drvdata[IMX8MP], },
{ .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], },
+ { .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], },
{},
};
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v5 14/14] PCI: imx6: Add i.MX8MP PCIe EP support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (12 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 13/14] PCI: imx6: Add i.MX8MM " Richard Zhu
@ 2023-01-16 5:41 ` Richard Zhu
2023-01-16 9:45 ` (subset) [PATCH v5 0/14] Add i.MX PCIe EP mode support Lorenzo Pieralisi
14 siblings, 0 replies; 18+ messages in thread
From: Richard Zhu @ 2023-01-16 5:41 UTC (permalink / raw)
To: l.stach, bhelgaas, robh+dt, lorenzo.pieralisi, shawnguo, kishon,
kw, frank.li
Cc: hongxing.zhu, linux-pci, devicetree, linux-arm-kernel,
linux-kernel, kernel, linux-imx
Add the i.MX8MP PCIe EP support.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
drivers/pci/controller/dwc/pci-imx6.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index eab332eb4c36..55a0405b921d 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -54,6 +54,7 @@ enum imx6_pcie_variants {
IMX8MP,
IMX8MQ_EP,
IMX8MM_EP,
+ IMX8MP_EP,
};
#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0)
@@ -158,7 +159,8 @@ static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie)
imx6_pcie->drvdata->variant != IMX8MQ_EP &&
imx6_pcie->drvdata->variant != IMX8MM &&
imx6_pcie->drvdata->variant != IMX8MM_EP &&
- imx6_pcie->drvdata->variant != IMX8MP);
+ imx6_pcie->drvdata->variant != IMX8MP &&
+ imx6_pcie->drvdata->variant != IMX8MP_EP);
return imx6_pcie->controller_id == 1 ? IOMUXC_GPR16 : IOMUXC_GPR14;
}
@@ -323,6 +325,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
/*
* The PHY initialization had been done in the PHY
* driver, break here directly.
@@ -584,6 +587,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MP:
+ case IMX8MP_EP:
ret = clk_prepare_enable(imx6_pcie->pcie_aux);
if (ret) {
dev_err(dev, "unable to enable pcie_aux clock\n");
@@ -631,6 +635,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MP:
+ case IMX8MP_EP:
clk_disable_unprepare(imx6_pcie->pcie_aux);
break;
default:
@@ -701,6 +706,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
reset_control_assert(imx6_pcie->apps_reset);
break;
case IMX6SX:
@@ -779,6 +785,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
break;
}
@@ -831,6 +838,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
reset_control_deassert(imx6_pcie->apps_reset);
break;
}
@@ -853,6 +861,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
reset_control_assert(imx6_pcie->apps_reset);
break;
}
@@ -1105,6 +1114,7 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
switch (imx6_pcie->drvdata->variant) {
case IMX8MQ_EP:
case IMX8MM_EP:
+ case IMX8MP_EP:
pcie_dbi2_offset = SZ_1M;
break;
default:
@@ -1319,6 +1329,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
case IMX8MM:
case IMX8MM_EP:
case IMX8MP:
+ case IMX8MP_EP:
imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
if (IS_ERR(imx6_pcie->pcie_aux))
return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux),
@@ -1488,6 +1499,11 @@ static const struct imx6_pcie_drvdata drvdata[] = {
.mode = DW_PCIE_EP_TYPE,
.gpr = "fsl,imx8mm-iomuxc-gpr",
},
+ [IMX8MP_EP] = {
+ .variant = IMX8MP_EP,
+ .mode = DW_PCIE_EP_TYPE,
+ .gpr = "fsl,imx8mp-iomuxc-gpr",
+ },
};
static const struct of_device_id imx6_pcie_of_match[] = {
@@ -1500,6 +1516,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
{ .compatible = "fsl,imx8mp-pcie", .data = &drvdata[IMX8MP], },
{ .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], },
{ .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], },
+ { .compatible = "fsl,imx8mp-pcie-ep", .data = &drvdata[IMX8MP_EP], },
{},
};
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: (subset) [PATCH v5 0/14] Add i.MX PCIe EP mode support
2023-01-16 5:41 [PATCH v5 0/14] Add i.MX PCIe EP mode support Richard Zhu
` (13 preceding siblings ...)
2023-01-16 5:41 ` [PATCH v5 14/14] PCI: imx6: Add i.MX8MP " Richard Zhu
@ 2023-01-16 9:45 ` Lorenzo Pieralisi
14 siblings, 0 replies; 18+ messages in thread
From: Lorenzo Pieralisi @ 2023-01-16 9:45 UTC (permalink / raw)
To: bhelgaas, kw, robh+dt, shawnguo, frank.li, Richard Zhu,
Lorenzo Pieralisi, l.stach, kishon
Cc: devicetree, linux-arm-kernel, linux-kernel, kernel, linux-pci, linux-imx
On Mon, 16 Jan 2023 13:41:10 +0800, Richard Zhu wrote:
> i.MX PCIe controller is one dual mode PCIe controller, and can work either
> as RC or EP.
>
> This series add the i.MX PCIe EP mode support. And had been verified on
> i.MX8MQ EVK, i.MX8MM EVK and i.MX8MP EVK boards.
>
> In the verification, one EVK board used as RC, the other one used as EP.
> Use the cross TX/RX differential cable connect the two PCIe ports of these
> two EVK boards.
>
> [...]
dts changes should go via the platform tree.
Applied to pci/imx6, thanks!
[01/14] dt-bindings: imx6q-pcie: Add i.MX8MM PCIe EP mode compatible string
https://git.kernel.org/lpieralisi/pci/c/1af5ea1dc2df
[02/14] dt-bindings: imx6q-pcie: Add i.MX8MQ PCIe EP mode compatible string
https://git.kernel.org/lpieralisi/pci/c/dea44b629ae1
[03/14] dt-bindings: imx6q-pcie: Add i.MX8MP PCIe EP mode compatible string
https://git.kernel.org/lpieralisi/pci/c/2dd6dc57d2da
[10/14] misc: pci_endpoint_test: Add i.MX8 PCIe EP device support
https://git.kernel.org/lpieralisi/pci/c/01ea5ede4197
[11/14] PCI: imx6: Add i.MX PCIe EP mode support
https://git.kernel.org/lpieralisi/pci/c/75c2f26da03f
[12/14] PCI: imx6: Add i.MX8MQ PCIe EP support
https://git.kernel.org/lpieralisi/pci/c/530ba41250b6
[13/14] PCI: imx6: Add i.MX8MM PCIe EP support
https://git.kernel.org/lpieralisi/pci/c/fb3217e2cfc6
[14/14] PCI: imx6: Add i.MX8MP PCIe EP support
https://git.kernel.org/lpieralisi/pci/c/c435669a41dd
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 18+ messages in thread