]> git.sur5r.net Git - u-boot/blobdiff - drivers/pci/pci_mvebu.c
rockchip: mmc: Use a pwrseq device if available
[u-boot] / drivers / pci / pci_mvebu.c
index fd2744dbd4e97c4dec0f9a0149c7fd7dc054f329..4eedfe1cbb56e5e9289f282b9e2b8a20e6cd4808 100644 (file)
@@ -155,6 +155,14 @@ static void mvebu_get_port_lane(struct mvebu_pcie *pcie, int pex_idx,
 }
 #endif
 
+static int mvebu_pex_unit_is_x4(int pex_idx)
+{
+       int pex_unit = pex_idx < 9 ? pex_idx >> 2 : 3;
+       u32 mask = (0x0f << (pex_unit * 8));
+
+       return (readl(COMPHY_REFCLK_ALIGNMENT) & mask) == mask;
+}
+
 static inline bool mvebu_pcie_link_up(struct mvebu_pcie *pcie)
 {
        u32 val;
@@ -419,5 +427,11 @@ void pci_init_board(void)
                writel(0, pcie->base + PCIE_BAR_HI_OFF(0));
 
                bus = hose->last_busno + 1;
+
+               /* need to skip more for X4 links, otherwise scan will hang */
+               if (mvebu_soc_family() == MVEBU_SOC_AXP) {
+                       if (mvebu_pex_unit_is_x4(i))
+                               i += 3;
+               }
        }
 }