[LEDE-DEV] [PATCH v4] ipq8064: Fix dwc3 module unloading

Thomas Reifferscheid thomas at reifferscheid.org
Sun Apr 2 12:25:05 PDT 2017


The patch follows the qualcomm code comments setting
SSUSB_CTRL_TEST_POWERDOWN to 0x1 and is testing and clearing the
Bit during usb superspeed phy init.

Fixes: dwc3 module unloading and re-loading

Signed-off-by: Thomas Reifferscheid <thomas at reifferscheid.org>
---

Changes since v3:
 * Revert v1/v2
 * Set SSUSB_CTRL_TEST_POWERDOWN instead
 * Test and clear the bit during ss init

Changes since v2:
 * be more verbose

Changes since v1:
 * be more verbose in explaining the mistake

 .../ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch     | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
index 39e918f..ee37866 100644
--- a/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
+++ b/target/linux/ipq806x/patches-4.9/0032-phy-add-qcom-dwc3-phy.patch
@@ -39,7 +39,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 +obj-$(CONFIG_PHY_QCOM_DWC3)		+= phy-qcom-dwc3.o
 --- /dev/null
 +++ b/drivers/phy/phy-qcom-dwc3.c
-@@ -0,0 +1,484 @@
+@@ -0,0 +1,492 @@
 +/* Copyright (c) 2014-2015, Code Aurora Forum. All rights reserved.
 + *
 + * This program is free software; you can redistribute it and/or modify
@@ -331,6 +331,14 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 +
 +	/* reset phy */
 +	data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++
++       /* Test and clear SSUSB_CTRL_TEST_POWERDOWN */
++       if (data & SSUSB_CTRL_TEST_POWERDOWN) {
++               qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
++                               SSUSB_CTRL_TEST_POWERDOWN, 0x0);
++               data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
++       }
++
 +	writel(data | SSUSB_CTRL_SS_PHY_RESET,
 +		phy_dwc3->base + SSUSB_PHY_CTRL_REG);
 +	usleep_range(2000, 2200);
@@ -420,7 +428,7 @@ Signed-off-by: Andy Gross <agross at codeaurora.org>
 +	qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
 +		SSUSB_CTRL_REF_USE_PAD, 0x0);
 +	qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
-+		SSUSB_CTRL_TEST_POWERDOWN, 0x0);
++		SSUSB_CTRL_TEST_POWERDOWN, SSUSB_CTRL_TEST_POWERDOWN);
 +
 +	return 0;
 +}
-- 
2.1.4




More information about the Lede-dev mailing list