scripts: Replace obsolete POSIX tmpnam in slugimage.pl with File::Temp function
[openwrt/staging/chunkeey.git] / target / linux / lantiq / patches-4.14 / 0025-MIPS-lantiq-gphy-Remove-reboot-remove-reset-asserts.patch
1 From ae14aba7fc748b2da282b59a2f516a311ed1f6eb Mon Sep 17 00:00:00 2001
2 From: Mathias Kresin <dev@kresin.me>
3 Date: Tue, 27 Mar 2018 23:15:07 +0200
4 Subject: [PATCH] MIPS: lantiq: gphy: Remove reboot/remove reset asserts
5
6 While doing a global software reset, these bits are not cleared and let
7 some bootloader fail to initialise the GPHYs. The bootloader don't expect
8 these bits to be set, as they aren't during power on.
9
10 The asserts were a workaround for a wrong syscon-reboot mask. With a mask
11 set which includes the GPHY resets of the first reset register, the
12 resets of the second reset register arn't required any more.
13
14 Signed-off-by: Mathias Kresin <dev@kresin.me>
15 ---
16 drivers/soc/lantiq/gphy.c | 34 ----------------------------------
17 1 file changed, 34 deletions(-)
18
19 --- a/drivers/soc/lantiq/gphy.c
20 +++ b/drivers/soc/lantiq/gphy.c
21 @@ -30,7 +30,6 @@ struct xway_gphy_priv {
22 struct clk *gphy_clk_gate;
23 struct reset_control *gphy_reset;
24 struct reset_control *gphy_reset2;
25 - struct notifier_block gphy_reboot_nb;
26 void __iomem *membase;
27 char *fw_name;
28 };
29 @@ -65,24 +64,6 @@ static const struct of_device_id xway_gp
30 };
31 MODULE_DEVICE_TABLE(of, xway_gphy_match);
32
33 -static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb)
34 -{
35 - return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb);
36 -}
37 -
38 -static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb,
39 - unsigned long code, void *unused)
40 -{
41 - struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb);
42 -
43 - if (priv) {
44 - reset_control_assert(priv->gphy_reset);
45 - reset_control_assert(priv->gphy_reset2);
46 - }
47 -
48 - return NOTIFY_DONE;
49 -}
50 -
51 static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv,
52 dma_addr_t *dev_addr)
53 {
54 @@ -216,14 +197,6 @@ static int xway_gphy_probe(struct platfo
55 reset_control_deassert(priv->gphy_reset);
56 reset_control_deassert(priv->gphy_reset2);
57
58 - /* assert the gphy reset because it can hang after a reboot: */
59 - priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify;
60 - priv->gphy_reboot_nb.priority = -1;
61 -
62 - ret = register_reboot_notifier(&priv->gphy_reboot_nb);
63 - if (ret)
64 - dev_warn(dev, "Failed to register reboot notifier\n");
65 -
66 platform_set_drvdata(pdev, priv);
67
68 return ret;
69 @@ -235,17 +208,10 @@ static int xway_gphy_remove(struct platf
70 struct xway_gphy_priv *priv = platform_get_drvdata(pdev);
71 int ret;
72
73 - reset_control_assert(priv->gphy_reset);
74 - reset_control_assert(priv->gphy_reset2);
75 -
76 iowrite32be(0, priv->membase);
77
78 clk_disable_unprepare(priv->gphy_clk_gate);
79
80 - ret = unregister_reboot_notifier(&priv->gphy_reboot_nb);
81 - if (ret)
82 - dev_warn(dev, "Failed to unregister reboot notifier\n");
83 -
84 return 0;
85 }
86