mac80211: update brcmfmac backporting brcmf_err cleanups
[openwrt/openwrt.git] / target / linux / generic / patches-4.9 / 180-net-phy-at803x-add-support-for-AT8032.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 30 Nov 2016 11:31:03 +0100
3 Subject: [PATCH] net: phy: at803x: add support for AT8032
4
5 Like AT8030, this PHY needs the GPIO reset workaround
6
7 Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 ---
9
10 --- a/drivers/net/phy/at803x.c
11 +++ b/drivers/net/phy/at803x.c
12 @@ -62,6 +62,7 @@
13
14 #define ATH8030_PHY_ID 0x004dd076
15 #define ATH8031_PHY_ID 0x004dd074
16 +#define ATH8032_PHY_ID 0x004dd023
17 #define ATH8035_PHY_ID 0x004dd072
18
19 MODULE_DESCRIPTION("Atheros 803x PHY driver");
20 @@ -259,7 +260,8 @@ static int at803x_probe(struct phy_devic
21 if (!priv)
22 return -ENOMEM;
23
24 - if (phydev->drv->phy_id != ATH8030_PHY_ID)
25 + if (phydev->drv->phy_id != ATH8030_PHY_ID &&
26 + phydev->drv->phy_id != ATH8032_PHY_ID)
27 goto does_not_require_reset_workaround;
28
29 gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
30 @@ -335,7 +337,7 @@ static void at803x_link_change_notify(st
31 struct at803x_priv *priv = phydev->priv;
32
33 /*
34 - * Conduct a hardware reset for AT8030 every time a link loss is
35 + * Conduct a hardware reset for AT8030/2 every time a link loss is
36 * signalled. This is necessary to circumvent a hardware bug that
37 * occurs when the cable is unplugged while TX packets are pending
38 * in the FIFO. In such cases, the FIFO enters an error mode it
39 @@ -447,6 +449,24 @@ static struct phy_driver at803x_driver[]
40 .aneg_done = at803x_aneg_done,
41 .ack_interrupt = &at803x_ack_interrupt,
42 .config_intr = &at803x_config_intr,
43 +}, {
44 + /* ATHEROS 8032 */
45 + .phy_id = ATH8032_PHY_ID,
46 + .name = "Atheros 8032 ethernet",
47 + .phy_id_mask = 0xffffffef,
48 + .probe = at803x_probe,
49 + .config_init = at803x_config_init,
50 + .link_change_notify = at803x_link_change_notify,
51 + .set_wol = at803x_set_wol,
52 + .get_wol = at803x_get_wol,
53 + .suspend = at803x_suspend,
54 + .resume = at803x_resume,
55 + .features = PHY_BASIC_FEATURES,
56 + .flags = PHY_HAS_INTERRUPT,
57 + .config_aneg = genphy_config_aneg,
58 + .read_status = genphy_read_status,
59 + .ack_interrupt = at803x_ack_interrupt,
60 + .config_intr = at803x_config_intr,
61 } };
62
63 module_phy_driver(at803x_driver);
64 @@ -454,6 +474,7 @@ module_phy_driver(at803x_driver);
65 static struct mdio_device_id __maybe_unused atheros_tbl[] = {
66 { ATH8030_PHY_ID, 0xffffffef },
67 { ATH8031_PHY_ID, 0xffffffef },
68 + { ATH8032_PHY_ID, 0xffffffef },
69 { ATH8035_PHY_ID, 0xffffffef },
70 { }
71 };