9
0
Fork 0

PCI: imx6: Simplify imx6_pcie_remove()

Instead of manualy flipping the bits call imx6_pcie_assert_core_reset()
to give the code, executing after BB, a clean slate. This also makes the
function match similar code in Linux kernel driver.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Andrey Smirnov 2016-04-25 22:36:59 -07:00 committed by Sascha Hauer
parent b8efd857b0
commit 9aa9049cfd
1 changed files with 1 additions and 18 deletions

View File

@ -618,25 +618,8 @@ static int __init imx6_pcie_probe(struct device_d *dev)
static void imx6_pcie_remove(struct device_d *dev)
{
struct imx6_pcie *imx6_pcie = dev->priv;
u32 val;
val = readl(imx6_pcie->pp.dbi_base + PCIE_PL_PFLR);
val &= ~PCIE_PL_PFLR_LINK_STATE_MASK;
val |= PCIE_PL_PFLR_FORCE_LINK;
data_abort_mask();
writel(val, imx6_pcie->pp.dbi_base + PCIE_PL_PFLR);
data_abort_unmask();
val = readl(imx6_pcie->iomuxc_gpr + IOMUXC_GPR12);
val &= ~IMX6Q_GPR12_PCIE_CTL_2;
writel(val, imx6_pcie->iomuxc_gpr + IOMUXC_GPR12);
val = readl(imx6_pcie->iomuxc_gpr + IOMUXC_GPR1);
val |= IMX6Q_GPR1_PCIE_TEST_PD;
writel(val, imx6_pcie->iomuxc_gpr + IOMUXC_GPR1);
val &= ~IMX6Q_GPR1_PCIE_REF_CLK_EN;
writel(val, imx6_pcie->iomuxc_gpr + IOMUXC_GPR1);
imx6_pcie_assert_core_reset(&imx6_pcie->pp);
}
static struct of_device_id imx6_pcie_of_match[] = {