All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] PCI: imx6: MSI support
@ 2014-02-25 17:47 ` Lucas Stach
  0 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: Richard Zhu; +Cc: Shawn Guo, Bjorn Helgaas, linux-pci, linux-arm-kernel, kernel

Those two simple patches add support for MSI to the
i.MX6 PCIe host controller driver.

The first patch should probably go through Shawns tree, while
the second one should go through the PCI tree. I'm only posting
them together to get you the whole picture.

Juergen Beisert (2):
  ARM: dts: imx6: adjust the interrupt list in order to support MSI
  PCI: imx6: add support for MSI

 arch/arm/boot/dts/imx6qdl.dtsi |  3 ++-
 drivers/pci/host/pci-imx6.c    | 29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

-- 
1.8.5.3


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

* [PATCH 0/2] PCI: imx6: MSI support
@ 2014-02-25 17:47 ` Lucas Stach
  0 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

Those two simple patches add support for MSI to the
i.MX6 PCIe host controller driver.

The first patch should probably go through Shawns tree, while
the second one should go through the PCI tree. I'm only posting
them together to get you the whole picture.

Juergen Beisert (2):
  ARM: dts: imx6: adjust the interrupt list in order to support MSI
  PCI: imx6: add support for MSI

 arch/arm/boot/dts/imx6qdl.dtsi |  3 ++-
 drivers/pci/host/pci-imx6.c    | 29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

-- 
1.8.5.3

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

* [PATCH 1/2] ARM: dts: imx6: adjust the interrupt list in order to support MSI
  2014-02-25 17:47 ` Lucas Stach
@ 2014-02-25 17:47   ` Lucas Stach
  -1 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: Richard Zhu; +Cc: Shawn Guo, Bjorn Helgaas, linux-pci, linux-arm-kernel, kernel

From: Juergen Beisert <jbe@pengutronix.de>

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boot/dts/imx6qdl.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index fb28b2ecb1db..aeccbb114fc5 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -126,7 +126,8 @@
 				  0x81000000 0 0          0x01f80000 0 0x00010000 /* downstream I/O */
 				  0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */
 			num-lanes = <1>;
-			interrupts = <0 123 0x04>;
+			/*               inta          intb         intc         intd/msi */
+			interrupts = <0 123 0x04>, <0 122 0x04>, <0 121 0x04>, <0 120 0x04>;
 			clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>;
 			clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi";
 			status = "disabled";
-- 
1.8.5.3


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

* [PATCH 1/2] ARM: dts: imx6: adjust the interrupt list in order to support MSI
@ 2014-02-25 17:47   ` Lucas Stach
  0 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Juergen Beisert <jbe@pengutronix.de>

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boot/dts/imx6qdl.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index fb28b2ecb1db..aeccbb114fc5 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -126,7 +126,8 @@
 				  0x81000000 0 0          0x01f80000 0 0x00010000 /* downstream I/O */
 				  0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */
 			num-lanes = <1>;
-			interrupts = <0 123 0x04>;
+			/*               inta          intb         intc         intd/msi */
+			interrupts = <0 123 0x04>, <0 122 0x04>, <0 121 0x04>, <0 120 0x04>;
 			clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>;
 			clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi";
 			status = "disabled";
-- 
1.8.5.3

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

* [PATCH 2/2] PCI: imx6: add support for MSI
  2014-02-25 17:47 ` Lucas Stach
