aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-04-08 04:30:03 -0400
committerJames Hogan <jhogan@kernel.org>2018-05-24 08:22:56 -0400
commit32795631e67e16141aa5e065c28ba03bf17abb90 (patch)
tree311751c8055c4da024fd6cab9a43d42f2fb547fe
parent9a3a92ccfe3620743d4ae57c987dc8e9c5f88996 (diff)
MIPS: lantiq: gphy: Drop reboot/remove reset asserts
While doing a global software reset, these bits are not cleared and let some bootloader fail to initialise the GPHYs. The bootloader don't expect the GPHYs in reset, as they aren't during power on. The asserts were a workaround for a wrong syscon-reboot mask. With a mask set which includes the GPHY resets, these resets aren't required any more. Fixes: 126534141b45 ("MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd") Signed-off-by: Mathias Kresin <dev@kresin.me> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: John Crispin <john@phrozen.org> Cc: linux-mips@linux-mips.org Cc: <stable@vger.kernel.org> # 4.14+ Patchwork: https://patchwork.linux-mips.org/patch/19003/ [jhogan@kernel.org: Fix build warnings] Signed-off-by: James Hogan <jhogan@kernel.org>
-rw-r--r--drivers/soc/lantiq/gphy.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/soc/lantiq/gphy.c b/drivers/soc/lantiq/gphy.c
index 8d8659463b3e..feeb17cebc25 100644
--- a/drivers/soc/lantiq/gphy.c
+++ b/drivers/soc/lantiq/gphy.c
@@ -30,7 +30,6 @@ struct xway_gphy_priv {
30 struct clk *gphy_clk_gate; 30 struct clk *gphy_clk_gate;
31 struct reset_control *gphy_reset; 31 struct reset_control *gphy_reset;
32 struct reset_control *gphy_reset2; 32 struct reset_control *gphy_reset2;
33 struct notifier_block gphy_reboot_nb;
34 void __iomem *membase; 33 void __iomem *membase;
35 char *fw_name; 34 char *fw_name;
36}; 35};
@@ -64,24 +63,6 @@ static const struct of_device_id xway_gphy_match[] = {
64}; 63};
65MODULE_DEVICE_TABLE(of, xway_gphy_match); 64MODULE_DEVICE_TABLE(of, xway_gphy_match);
66 65
67static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb)
68{
69 return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb);
70}
71
72static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb,
73 unsigned long code, void *unused)
74{
75 struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb);
76
77 if (priv) {
78 reset_control_assert(priv->gphy_reset);
79 reset_control_assert(priv->gphy_reset2);
80 }
81
82 return NOTIFY_DONE;
83}
84
85static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv, 66static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv,
86 dma_addr_t *dev_addr) 67 dma_addr_t *dev_addr)
87{ 68{
@@ -205,14 +186,6 @@ static int xway_gphy_probe(struct platform_device *pdev)
205 reset_control_deassert(priv->gphy_reset); 186 reset_control_deassert(priv->gphy_reset);
206 reset_control_deassert(priv->gphy_reset2); 187 reset_control_deassert(priv->gphy_reset2);
207 188
208 /* assert the gphy reset because it can hang after a reboot: */
209 priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify;
210 priv->gphy_reboot_nb.priority = -1;
211
212 ret = register_reboot_notifier(&priv->gphy_reboot_nb);
213 if (ret)
214 dev_warn(dev, "Failed to register reboot notifier\n");
215
216 platform_set_drvdata(pdev, priv); 189 platform_set_drvdata(pdev, priv);
217 190
218 return ret; 191 return ret;
@@ -220,21 +193,12 @@ static int xway_gphy_probe(struct platform_device *pdev)
220 193
221static int xway_gphy_remove(struct platform_device *pdev) 194static int xway_gphy_remove(struct platform_device *pdev)
222{ 195{
223 struct device *dev = &pdev->dev;
224 struct xway_gphy_priv *priv = platform_get_drvdata(pdev); 196 struct xway_gphy_priv *priv = platform_get_drvdata(pdev);
225 int ret;
226
227 reset_control_assert(priv->gphy_reset);
228 reset_control_assert(priv->gphy_reset2);
229 197
230 iowrite32be(0, priv->membase); 198 iowrite32be(0, priv->membase);
231 199
232 clk_disable_unprepare(priv->gphy_clk_gate); 200 clk_disable_unprepare(priv->gphy_clk_gate);
233 201
234 ret = unregister_reboot_notifier(&priv->gphy_reboot_nb);
235 if (ret)
236 dev_warn(dev, "Failed to unregister reboot notifier\n");
237
238 return 0; 202 return 0;
239} 203}
240 204