diff options
Diffstat (limited to 'drivers/pci/host')
-rw-r--r-- | drivers/pci/host/pci-imx6.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 1176bddee1cc..5634a33ea642 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c | |||
@@ -48,6 +48,8 @@ struct imx6_pcie { | |||
48 | #define PL_OFFSET 0x700 | 48 | #define PL_OFFSET 0x700 |
49 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) | 49 | #define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28) |
50 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) | 50 | #define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c) |
51 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING (1 << 29) | ||
52 | #define PCIE_PHY_DEBUG_R1_XMLH_LINK_UP (1 << 4) | ||
51 | 53 | ||
52 | #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) | 54 | #define PCIE_PHY_CTRL (PL_OFFSET + 0x114) |
53 | #define PCIE_PHY_CTRL_DATA_LOC 0 | 55 | #define PCIE_PHY_CTRL_DATA_LOC 0 |
@@ -338,10 +340,17 @@ static int imx6_pcie_link_up(struct pcie_port *pp) | |||
338 | { | 340 | { |
339 | u32 rc, ltssm, rx_valid, temp; | 341 | u32 rc, ltssm, rx_valid, temp; |
340 | 342 | ||
341 | /* link is debug bit 36, debug register 1 starts at bit 32 */ | 343 | /* |
342 | rc = readl(pp->dbi_base + PCIE_PHY_DEBUG_R1) & (0x1 << (36 - 32)); | 344 | * Test if the PHY reports that the link is up and also that |
343 | if (rc) | 345 | * the link training finished. It might happen that the PHY |
344 | return -EAGAIN; | 346 | * reports the link is already up, but the link training bit |
347 | * is still set, so make sure to check the training is done | ||
348 | * as well here. | ||
349 | */ | ||
350 | rc = readl(pp->dbi_base + PCIE_PHY_DEBUG_R1); | ||
351 | if ((rc & PCIE_PHY_DEBUG_R1_XMLH_LINK_UP) && | ||
352 | !(rc & PCIE_PHY_DEBUG_R1_XMLH_LINK_IN_TRAINING)) | ||
353 | return 1; | ||
345 | 354 | ||
346 | /* | 355 | /* |
347 | * From L0, initiate MAC entry to gen2 if EP/RC supports gen2. | 356 | * From L0, initiate MAC entry to gen2 if EP/RC supports gen2. |