2023-08-02 07:06:26

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 0/9] Add legacy i.MX PCIe EP mode supports

Add legacy 32bit i.MX PCIe EP mode support

The PCI controller contained in i.MX6/7 legacy SOCs is one dual mode
PCIe controller, and can work either as RC or EP.

This series add i.MX6/7 PCIe EP mode supports. And had been verified
on i.MX6 sabresd and i.MX7 SDB boards.

In the verification, one board PCIe is used as RC, the other one is used
as EP.
Use the cross TX/RX differential cable connect the two PCIe ports of
these two boards.

+-----------+ +------------+
| PCIe TX |<-------------->|PCIe RX |
| | | |
| Board | | Board |
| | | |
| PCIe RX |<-------------->|PCIe TX |
+-----------+ +------------+

[PATCH 1/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6Q and i.MX6QP PCIe
[PATCH 2/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6SX PCIe EP
[PATCH 3/9] dt-bindings: PCI: fsl,imx6q: Add i.MX7D PCIe EP
[PATCH 4/9] arm: dts: nxp: Add i.MX6QDL and i.MX6QP PCIe EP supports
[PATCH 5/9] arm: dts: nxp: Add i.MX6SX PCIe EP support
[PATCH 6/9] arm: dts: nxp: Add i.MX7D PCIe EP support
[PATCH 7/9] PCI: imx6: Add i.MX6Q and i.MX6QP PCIe EP supports
[PATCH 8/9] PCI: imx6: Add i.MX6SX PCIe EP support
[PATCH 9/9] PCI: imx6: Add i.MX7D PCIe EP support

Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 50 +++++++++++++++++++++++++++++++++++++++++----
arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi | 14 +++++++++++++
arch/arm/boot/dts/nxp/imx/imx6qp.dtsi | 4 ++++
arch/arm/boot/dts/nxp/imx/imx6sx.dtsi | 17 +++++++++++++++
arch/arm/boot/dts/nxp/imx/imx7d.dtsi | 27 ++++++++++++++++++++++++
drivers/pci/controller/dwc/pci-imx6.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
6 files changed, 200 insertions(+), 5 deletions(-)



2023-08-02 07:15:19

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 6/9] arm: dts: nxp: Add i.MX7D PCIe EP support

Add i.MX7D PCIe EP support.

Signed-off-by: Richard Zhu <[email protected]>
---
arch/arm/boot/dts/nxp/imx/imx7d.dtsi | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/nxp/imx/imx7d.dtsi b/arch/arm/boot/dts/nxp/imx/imx7d.dtsi
index 4b94b8afb55d..135684f17a20 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7d.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7d.dtsi
@@ -156,6 +156,33 @@ pcie: pcie@33800000 {
fsl,imx7d-pcie-phy = <&pcie_phy>;
status = "disabled";
};
+
+ pcie_ep: pcie-ep@33800000 {
+ compatible = "fsl,imx7d-pcie-ep";
+ reg = <0x33800000 0x4000>,
+ <0x40000000 0x10000000>;
+ reg-names = "dbi", "addr_space";
+ num-lanes = <1>;
+ clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>,
+ <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>,
+ <&clks IMX7D_PCIE_PHY_ROOT_CLK>;
+ clock-names = "pcie", "pcie_bus", "pcie_phy";
+ assigned-clocks = <&clks IMX7D_PCIE_CTRL_ROOT_SRC>,
+ <&clks IMX7D_PCIE_PHY_ROOT_SRC>;
+ assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_250M_CLK>,
+ <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
+
+ fsl,max-link-speed = <2>;
+ power-domains = <&pgc_pcie_phy>;
+ resets = <&src IMX7_RESET_PCIEPHY>,
+ <&src IMX7_RESET_PCIE_CTRL_APPS_EN>,
+ <&src IMX7_RESET_PCIE_CTRL_APPS_TURNOFF>;
+ reset-names = "pciephy", "apps", "turnoff";
+ fsl,imx7d-pcie-phy = <&pcie_phy>;
+ num-ib-windows = <4>;
+ num-ob-windows = <4>;
+ status = "disabled";
+ };
};
};

--
2.34.1


2023-08-02 07:20:56

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 9/9] PCI: imx6: Add i.MX7D PCIe EP support

Add the i.MX7D PCIe EP mode support.

Signed-off-by: Richard Zhu <[email protected]>
---
drivers/pci/controller/dwc/pci-imx6.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index bcc83c9d0ec5..c1b9cc065963 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 {
IMX6QP,
IMX6QP_EP,
IMX7D,
+ IMX7D_EP,
IMX8MQ,
IMX8MM,
IMX8MP,
@@ -358,6 +359,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
0);
break;
case IMX7D:
+ case IMX7D_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, 0);
break;
@@ -589,6 +591,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
break;
case IMX7D:
+ case IMX7D_EP:
break;
case IMX8MM:
case IMX8MM_EP:
@@ -637,6 +640,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
IMX6Q_GPR1_PCIE_TEST_PD);
break;
case IMX7D:
+ case IMX7D_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL,
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL);
@@ -710,6 +714,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
{
switch (imx6_pcie->drvdata->variant) {
case IMX7D:
+ case IMX7D_EP:
case IMX8MQ:
case IMX8MQ_EP:
reset_control_assert(imx6_pcie->pciephy_reset);
@@ -762,6 +767,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
reset_control_deassert(imx6_pcie->pciephy_reset);
break;
case IMX7D:
+ case IMX7D_EP:
reset_control_deassert(imx6_pcie->pciephy_reset);

/* Workaround for ERR010728, failure of PCI-e PLL VCO to
@@ -853,6 +859,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
IMX6Q_GPR12_PCIE_CTL_2);
break;
case IMX7D:
+ case IMX7D_EP:
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MM:
@@ -879,6 +886,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
IMX6Q_GPR12_PCIE_CTL_2, 0);
break;
case IMX7D:
+ case IMX7D_EP:
case IMX8MQ:
case IMX8MQ_EP:
case IMX8MM:
@@ -1387,6 +1395,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
"pcie_aux clock source missing or invalid\n");
fallthrough;
case IMX7D:
+ case IMX7D_EP:
if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR)
imx6_pcie->controller_id = 1;

@@ -1571,6 +1580,11 @@ static const struct imx6_pcie_drvdata drvdata[] = {
.flags = IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
.gpr = "fsl,imx7d-iomuxc-gpr",
},
+ [IMX7D_EP] = {
+ .variant = IMX7D_EP,
+ .mode = DW_PCIE_EP_TYPE,
+ .gpr = "fsl,imx7d-iomuxc-gpr",
+ },
[IMX8MQ] = {
.variant = IMX8MQ,
.gpr = "fsl,imx8mq-iomuxc-gpr",
@@ -1610,6 +1624,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
{ .compatible = "fsl,imx6qp-pcie", .data = &drvdata[IMX6QP], },
{ .compatible = "fsl,imx6qp-pcie-ep", .data = &drvdata[IMX6QP_EP], },
{ .compatible = "fsl,imx7d-pcie", .data = &drvdata[IMX7D], },
+ { .compatible = "fsl,imx7d-pcie-ep", .data = &drvdata[IMX7D_EP], },
{ .compatible = "fsl,imx8mq-pcie", .data = &drvdata[IMX8MQ], },
{ .compatible = "fsl,imx8mm-pcie", .data = &drvdata[IMX8MM], },
{ .compatible = "fsl,imx8mp-pcie", .data = &drvdata[IMX8MP], },
--
2.34.1


2023-08-02 07:21:42

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 8/9] PCI: imx6: Add i.MX6SX PCIe EP support

Add the i.MX6SX PCIe EP support.

Signed-off-by: Richard Zhu <[email protected]>
---
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 4da9553b49b4..bcc83c9d0ec5 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -48,6 +48,7 @@ enum imx6_pcie_variants {
IMX6Q,
IMX6Q_EP,
IMX6SX,
+ IMX6SX_EP,
IMX6QP,
IMX6QP_EP,
IMX7D,
@@ -361,6 +362,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
IMX7D_GPR12_PCIE_PHY_REFCLK_SEL, 0);
break;
case IMX6SX:
+ case IMX6SX_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
IMX6SX_GPR12_PCIE_RX_EQ_MASK,
IMX6SX_GPR12_PCIE_RX_EQ_2);
@@ -559,6 +561,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)

switch (imx6_pcie->drvdata->variant) {
case IMX6SX:
+ case IMX6SX_EP:
ret = clk_prepare_enable(imx6_pcie->pcie_inbound_axi);
if (ret) {
dev_err(dev, "unable to enable pcie_axi clock\n");
@@ -620,6 +623,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
{
switch (imx6_pcie->drvdata->variant) {
case IMX6SX:
+ case IMX6SX_EP:
clk_disable_unprepare(imx6_pcie->pcie_inbound_axi);
break;
case IMX6QP:
@@ -717,6 +721,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
reset_control_assert(imx6_pcie->apps_reset);
break;
case IMX6SX:
+ case IMX6SX_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
IMX6SX_GPR12_PCIE_TEST_POWERDOWN,
IMX6SX_GPR12_PCIE_TEST_POWERDOWN);
@@ -781,6 +786,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
imx7d_pcie_wait_for_phy_pll_lock(imx6_pcie);
break;
case IMX6SX:
+ case IMX6SX_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR5,
IMX6SX_GPR5_PCIE_BTNRST_RESET, 0);
break;
@@ -839,6 +845,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
case IMX6Q:
case IMX6Q_EP:
case IMX6SX:
+ case IMX6SX_EP:
case IMX6QP:
case IMX6QP_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
@@ -865,6 +872,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
case IMX6Q:
case IMX6Q_EP:
case IMX6SX:
+ case IMX6SX_EP:
case IMX6QP:
case IMX6QP_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
@@ -1200,6 +1208,7 @@ static void imx6_pcie_pm_turnoff(struct imx6_pcie *imx6_pcie)
/* Others poke directly at IOMUXC registers */
switch (imx6_pcie->drvdata->variant) {
case IMX6SX:
+ case IMX6SX_EP:
case IMX6QP:
case IMX6QP_EP:
regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR12,
@@ -1363,6 +1372,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)

switch (imx6_pcie->drvdata->variant) {
case IMX6SX:
+ case IMX6SX_EP:
imx6_pcie->pcie_inbound_axi = devm_clk_get(dev,
"pcie_inbound_axi");
if (IS_ERR(imx6_pcie->pcie_inbound_axi))
@@ -1536,6 +1546,12 @@ static const struct imx6_pcie_drvdata drvdata[] = {
IMX6_PCIE_FLAG_SUPPORTS_SUSPEND,
.gpr = "fsl,imx6q-iomuxc-gpr",
},
+ [IMX6SX_EP] = {
+ .variant = IMX6SX_EP,
+ .mode = DW_PCIE_EP_TYPE,
+ .flags = IMX6_PCIE_FLAG_IMX6_PHY,
+ .gpr = "fsl,imx6q-iomuxc-gpr",
+ },
[IMX6QP] = {
.variant = IMX6QP,
.flags = IMX6_PCIE_FLAG_IMX6_PHY |
@@ -1590,6 +1606,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
{ .compatible = "fsl,imx6q-pcie", .data = &drvdata[IMX6Q], },
{ .compatible = "fsl,imx6q-pcie-ep", .data = &drvdata[IMX6Q_EP], },
{ .compatible = "fsl,imx6sx-pcie", .data = &drvdata[IMX6SX], },
+ { .compatible = "fsl,imx6sx-pcie-ep", .data = &drvdata[IMX6SX_EP], },
{ .compatible = "fsl,imx6qp-pcie", .data = &drvdata[IMX6QP], },
{ .compatible = "fsl,imx6qp-pcie-ep", .data = &drvdata[IMX6QP_EP], },
{ .compatible = "fsl,imx7d-pcie", .data = &drvdata[IMX7D], },
--
2.34.1


2023-08-02 07:21:47

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 2/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6SX PCIe EP compatibles

Add i.MX6SX PCIe EP compatibles.

Signed-off-by: Richard Zhu <[email protected]>
---
.../bindings/pci/fsl,imx6q-pcie-ep.yaml | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
index 9b881777c801..26448084340a 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
@@ -21,6 +21,7 @@ properties:
enum:
- fsl,imx6q-pcie-ep
- fsl,imx6qp-pcie-ep
+ - fsl,imx6sx-pcie-ep
- fsl,imx8mm-pcie-ep
- fsl,imx8mq-pcie-ep
- fsl,imx8mp-pcie-ep
@@ -62,6 +63,22 @@ required:
allOf:
- $ref: /schemas/pci/snps,dw-pcie-ep.yaml#
- $ref: /schemas/pci/fsl,imx6q-pcie-common.yaml#
+ - if:
+ properties:
+ compatible:
+ enum:
+ - fsl,imx6sx-pcie-ep
+ then:
+ properties:
+ clocks:
+ minItems: 4
+ clock-names:
+ items:
+ - const: pcie
+ - const: pcie_bus
+ - const: pcie_phy
+ - const: pcie_inbound_axi
+
- if:
properties:
compatible:
--
2.34.1


2023-08-02 07:22:17

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 4/9] arm: dts: nxp: Add i.MX6QDL and i.MX6QP PCIe EP supports

Add i.MX6QDL and i.MX6QP PCIe EP supports.

Signed-off-by: Richard Zhu <[email protected]>
---
arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi | 14 ++++++++++++++
arch/arm/boot/dts/nxp/imx/imx6qp.dtsi | 4 ++++
2 files changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi
index bda182edc589..be02f7882c68 100644
--- a/arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi
@@ -289,6 +289,20 @@ pcie: pcie@1ffc000 {
status = "disabled";
};

+ pcie_ep: pcie-ep@1ffc000 {
+ compatible = "fsl,imx6q-pcie-ep";
+ reg = <0x01ffc000 0x04000>, <0x01000000 0xf00000>;
+ reg-names = "dbi", "addr_space";
+ num-lanes = <1>;
+ clocks = <&clks IMX6QDL_CLK_PCIE_AXI>,
+ <&clks IMX6QDL_CLK_LVDS1_GATE>,
+ <&clks IMX6QDL_CLK_PCIE_REF_125M>;
+ clock-names = "pcie", "pcie_bus", "pcie_phy";
+ num-ib-windows = <4>;
+ num-ob-windows = <4>;
+ status = "disabled";
+ };
+
aips1: bus@2000000 { /* AIPS1 */
compatible = "fsl,aips-bus", "simple-bus";
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/nxp/imx/imx6qp.dtsi b/arch/arm/boot/dts/nxp/imx/imx6qp.dtsi
index fc164991d2ae..4ca53a4c254c 100644
--- a/arch/arm/boot/dts/nxp/imx/imx6qp.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx6qp.dtsi
@@ -118,3 +118,7 @@ &mmdc0 {
&pcie {
compatible = "fsl,imx6qp-pcie";
};
+
+&pcie_ep {
+ compatible = "fsl,imx6qp-pcie-ep";
+};
--
2.34.1


2023-08-02 07:23:44

by Ahmad Fatoum

[permalink] [raw]
Subject: Re: [PATCH 0/9] Add legacy i.MX PCIe EP mode supports

Hello Richard,

On 02.08.23 08:06, Richard Zhu wrote:
> Add legacy 32bit i.MX PCIe EP mode support
>
> The PCI controller contained in i.MX6/7 legacy SOCs is one dual mode
> PCIe controller, and can work either as RC or EP.
>
> This series add i.MX6/7 PCIe EP mode supports. And had been verified
> on i.MX6 sabresd and i.MX7 SDB boards.
>
> In the verification, one board PCIe is used as RC, the other one is used
> as EP.
> Use the cross TX/RX differential cable connect the two PCIe ports of
> these two boards.
>
> +-----------+ +------------+
> | PCIe TX |<-------------->|PCIe RX |
> | | | |
> | Board | | Board |
> | | | |
> | PCIe RX |<-------------->|PCIe TX |
> +-----------+ +------------+

I am curious what software you are running on both sides to test?
Do you use CONFIG_PCI_EPF_TEST? What do you run on RC side?

Thanks,
Ahmad

>
> [PATCH 1/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6Q and i.MX6QP PCIe
> [PATCH 2/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6SX PCIe EP
> [PATCH 3/9] dt-bindings: PCI: fsl,imx6q: Add i.MX7D PCIe EP
> [PATCH 4/9] arm: dts: nxp: Add i.MX6QDL and i.MX6QP PCIe EP supports
> [PATCH 5/9] arm: dts: nxp: Add i.MX6SX PCIe EP support
> [PATCH 6/9] arm: dts: nxp: Add i.MX7D PCIe EP support
> [PATCH 7/9] PCI: imx6: Add i.MX6Q and i.MX6QP PCIe EP supports
> [PATCH 8/9] PCI: imx6: Add i.MX6SX PCIe EP support
> [PATCH 9/9] PCI: imx6: Add i.MX7D PCIe EP support
>
> Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 50 +++++++++++++++++++++++++++++++++++++++++----
> arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi | 14 +++++++++++++
> arch/arm/boot/dts/nxp/imx/imx6qp.dtsi | 4 ++++
> arch/arm/boot/dts/nxp/imx/imx6sx.dtsi | 17 +++++++++++++++
> arch/arm/boot/dts/nxp/imx/imx7d.dtsi | 27 ++++++++++++++++++++++++
> drivers/pci/controller/dwc/pci-imx6.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 6 files changed, 200 insertions(+), 5 deletions(-)
>
>
>

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


2023-08-02 07:31:07

by Richard Zhu

[permalink] [raw]
Subject: [PATCH 1/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6Q and i.MX6QP PCIe EP compatibles

Add i.MX6Q and i.MX6QP PCIe EP compatibles.
- Make the interrupts property optional, since i.MX6Q/i.MX6QP PCIe
don't have DMA capability.
- To pass the schema check, specify the clocks property refer to the
different platforms.

Signed-off-by: Richard Zhu <[email protected]>
---
.../bindings/pci/fsl,imx6q-pcie-ep.yaml | 31 ++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
index ee155ed5f181..9b881777c801 100644
--- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml
@@ -19,6 +19,8 @@ description: |+
properties:
compatible:
enum:
+ - fsl,imx6q-pcie-ep
+ - fsl,imx6qp-pcie-ep
- fsl,imx8mm-pcie-ep
- fsl,imx8mq-pcie-ep
- fsl,imx8mp-pcie-ep
@@ -46,7 +48,7 @@ properties:

interrupts:
items:
- - description: builtin eDMA interrupter.
+ - description: builtin eDMA interrupter (optional).

interrupt-names:
items:
@@ -56,8 +58,6 @@ required:
- compatible
- reg
- reg-names
- - interrupts
- - interrupt-names

allOf:
- $ref: /schemas/pci/snps,dw-pcie-ep.yaml#
@@ -77,7 +77,30 @@ allOf:
- const: pcie_bus
- const: pcie_phy
- const: pcie_aux
- else:
+
+ - if:
+ properties:
+ compatible:
+ enum:
+ - fsl,imx6q-pcie-ep
+ - fsl,imx6qp-pcie-ep
+ then:
+ properties:
+ clocks:
+ maxItems: 3
+ clock-names:
+ items:
+ - const: pcie
+ - const: pcie_bus
+ - const: pcie_phy
+
+ - if:
+ properties:
+ compatible:
+ enum:
+ - fsl,imx8mm-pcie-ep
+ - fsl,imx8mp-pcie-ep
+ then:
properties:
clocks:
maxItems: 3
--
2.34.1


2023-08-02 15:42:34

by Richard Zhu

[permalink] [raw]
Subject: RE: [PATCH 0/9] Add legacy i.MX PCIe EP mode supports

Hi Ahmad:

Thanks for your concerns.
> -----Original Message-----
> From: Ahmad Fatoum <[email protected]>
> Sent: 2023??8??2?? 14:52
> To: Hongxing Zhu <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]
> Cc: [email protected]; [email protected];
> [email protected]; dl-linux-imx <[email protected]>;
> [email protected]; [email protected]
> Subject: Re: [PATCH 0/9] Add legacy i.MX PCIe EP mode supports
>
> Hello Richard,
>
> On 02.08.23 08:06, Richard Zhu wrote:
> > Add legacy 32bit i.MX PCIe EP mode support
> >
> > The PCI controller contained in i.MX6/7 legacy SOCs is one dual mode
> > PCIe controller, and can work either as RC or EP.
> >
> > This series add i.MX6/7 PCIe EP mode supports. And had been verified
> > on i.MX6 sabresd and i.MX7 SDB boards.
> >
> > In the verification, one board PCIe is used as RC, the other one is
> > used as EP.
> > Use the cross TX/RX differential cable connect the two PCIe ports of
> > these two boards.
> >
> > +-----------+ +------------+
> > | PCIe TX |<-------------->|PCIe RX |
> > | | | |
> > | Board | | Board |
> > | | | |
> > | PCIe RX |<-------------->|PCIe TX |
> > +-----------+ +------------+
>
> I am curious what software you are running on both sides to test?
> Do you use CONFIG_PCI_EPF_TEST? What do you run on RC side?
Yes, it is.
Beside PCI_EPF_TEST, the CONFIG_PCI_ENDPOINT_TEST is used too.
And the pcitest program is used on RC side to verify the MSI and data IO tests features.

Best Regards
Richard Zhu
>
> Thanks,
> Ahmad
>
> >
> > [PATCH 1/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6Q and i.MX6QP PCIe
> > [PATCH 2/9] dt-bindings: PCI: fsl,imx6q: Add i.MX6SX PCIe EP [PATCH
> > 3/9] dt-bindings: PCI: fsl,imx6q: Add i.MX7D PCIe EP [PATCH 4/9] arm:
> > dts: nxp: Add i.MX6QDL and i.MX6QP PCIe EP supports [PATCH 5/9] arm:
> > dts: nxp: Add i.MX6SX PCIe EP support [PATCH 6/9] arm: dts: nxp: Add
> > i.MX7D PCIe EP support [PATCH 7/9] PCI: imx6: Add i.MX6Q and i.MX6QP
> > PCIe EP supports [PATCH 8/9] PCI: imx6: Add i.MX6SX PCIe EP support
> > [PATCH 9/9] PCI: imx6: Add i.MX7D PCIe EP support
> >
> > Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml | 50
> +++++++++++++++++++++++++++++++++++++++++----
> > arch/arm/boot/dts/nxp/imx/imx6qdl.dtsi | 14
> +++++++++++++
> > arch/arm/boot/dts/nxp/imx/imx6qp.dtsi | 4
> ++++
> > arch/arm/boot/dts/nxp/imx/imx6sx.dtsi | 17
> +++++++++++++++
> > arch/arm/boot/dts/nxp/imx/imx7d.dtsi | 27
> ++++++++++++++++++++++++
> > drivers/pci/controller/dwc/pci-imx6.c | 93
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++-
> > 6 files changed, 200 insertions(+), 5 deletions(-)
> >
> >
> >
>
> --
> Pengutronix e.K. |
> |
> Steuerwalder Str. 21 |
> http://www.pen/
> gutronix.de%2F&data=05%7C01%7Chongxing.zhu%40nxp.com%7Ccc783fc2b1
> 0340518e0108db9324ec3f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7
> C0%7C638265559019809339%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w
> LjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%
> 7C%7C&sdata=tC3JGc%2Bo5z5211vCtpbcnO5%2FYC2ghM1te%2FwGOgC9ue8
> %3D&reserved=0 |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0
> |
> Amtsgericht Hildesheim, HRA 2686 | Fax:
> +49-5121-206917-5555 |