kernel: make make patches/files apply/compile for kernel 5.2
[openwrt/staging/mkresin.git] / target / linux / generic / pending-5.2 / 180-net-phy-at803x-add-support-for-AT8032.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Subject: net: phy: at803x: add support for AT8032
3
4 Like AT8030, this PHY needs the GPIO reset workaround
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8
9 --- a/drivers/net/phy/at803x.c
10 +++ b/drivers/net/phy/at803x.c
11 @@ -55,8 +55,10 @@
12
13 #define ATH8030_PHY_ID 0x004dd076
14 #define ATH8031_PHY_ID 0x004dd074
15 +#define ATH8032_PHY_ID 0x004dd023
16 #define ATH8035_PHY_ID 0x004dd072
17 #define AT803X_PHY_ID_MASK 0xffffffef
18 +#define AT8032_PHY_ID_MASK 0xffffffff
19
20 MODULE_DESCRIPTION("Atheros 803x PHY driver");
21 MODULE_AUTHOR("Matus Ujhelyi");
22 @@ -325,7 +327,7 @@ static int at803x_config_intr(struct phy
23 static void at803x_link_change_notify(struct phy_device *phydev)
24 {
25 /*
26 - * Conduct a hardware reset for AT8030 every time a link loss is
27 + * Conduct a hardware reset for AT8030/2 every time a link loss is
28 * signalled. This is necessary to circumvent a hardware bug that
29 * occurs when the cable is unplugged while TX packets are pending
30 * in the FIFO. In such cases, the FIFO enters an error mode it
31 @@ -422,6 +424,23 @@ static struct phy_driver at803x_driver[]
32 .aneg_done = at803x_aneg_done,
33 .ack_interrupt = &at803x_ack_interrupt,
34 .config_intr = &at803x_config_intr,
35 +}, {
36 + /* ATHEROS 8032 */
37 + .phy_id = ATH8032_PHY_ID,
38 + .name = "Atheros 8032 ethernet",
39 + .phy_id_mask = AT8032_PHY_ID_MASK,
40 + .probe = at803x_probe,
41 + .config_init = at803x_config_init,
42 + .link_change_notify = at803x_link_change_notify,
43 + .set_wol = at803x_set_wol,
44 + .get_wol = at803x_get_wol,
45 + .suspend = at803x_suspend,
46 + .resume = at803x_resume,
47 + .features = PHY_BASIC_FEATURES,
48 + .config_aneg = genphy_config_aneg,
49 + .read_status = genphy_read_status,
50 + .ack_interrupt = at803x_ack_interrupt,
51 + .config_intr = at803x_config_intr,
52 } };
53
54 module_phy_driver(at803x_driver);
55 @@ -429,6 +448,7 @@ module_phy_driver(at803x_driver);
56 static struct mdio_device_id __maybe_unused atheros_tbl[] = {
57 { ATH8030_PHY_ID, AT803X_PHY_ID_MASK },
58 { ATH8031_PHY_ID, AT803X_PHY_ID_MASK },
59 + { ATH8032_PHY_ID, AT8032_PHY_ID_MASK },
60 { ATH8035_PHY_ID, AT803X_PHY_ID_MASK },
61 { }
62 };