diff options
| -rw-r--r-- | drivers/pci/controller/dwc/pci-imx6.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 3d627f94a166..ea2617712a3b 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c | |||
| @@ -89,9 +89,8 @@ struct imx6_pcie { | |||
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | /* Parameters for the waiting for PCIe PHY PLL to lock on i.MX7 */ | 91 | /* Parameters for the waiting for PCIe PHY PLL to lock on i.MX7 */ |
| 92 | #define PHY_PLL_LOCK_WAIT_MAX_RETRIES 2000 | ||
| 93 | #define PHY_PLL_LOCK_WAIT_USLEEP_MIN 50 | ||
| 94 | #define PHY_PLL_LOCK_WAIT_USLEEP_MAX 200 | 92 | #define PHY_PLL_LOCK_WAIT_USLEEP_MAX 200 |
| 93 | #define PHY_PLL_LOCK_WAIT_TIMEOUT (2000 * PHY_PLL_LOCK_WAIT_USLEEP_MAX) | ||
| 95 | 94 | ||
| 96 | /* PCIe Root Complex registers (memory-mapped) */ | 95 | /* PCIe Root Complex registers (memory-mapped) */ |
| 97 | #define PCIE_RC_IMX6_MSI_CAP 0x50 | 96 | #define PCIE_RC_IMX6_MSI_CAP 0x50 |
| @@ -488,20 +487,14 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie) | |||
| 488 | static void imx7d_pcie_wait_for_phy_pll_lock(struct imx6_pcie *imx6_pcie) | 487 | static void imx7d_pcie_wait_for_phy_pll_lock(struct imx6_pcie *imx6_pcie) |
| 489 | { | 488 | { |
| 490 | u32 val; | 489 | u32 val; |
| 491 | unsigned int retries; | ||
| 492 | struct device *dev = imx6_pcie->pci->dev; | 490 | struct device *dev = imx6_pcie->pci->dev; |
| 493 | 491 | ||
| 494 | for (retries = 0; retries < PHY_PLL_LOCK_WAIT_MAX_RETRIES; retries++) { | 492 | if (regmap_read_poll_timeout(imx6_pcie->iomuxc_gpr, |
| 495 | regmap_read(imx6_pcie->iomuxc_gpr, IOMUXC_GPR22, &val); | 493 | IOMUXC_GPR22, val, |
| 496 | 494 | val & IMX7D_GPR22_PCIE_PHY_PLL_LOCKED, | |
| 497 | if (val & IMX7D_GPR22_PCIE_PHY_PLL_LOCKED) | 495 | PHY_PLL_LOCK_WAIT_USLEEP_MAX, |
| 498 | return; | 496 | PHY_PLL_LOCK_WAIT_TIMEOUT)) |
| 499 | 497 | dev_err(dev, "PCIe PLL lock timeout\n"); | |
| 500 | usleep_range(PHY_PLL_LOCK_WAIT_USLEEP_MIN, | ||
| 501 | PHY_PLL_LOCK_WAIT_USLEEP_MAX); | ||
| 502 | } | ||
| 503 | |||
| 504 | dev_err(dev, "PCIe PLL lock timeout\n"); | ||
| 505 | } | 498 | } |
| 506 | 499 | ||
| 507 | static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) | 500 | static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) |