@ 2014-02-25 17:47   ` Lucas Stach
  -1 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: Richard Zhu; +Cc: Shawn Guo, Bjorn Helgaas, linux-pci, linux-arm-kernel, kernel

From: Juergen Beisert <jbe@pengutronix.de>

This patch adds support for Message Signaled Interrupt in the
imx6q-pcie driver. It is done in a similar way as for the Exynos
PCIe driver (commit f342d940ee0e3a2b5197fd4fbade1cb6bbc960b7),
which is also using the Synopsys designware PCIe IP core.

Signed-off-by: Harro Haan <hrhaan@gmail.com>
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/pci/host/pci-imx6.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index ee082509b0ba..8076a79d975f 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -25,6 +25,7 @@
 #include <linux/resource.h>
 #include <linux/signal.h>
 #include <linux/types.h>
+#include <linux/interrupt.h>
 
 #include "pcie-designware.h"
 
@@ -329,6 +330,17 @@ static int imx6_pcie_wait_for_link(struct pcie_port *pp)
 	return 0;
 }
 
+/* legacy IRQD/MSI interrupt */
+static irqreturn_t imx6_pcie_irqd_msi_handler(int irq, void *arg)
+{
+	struct pcie_port *pp = arg;
+
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		dw_handle_msi_irq(pp);
+
+	return IRQ_HANDLED;
+}
+
 static int imx6_pcie_start_link(struct pcie_port *pp)
 {
 	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
@@ -403,6 +415,9 @@ static void imx6_pcie_host_init(struct pcie_port *pp)
 	dw_pcie_setup_rc(pp);
 
 	imx6_pcie_start_link(pp);
+
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		dw_pcie_msi_init(pp);
 }
 
 static void imx6_pcie_reset_phy(struct pcie_port *pp)
@@ -498,6 +513,20 @@ static int imx6_add_pcie_port(struct pcie_port *pp,
 		return -ENODEV;
 	}
 
+	if (IS_ENABLED(CONFIG_PCI_MSI)) {
+		pp->msi_irq = platform_get_irq(pdev, 3);
+		if (!pp->msi_irq) {
+			dev_err(&pdev->dev, "failed to get INTD/MSI\n");
+			return -ENODEV;
+		}
+
+		ret = devm_request_irq(&pdev->dev, pp->msi_irq,
+					imx6_pcie_irqd_msi_handler,
+					IRQF_SHARED, "mx6-pcie-msi", pp);
+		if (ret)
+			dev_err(&pdev->dev, "failed to request INTD/MCI irq\n");
+	}
+
 	pp->root_bus_nr = -1;
 	pp->ops = &imx6_pcie_host_ops;
 
-- 
1.8.5.3


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

* [PATCH 2/2] PCI: imx6: add support for MSI
@ 2014-02-25 17:47   ` Lucas Stach
  0 siblings, 0 replies; 8+ messages in thread
From: Lucas Stach @ 2014-02-25 17:47 UTC (permalink / raw)
  To: linux-arm-kernel

From: Juergen Beisert <jbe@pengutronix.de>

This patch adds support for Message Signaled Interrupt in the
imx6q-pcie driver. It is done in a similar way as for the Exynos
PCIe driver (commit f342d940ee0e3a2b5197fd4fbade1cb6bbc960b7),
which is also using the Synopsys designware PCIe IP core.

Signed-off-by: Harro Haan <hrhaan@gmail.com>
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/pci/host/pci-imx6.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index ee082509b0ba..8076a79d975f 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -25,6 +25,7 @@
 #include <linux/resource.h>
 #include <linux/signal.h>
 #include <linux/types.h>
+#include <linux/interrupt.h>
 
 #include "pcie-designware.h"
 
@@ -329,6 +330,17 @@ static int imx6_pcie_wait_for_link(struct pcie_port *pp)
 	return 0;
 }
 
+/* legacy IRQD/MSI interrupt */
+static irqreturn_t imx6_pcie_irqd_msi_handler(int irq, void *arg)
+{
+	struct pcie_port *pp = arg;
+
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		dw_handle_msi_irq(pp);
+
+	return IRQ_HANDLED;
+}
+
 static int imx6_pcie_start_link(struct pcie_port *pp)
 {
 	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp);
@@ -403,6 +415,9 @@ static void imx6_pcie_host_init(struct pcie_port *pp)
 	dw_pcie_setup_rc(pp);
 
 	imx6_pcie_start_link(pp);
+
+	if (IS_ENABLED(CONFIG_PCI_MSI))
+		dw_pcie_msi_init(pp);
 }
 
 static void imx6_pcie_reset_phy(struct pcie_port *pp)
@@ -498,6 +513,20 @@ static int imx6_add_pcie_port(struct pcie_port *pp,
 		return -ENODEV;
 	}
 
+	if (IS_ENABLED(CONFIG_PCI_MSI)) {
+		pp->msi_irq = platform_get_irq(pdev, 3);
+		if (!pp->msi_irq) {
+			dev_err(&pdev->dev, "failed to get INTD/MSI\n");
+			return -ENODEV;
+		}
+
+		ret = devm_request_irq(&pdev->dev, pp->msi_irq,
+					imx6_pcie_irqd_msi_handler,
+					IRQF_SHARED, "mx6-pcie-msi", pp);
+		if (ret)
+			dev_err(&pdev->dev, "failed to request INTD/MCI irq\n");
+	}
+
 	pp->root_bus_nr = -1;
 	pp->ops = &imx6_pcie_host_ops;
 
