kernel: update 4.4 to 4.4.83
[oweals/openwrt.git] / target / linux / generic / pending-4.4 / 078-0001-net-phy-update-Broadcom-drivers-to-v4.5.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Subject: [PATCH 1/4] net: phy: update Broadcom drivers to v4.5
3 MIME-Version: 1.0
4 Content-Type: text/plain; charset=UTF-8
5 Content-Transfer-Encoding: 8bit
6
7 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 ---
9
10 --- a/drivers/net/phy/bcm7xxx.c
11 +++ b/drivers/net/phy/bcm7xxx.c
12 @@ -250,10 +250,6 @@ static int bcm7xxx_config_init(struct ph
13         phy_write(phydev, MII_BCM7XXX_AUX_MODE, MII_BCM7XX_64CLK_MDIO);
14         phy_read(phydev, MII_BCM7XXX_AUX_MODE);
15  
16 -       /* Workaround only required for 100Mbits/sec capable PHYs */
17 -       if (phydev->supported & PHY_GBIT_FEATURES)
18 -               return 0;
19 -
20         /* set shadow mode 2 */
21         ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST,
22                         MII_BCM7XXX_SHD_MODE_2, MII_BCM7XXX_SHD_MODE_2);
23 @@ -270,7 +266,7 @@ static int bcm7xxx_config_init(struct ph
24         phy_write(phydev, MII_BCM7XXX_100TX_FALSE_CAR, 0x7555);
25  
26         /* reset shadow mode 2 */
27 -       ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST, MII_BCM7XXX_SHD_MODE_2, 0);
28 +       ret = phy_set_clr_bits(phydev, MII_BCM7XXX_TEST, 0, MII_BCM7XXX_SHD_MODE_2);
29         if (ret < 0)
30                 return ret;
31  
32 @@ -307,11 +303,6 @@ static int bcm7xxx_suspend(struct phy_de
33         return 0;
34  }
35  
36 -static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
37 -{
38 -       return 0;
39 -}
40 -
41  #define BCM7XXX_28NM_GPHY(_oui, _name)                                 \
42  {                                                                      \
43         .phy_id         = (_oui),                                       \
44 @@ -338,7 +329,7 @@ static struct phy_driver bcm7xxx_driver[
45         .phy_id         = PHY_ID_BCM7425,
46         .phy_id_mask    = 0xfffffff0,
47         .name           = "Broadcom BCM7425",
48 -       .features       = PHY_GBIT_FEATURES |
49 +       .features       = PHY_BASIC_FEATURES |
50                           SUPPORTED_Pause | SUPPORTED_Asym_Pause,
51         .flags          = PHY_IS_INTERNAL,
52         .config_init    = bcm7xxx_config_init,
53 @@ -351,7 +342,7 @@ static struct phy_driver bcm7xxx_driver[
54         .phy_id         = PHY_ID_BCM7429,
55         .phy_id_mask    = 0xfffffff0,
56         .name           = "Broadcom BCM7429",
57 -       .features       = PHY_GBIT_FEATURES |
58 +       .features       = PHY_BASIC_FEATURES |
59                           SUPPORTED_Pause | SUPPORTED_Asym_Pause,
60         .flags          = PHY_IS_INTERNAL,
61         .config_init    = bcm7xxx_config_init,
62 @@ -361,31 +352,18 @@ static struct phy_driver bcm7xxx_driver[
63         .resume         = bcm7xxx_config_init,
64         .driver         = { .owner = THIS_MODULE },
65  }, {
66 -       .phy_id         = PHY_BCM_OUI_4,
67 -       .phy_id_mask    = 0xffff0000,
68 -       .name           = "Broadcom BCM7XXX 40nm",
69 -       .features       = PHY_GBIT_FEATURES |
70 -                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
71 -       .flags          = PHY_IS_INTERNAL,
72 -       .config_init    = bcm7xxx_config_init,
73 -       .config_aneg    = genphy_config_aneg,
74 -       .read_status    = genphy_read_status,
75 -       .suspend        = bcm7xxx_suspend,
76 -       .resume         = bcm7xxx_config_init,
77 -       .driver         = { .owner = THIS_MODULE },
78 -}, {
79 -       .phy_id         = PHY_BCM_OUI_5,
80 -       .phy_id_mask    = 0xffffff00,
81 -       .name           = "Broadcom BCM7XXX 65nm",
82 -       .features       = PHY_BASIC_FEATURES |
83 +       .phy_id         = PHY_ID_BCM7435,
84 +       .phy_id_mask    = 0xfffffff0,
85 +       .name           = "Broadcom BCM7435",
86 +       .features       = PHY_BASIC_FEATURES |
87                           SUPPORTED_Pause | SUPPORTED_Asym_Pause,
88 -       .flags          = PHY_IS_INTERNAL,
89 -       .config_init    = bcm7xxx_dummy_config_init,
90 -       .config_aneg    = genphy_config_aneg,
91 -       .read_status    = genphy_read_status,
92 -       .suspend        = bcm7xxx_suspend,
93 -       .resume         = bcm7xxx_config_init,
94 -       .driver         = { .owner = THIS_MODULE },
95 +       .flags          = PHY_IS_INTERNAL,
96 +       .config_init    = bcm7xxx_config_init,
97 +       .config_aneg    = genphy_config_aneg,
98 +       .read_status    = genphy_read_status,
99 +       .suspend        = bcm7xxx_suspend,
100 +       .resume         = bcm7xxx_config_init,
101 +       .driver         = { .owner = THIS_MODULE },
102  } };
103  
104  static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = {
105 @@ -395,9 +373,8 @@ static struct mdio_device_id __maybe_unu
106         { PHY_ID_BCM7425, 0xfffffff0, },
107         { PHY_ID_BCM7429, 0xfffffff0, },
108         { PHY_ID_BCM7439, 0xfffffff0, },
109 +       { PHY_ID_BCM7435, 0xfffffff0, },
110         { PHY_ID_BCM7445, 0xfffffff0, },
111 -       { PHY_BCM_OUI_4, 0xffff0000 },
112 -       { PHY_BCM_OUI_5, 0xffffff00 },
113         { }
114  };
115  
116 --- a/include/linux/brcmphy.h
117 +++ b/include/linux/brcmphy.h
118 @@ -26,6 +26,7 @@
119  #define PHY_ID_BCM7366                 0x600d8490
120  #define PHY_ID_BCM7425                 0x600d86b0
121  #define PHY_ID_BCM7429                 0x600d8730
122 +#define PHY_ID_BCM7435                 0x600d8750
123  #define PHY_ID_BCM7439                 0x600d8480
124  #define PHY_ID_BCM7439_2               0xae025080
125  #define PHY_ID_BCM7445                 0x600d8510