summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorRichard Zhu <hongxing.zhu@nxp.com>2017-11-27 13:06:15 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commitff8fb71c96f25bcbb7f35ec04849beae1ee4f911 (patch)
treea84b010a7be6b385a83fadf3f0916b78232f72a9 /drivers/pci
parentbfe648d1b1ef287d59de2556203620e6455f35da (diff)
MLK-16982 PCI: imx: fix the failure of the msi verification
Failed to verify the MSI in the EP RC system. Root cause: the MSI address is not fetched corretly. The second port of iMX8MQ EVK board should be used as EP port, not the first one. Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com> Reviewed-by: Frank Li <frank.li@nxp.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pci-imx6-ep-driver.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-imx6-ep-driver.c b/drivers/pci/host/pci-imx6-ep-driver.c
index dd300a99ab21..4ea0782a4c60 100644
--- a/drivers/pci/host/pci-imx6-ep-driver.c
+++ b/drivers/pci/host/pci-imx6-ep-driver.c
@@ -51,10 +51,10 @@ static int imx_pcie_ep_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
int ret = 0, index = 0, found = 0;
- unsigned int msi_addr = 0, cpu_base;
+ unsigned int hard_wired = 0, msi_addr = 0, cpu_base;
struct resource cfg_res;
const char *name = NULL;
- struct device_node *np;
+ struct device_node *np = NULL;
struct device *dev = &pdev->dev;
struct imx_pcie_ep_priv *priv;
@@ -90,7 +90,13 @@ static int imx_pcie_ep_probe(struct pci_dev *pdev,
goto err_pci_unmap_mmio;
}
- np = of_find_compatible_node(NULL, NULL, "snps,dw-pcie");
+ /* Use the first none-hard-wired port as ep */
+ while ((np = of_find_node_by_type(np, "pci"))) {
+ if (of_property_read_u32(np, "hard-wired", &hard_wired)) {
+ hard_wired = 0;
+ break;
+ }
+ }
if (of_property_read_u32(np, "cpu-base-addr", &cpu_base))
cpu_base = 0;