-- 
1.8.5.3

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

* RE: [PATCH 2/2] PCI: imx6: add support for MSI
  2014-02-25 17:47   ` Lucas Stach
@ 2014-02-26  1:40     ` Hong-Xing.Zhu at freescale.com
  -1 siblings, 0 replies; 8+ messages in thread
From: Hong-Xing.Zhu @ 2014-02-26  1:40 UTC (permalink / raw)
  To: Lucas Stach; +Cc: Shawn Guo, Bjorn Helgaas, linux-pci, linux-arm-kernel, kernel

Hi Lucas:

Thanks for your patch-set.
Only one minor comments, others are okay for me.

> -----Original Message-----
> From: linux-pci-owner@vger.kernel.org [mailto:linux-pci-owner@vger.kernel.org]
> On Behalf Of Lucas Stach
> Sent: Wednesday, February 26, 2014 1:47 AM
> To: Zhu Richard-R65037
> Cc: Shawn Guo; Bjorn Helgaas; linux-pci@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; kernel@pengutronix.de
> Subject: [PATCH 2/2] PCI: imx6: add support for MSI
> 
> From: Juergen Beisert <jbe@pengutronix.de>
> 
> This patch adds support for Message Signaled Interrupt in the imx6q-pcie
> driver. It is done in a similar way as for the Exynos PCIe driver (commit
> f342d940ee0e3a2b5197fd4fbade1cb6bbc960b7),
> which is also using the Synopsys designware PCIe IP core.
> 
> Signed-off-by: Harro Haan <hrhaan@gmail.com>
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/pci/host/pci-imx6.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index
> ee082509b0ba..8076a79d975f 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -25,6 +25,7 @@
>  #include <linux/resource.h>
>  #include <linux/signal.h>
>  #include <linux/types.h>
> +#include <linux/interrupt.h>
> 
>  #include "pcie-designware.h"
> 
> @@ -329,6 +330,17 @@ static int imx6_pcie_wait_for_link(struct pcie_port *pp)
>  	return 0;
>  }
> 
> +/* legacy IRQD/MSI interrupt */
> +static irqreturn_t imx6_pcie_irqd_msi_handler(int irq, void *arg) {
> +	struct pcie_port *pp = arg;
> +
> +	if (IS_ENABLED(CONFIG_PCI_MSI))
> +		dw_handle_msi_irq(pp);
> +
> +	return IRQ_HANDLED;
> +}
> +
>  static int imx6_pcie_start_link(struct pcie_port *pp)  {
>  	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); @@ -403,6 +415,9 @@
> static void imx6_pcie_host_init(struct pcie_port *pp)
>  	dw_pcie_setup_rc(pp);
> 
>  	imx6_pcie_start_link(pp);
> +
> +	if (IS_ENABLED(CONFIG_PCI_MSI))
> +		dw_pcie_msi_init(pp);
>  }
> 
>  static void imx6_pcie_reset_phy(struct pcie_port *pp) @@ -498,6 +513,20 @@
> static int imx6_add_pcie_port(struct pcie_port *pp,
>  		return -ENODEV;
>  	}
> 
> +	if (IS_ENABLED(CONFIG_PCI_MSI)) {
> +		pp->msi_irq = platform_get_irq(pdev, 3);
> +		if (!pp->msi_irq) {
> +			dev_err(&pdev->dev, "failed to get INTD/MSI\n");
> +			return -ENODEV;
> +		}
> +
> +		ret = devm_request_irq(&pdev->dev, pp->msi_irq,
> +					imx6_pcie_irqd_msi_handler,
> +					IRQF_SHARED, "mx6-pcie-msi", pp);
> +		if (ret)
> +			dev_err(&pdev->dev, "failed to request INTD/MCI irq\n");

[Richard] Is this INTD/MSI?

> +	}
> +
>  	pp->root_bus_nr = -1;
>  	pp->ops = &imx6_pcie_host_ops;
> 
> --
> 1.8.5.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> 


Best Regards
Richard Zhu

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

