This series adds some features for UniPhier PCIe host controller.
- Add support for PME and AER invoked by MSI interrupt
- Add iATU register view support for PCIe version >= 4.80
- Add an error message when failing to get phy driver
This adds a new function called by MSI handler in DesignWare PCIe framework,
that invokes PME and AER funcions to detect the factor from SoC-dependent
registers.
Changes since v1:
- Add check if struct resource is NULL
- Fix warning in the type of dev_err() argument
Kunihiko Hayashi (5):
PCI: dwc: Add msi_host_isr() callback
PCI: uniphier: Add misc interrupt handler to invoke PME and AER
dt-bindings: PCI: uniphier: Add iATU register description
PCI: uniphier: Add iATU register support
PCI: uniphier: Add error message when failed to get phy
.../devicetree/bindings/pci/uniphier-pcie.txt | 1 +
drivers/pci/controller/dwc/pcie-designware-host.c | 8 +--
drivers/pci/controller/dwc/pcie-designware.h | 1 +
drivers/pci/controller/dwc/pcie-uniphier.c | 67 +++++++++++++++++-----
4 files changed, 60 insertions(+), 17 deletions(-)
--
2.7.4
This adds msi_host_isr() callback function support to describe
SoC-dependent service triggered by MSI.
For example, when AER interrupt is triggered by MSI, the callback function
reads SoC-dependent registers and detects that the interrupt is from AER,
and invoke AER interrupts related to MSI.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 8 ++++----
drivers/pci/controller/dwc/pcie-designware.h | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
In the dt-bindings, "atu" reg-names is required to get the register space
for iATU in Synopsis DWC version 4.80 or later.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
Documentation/devicetree/bindings/pci/uniphier-pcie.txt | 1 +
1 file changed, 1 insertion(+)
@@ -16,6 +16,7 @@ Required properties: "dbi" - controller configuration registers "link" - SoC-specific glue layer registers "config" - PCIe configuration space+ "atu" - iATU registers for DWC version 4.80 or later - clocks: A phandle to the clock gate for PCIe glue layer including the host controller. - resets: A phandle to the reset line for PCIe glue layer including
Even if phy driver doesn't probe, the error message can't be distinguished
from other errors. This displays error message caused by the phy driver
explicitly.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
@@ -468,8 +468,11 @@ static int uniphier_pcie_probe(struct platform_device *pdev)returnPTR_ERR(priv->rst);priv->phy=devm_phy_optional_get(dev,"pcie-phy");-if(IS_ERR(priv->phy))-returnPTR_ERR(priv->phy);+if(IS_ERR(priv->phy)){+ret=PTR_ERR(priv->phy);+dev_err(dev,"Failed to get phy (%d)\n",ret);+returnret;+}platform_set_drvdata(pdev,priv);
The misc interrupts consisting of PME, AER, and Link event, is handled
by INTx handler, however, these interrupts should be also handled by
MSI handler.
This adds the function uniphier_pcie_misc_isr() that handles misc
intterupts, which is called from both INTx and MSI handlers.
This function detects PME and AER interrupts with the status register,
and invoke PME and AER drivers related to INTx or MSI.
And this sets the mask for misc interrupts from INTx if MSI is enabled
and sets the mask for misc interrupts from MSI if MSI is disabled.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 53 +++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 11 deletions(-)
This gets iATU register area from reg property. In Synopsis DWC version
4.80 or later, since iATU register area is separated from core register
area, this area is necessary to get from DT independently.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++++
1 file changed, 7 insertions(+)
Hi Kunihiko,
On Fri, May 15, 2020 at 10:59:2, Kunihiko Hayashi
[off-list ref] wrote:
This gets iATU register area from reg property. In Synopsis DWC version
s/Synopsis/Synopsys
in all patches
quoted hunk
4.80 or later, since iATU register area is separated from core register
area, this area is necessary to get from DT independently.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++++
1 file changed, 7 insertions(+)
[+cc Marc; IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) maintainer]
On Fri, May 15, 2020 at 10:58:59, Kunihiko Hayashi
[off-list ref] wrote:
quoted hunk
This adds msi_host_isr() callback function support to describe
SoC-dependent service triggered by MSI.
For example, when AER interrupt is triggered by MSI, the callback function
reads SoC-dependent registers and detects that the interrupt is from AER,
and invoke AER interrupts related to MSI.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 8 ++++----
drivers/pci/controller/dwc/pcie-designware.h | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
[+cc Marc; IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) maintainer]
On Fri, May 15, 2020 at 10:59:0, Kunihiko Hayashi
[off-list ref] wrote:
quoted hunk
The misc interrupts consisting of PME, AER, and Link event, is handled
by INTx handler, however, these interrupts should be also handled by
MSI handler.
This adds the function uniphier_pcie_misc_isr() that handles misc
intterupts, which is called from both INTx and MSI handlers.
This function detects PME and AER interrupts with the status register,
and invoke PME and AER drivers related to INTx or MSI.
And this sets the mask for misc interrupts from INTx if MSI is enabled
and sets the mask for misc interrupts from MSI if MSI is disabled.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 53 +++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 11 deletions(-)
From: Rob Herring <robh@kernel.org> Date: 2020-05-28 19:25:58
On Fri, 15 May 2020 18:59:01 +0900, Kunihiko Hayashi wrote:
In the dt-bindings, "atu" reg-names is required to get the register space
for iATU in Synopsis DWC version 4.80 or later.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
Documentation/devicetree/bindings/pci/uniphier-pcie.txt | 1 +
1 file changed, 1 insertion(+)
From: Rob Herring <robh@kernel.org> Date: 2020-06-01 21:32:21
On Fri, May 15, 2020 at 06:59:02PM +0900, Kunihiko Hayashi wrote:
quoted hunk
This gets iATU register area from reg property. In Synopsis DWC version
4.80 or later, since iATU register area is separated from core register
area, this area is necessary to get from DT independently.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++++
1 file changed, 7 insertions(+)
From: Rob Herring <robh@kernel.org> Date: 2020-06-01 21:43:10
On Fri, May 15, 2020 at 06:59:03PM +0900, Kunihiko Hayashi wrote:
quoted hunk
Even if phy driver doesn't probe, the error message can't be distinguished
from other errors. This displays error message caused by the phy driver
explicitly.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
@@ -468,8 +468,11 @@ static int uniphier_pcie_probe(struct platform_device *pdev)returnPTR_ERR(priv->rst);priv->phy=devm_phy_optional_get(dev,"pcie-phy");-if(IS_ERR(priv->phy))-returnPTR_ERR(priv->phy);+if(IS_ERR(priv->phy)){+ret=PTR_ERR(priv->phy);+dev_err(dev,"Failed to get phy (%d)\n",ret);
This will print an error on EPROBE_DEFERRED which isn't an error.
On Fri, May 15, 2020 at 06:59:02PM +0900, Kunihiko Hayashi wrote:
quoted
This gets iATU register area from reg property. In Synopsis DWC version
4.80 or later, since iATU register area is separated from core register
area, this area is necessary to get from DT independently.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++++
1 file changed, 7 insertions(+)
On Fri, May 15, 2020 at 06:59:03PM +0900, Kunihiko Hayashi wrote:
quoted
Even if phy driver doesn't probe, the error message can't be distinguished
from other errors. This displays error message caused by the phy driver
explicitly.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
drivers/pci/controller/dwc/pcie-uniphier.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
@@ -468,8 +468,11 @@ static int uniphier_pcie_probe(struct platform_device *pdev)returnPTR_ERR(priv->rst);priv->phy=devm_phy_optional_get(dev,"pcie-phy");-if(IS_ERR(priv->phy))-returnPTR_ERR(priv->phy);+if(IS_ERR(priv->phy)){+ret=PTR_ERR(priv->phy);+dev_err(dev,"Failed to get phy (%d)\n",ret);
This will print an error on EPROBE_DEFERRED which isn't an error.
Thanks for pointing out.
Surely this message should be suppressed when returning EPROBE_DEFERRED.
Thank you,
---
Best Regards
Kunihiko Hayashi