diff options
Diffstat (limited to 'drivers/pci/controller/pcie-cadence-host.c')
-rw-r--r-- | drivers/pci/controller/pcie-cadence-host.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/controller/pcie-cadence-host.c b/drivers/pci/controller/pcie-cadence-host.c index a4ebbd37b553..36f31092562f 100644 --- a/drivers/pci/controller/pcie-cadence-host.c +++ b/drivers/pci/controller/pcie-cadence-host.c | |||
@@ -58,6 +58,9 @@ static void __iomem *cdns_pci_map_bus(struct pci_bus *bus, unsigned int devfn, | |||
58 | 58 | ||
59 | return pcie->reg_base + (where & 0xfff); | 59 | return pcie->reg_base + (where & 0xfff); |
60 | } | 60 | } |
61 | /* Check that the link is up */ | ||
62 | if (!(cdns_pcie_readl(pcie, CDNS_PCIE_LM_BASE) & 0x1)) | ||
63 | return NULL; | ||
61 | 64 | ||
62 | /* Update Output registers for AXI region 0. */ | 65 | /* Update Output registers for AXI region 0. */ |
63 | addr0 = CDNS_PCIE_AT_OB_REGION_PCI_ADDR0_NBITS(12) | | 66 | addr0 = CDNS_PCIE_AT_OB_REGION_PCI_ADDR0_NBITS(12) | |
@@ -239,6 +242,7 @@ static int cdns_pcie_host_probe(struct platform_device *pdev) | |||
239 | struct cdns_pcie *pcie; | 242 | struct cdns_pcie *pcie; |
240 | struct resource *res; | 243 | struct resource *res; |
241 | int ret; | 244 | int ret; |
245 | int phy_count; | ||
242 | 246 | ||
243 | bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc)); | 247 | bridge = devm_pci_alloc_host_bridge(dev, sizeof(*rc)); |
244 | if (!bridge) | 248 | if (!bridge) |
@@ -290,6 +294,13 @@ static int cdns_pcie_host_probe(struct platform_device *pdev) | |||
290 | } | 294 | } |
291 | pcie->mem_res = res; | 295 | pcie->mem_res = res; |
292 | 296 | ||
297 | ret = cdns_pcie_init_phy(dev, pcie); | ||
298 | if (ret) { | ||
299 | dev_err(dev, "failed to init phy\n"); | ||
300 | return ret; | ||
301 | } | ||
302 | platform_set_drvdata(pdev, pcie); | ||
303 | |||
293 | pm_runtime_enable(dev); | 304 | pm_runtime_enable(dev); |
294 | ret = pm_runtime_get_sync(dev); | 305 | ret = pm_runtime_get_sync(dev); |
295 | if (ret < 0) { | 306 | if (ret < 0) { |
@@ -322,6 +333,10 @@ static int cdns_pcie_host_probe(struct platform_device *pdev) | |||
322 | 333 | ||
323 | err_get_sync: | 334 | err_get_sync: |
324 | pm_runtime_disable(dev); | 335 | pm_runtime_disable(dev); |
336 | cdns_pcie_disable_phy(pcie); | ||
337 | phy_count = pcie->phy_count; | ||
338 | while (phy_count--) | ||
339 | device_link_del(pcie->link[phy_count]); | ||
325 | 340 | ||
326 | return ret; | 341 | return ret; |
327 | } | 342 | } |