[PATCH 1/9] PCI: imx6: Simplify imx6_pcie_remove()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 drivers/pci/pci-imx6.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/pci/pci-imx6.c b/drivers/pci/pci-imx6.c
index 46483b4..241df3f 100644
--- a/drivers/pci/pci-imx6.c
+++ b/drivers/pci/pci-imx6.c
@@ -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[] = {
-- 
2.5.5


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux