Commit 1d3f9bac authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: layerscape: Factor out ls_pcie_establish_link()

All other DesignWare-based drivers have a *_establish_link() function.

This functionality is trivial for Layerscape, but factor out a
ls_pcie_establish_link() for consistency with the other drivers.  No
functional change.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarPratyush Anand <pratyush.anand@gmail.com>
parent 1200edcb
......@@ -62,23 +62,30 @@ static int ls_pcie_link_up(struct pcie_port *pp)
return 1;
}
static void ls_pcie_host_init(struct pcie_port *pp)
static int ls_pcie_establish_link(struct pcie_port *pp)
{
struct ls_pcie *pcie = to_ls_pcie(pp);
int count = 0;
u32 val;
dw_pcie_setup_rc(pp);
while (!dw_pcie_link_up(pp)) {
usleep_range(100, 1000);
count++;
if (count >= 200) {
dev_err(pp->dev, "phy link never came up\n");
return;
return -EINVAL;
}
}
return 0;
}
static void ls_pcie_host_init(struct pcie_port *pp)
{
struct ls_pcie *pcie = to_ls_pcie(pp);
u32 val;
dw_pcie_setup_rc(pp);
ls_pcie_establish_link(pp);
/*
* LS1021A Workaround for internal TKT228622
* to fix the INTx hang issue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment