2019-11-28 20:41:20 +00:00
|
|
|
From 490d103232287eb51c92c49a4ef8865fd0a9d59e Mon Sep 17 00:00:00 2001
|
|
|
|
From: Sham Muthayyan <smuthayy@codeaurora.org>
|
|
|
|
Date: Tue, 19 Jul 2016 18:58:18 +0530
|
|
|
|
Subject: PCI: qcom: Fixed IPQ806x PCIE reset changes
|
|
|
|
|
|
|
|
Change-Id: Ia6590e960b9754b1e8b7a51f318788cd63e9e321
|
|
|
|
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
|
|
|
|
---
|
|
|
|
|
2019-11-28 21:28:48 +00:00
|
|
|
--- a/drivers/pci/controller/dwc/pcie-qcom.c
|
|
|
|
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
|
|
|
|
@@ -92,6 +92,7 @@ struct qcom_pcie_resources_2_1_0 {
|
2019-11-28 20:41:20 +00:00
|
|
|
struct reset_control *ahb_reset;
|
|
|
|
struct reset_control *por_reset;
|
|
|
|
struct reset_control *phy_reset;
|
|
|
|
+ struct reset_control *ext_reset;
|
2019-11-28 21:28:48 +00:00
|
|
|
struct regulator_bulk_data supplies[QCOM_PCIE_2_1_0_MAX_SUPPLY];
|
|
|
|
};
|
|
|
|
|
|
|
|
@@ -261,6 +262,10 @@ static int qcom_pcie_get_resources_2_1_0
|
2019-11-28 20:41:20 +00:00
|
|
|
if (IS_ERR(res->por_reset))
|
|
|
|
return PTR_ERR(res->por_reset);
|
|
|
|
|
|
|
|
+ res->ext_reset = devm_reset_control_get(dev, "ext");
|
|
|
|
+ if (IS_ERR(res->ext_reset))
|
|
|
|
+ return PTR_ERR(res->ext_reset);
|
|
|
|
+
|
|
|
|
res->phy_reset = devm_reset_control_get_exclusive(dev, "phy");
|
|
|
|
return PTR_ERR_OR_ZERO(res->phy_reset);
|
|
|
|
}
|
2019-11-28 21:28:48 +00:00
|
|
|
@@ -274,6 +279,7 @@ static void qcom_pcie_deinit_2_1_0(struc
|
2019-11-28 20:41:20 +00:00
|
|
|
reset_control_assert(res->ahb_reset);
|
|
|
|
reset_control_assert(res->por_reset);
|
|
|
|
reset_control_assert(res->pci_reset);
|
|
|
|
+ reset_control_assert(res->ext_reset);
|
|
|
|
clk_disable_unprepare(res->iface_clk);
|
|
|
|
clk_disable_unprepare(res->core_clk);
|
|
|
|
clk_disable_unprepare(res->phy_clk);
|
2019-11-28 21:28:48 +00:00
|
|
|
@@ -290,15 +296,21 @@ static int qcom_pcie_init_2_1_0(struct q
|
2019-11-28 20:41:20 +00:00
|
|
|
u32 val;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
+ ret = reset_control_assert(res->ahb_reset);
|
|
|
|
+ if (ret) {
|
|
|
|
+ dev_err(dev, "cannot assert ahb reset\n");
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
2019-11-28 21:28:48 +00:00
|
|
|
ret = regulator_bulk_enable(ARRAY_SIZE(res->supplies), res->supplies);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(dev, "cannot enable regulators\n");
|
|
|
|
return ret;
|
2019-11-28 20:41:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- ret = reset_control_assert(res->ahb_reset);
|
|
|
|
+ ret = reset_control_deassert(res->ext_reset);
|
|
|
|
if (ret) {
|
|
|
|
- dev_err(dev, "cannot assert ahb reset\n");
|
|
|
|
+ dev_err(dev, "cannot assert ext reset\n");
|
2019-11-28 21:28:48 +00:00
|
|
|
goto err_assert_ahb;
|
2019-11-28 20:41:20 +00:00
|
|
|
}
|
|
|
|
|