* [PATCH 2/2] PCI: imx6: add support for MSI
@ 2014-02-26  1:40     ` Hong-Xing.Zhu at freescale.com
  0 siblings, 0 replies; 8+ messages in thread
From: Hong-Xing.Zhu at freescale.com @ 2014-02-26  1:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lucas:

Thanks for your patch-set.
Only one minor comments, others are okay for me.

> -----Original Message-----
> From: linux-pci-owner at vger.kernel.org [mailto:linux-pci-owner at vger.kernel.org]
> On Behalf Of Lucas Stach
> Sent: Wednesday, February 26, 2014 1:47 AM
> To: Zhu Richard-R65037
> Cc: Shawn Guo; Bjorn Helgaas; linux-pci at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; kernel at pengutronix.de
> Subject: [PATCH 2/2] PCI: imx6: add support for MSI
> 
> From: Juergen Beisert <jbe@pengutronix.de>
> 
> This patch adds support for Message Signaled Interrupt in the imx6q-pcie
> driver. It is done in a similar way as for the Exynos PCIe driver (commit
> f342d940ee0e3a2b5197fd4fbade1cb6bbc960b7),
> which is also using the Synopsys designware PCIe IP core.
> 
> Signed-off-by: Harro Haan <hrhaan@gmail.com>
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/pci/host/pci-imx6.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index
> ee082509b0ba..8076a79d975f 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -25,6 +25,7 @@
>  #include <linux/resource.h>
>  #include <linux/signal.h>
>  #include <linux/types.h>
> +#include <linux/interrupt.h>
> 
>  #include "pcie-designware.h"
> 
> @@ -329,6 +330,17 @@ static int imx6_pcie_wait_for_link(struct pcie_port *pp)
>  	return 0;
>  }
> 
> +/* legacy IRQD/MSI interrupt */
> +static irqreturn_t imx6_pcie_irqd_msi_handler(int irq, void *arg) {
> +	struct pcie_port *pp = arg;
> +
> +	if (IS_ENABLED(CONFIG_PCI_MSI))
> +		dw_handle_msi_irq(pp);
> +
> +	return IRQ_HANDLED;
> +}
> +
>  static int imx6_pcie_start_link(struct pcie_port *pp)  {
>  	struct imx6_pcie *imx6_pcie = to_imx6_pcie(pp); @@ -403,6 +415,9 @@
> static void imx6_pcie_host_init(struct pcie_port *pp)
>  	dw_pcie_setup_rc(pp);
> 
>  	imx6_pcie_start_link(pp);
> +
> +	if (IS_ENABLED(CONFIG_PCI_MSI))
> +		dw_pcie_msi_init(pp);
>  }
> 
>  static void imx6_pcie_reset_phy(struct pcie_port *pp) @@ -498,6 +513,20 @@
> static int imx6_add_pcie_port(struct pcie_port *pp,
>  		return -ENODEV;
>  	}
> 
> +	if (IS_ENABLED(CONFIG_PCI_MSI)) {
> +		pp->msi_irq = platform_get_irq(pdev, 3);
> +		if (!pp->msi_irq) {
> +			dev_err(&pdev->dev, "failed to get INTD/MSI\n");
> +			return -ENODEV;
> +		}
> +
> +		ret = devm_request_irq(&pdev->dev, pp->msi_irq,
> +					imx6_pcie_irqd_msi_handler,
> +					IRQF_SHARED, "mx6-pcie-msi", pp);
> +		if (ret)
> +			dev_err(&pdev->dev, "failed to request INTD/MCI irq\n");

[Richard] Is this INTD/MSI?

> +	}
> +
>  	pp->root_bus_nr = -1;
>  	pp->ops = &imx6_pcie_host_ops;
> 
> --
> 1.8.5.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in the
> body of a message to majordomo at vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> 


Best Regards
Richard Zhu

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

end of thread, other threads:[~2014-02-26  1:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-25 17:47 [PATCH 0/2] PCI: imx6: MSI support Lucas Stach
2014-02-25 17:47 ` Lucas Stach
2014-02-25 17:47 ` [PATCH 1/2] ARM: dts: imx6: adjust the interrupt list in order to support MSI Lucas Stach
2014-02-25 17:47   ` Lucas Stach
2014-02-25 17:47 ` [PATCH 2/2] PCI: imx6: add support for MSI Lucas Stach
2014-02-25 17:47   ` Lucas Stach
2014-02-26  1:40   ` Hong-Xing.Zhu
2014-02-26  1:40     ` Hong-Xing.Zhu at freescale.com

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.