87d6c500694b6954e6997f001839fc36f0e3e28d
[librecmc/librecmc.git] /
1 --- a/drivers/net/phy/broadcom.c
2 +++ b/drivers/net/phy/broadcom.c
3 @@ -30,6 +30,22 @@ MODULE_DESCRIPTION("Broadcom PHY driver"
4  MODULE_AUTHOR("Maciej W. Rozycki");
5  MODULE_LICENSE("GPL");
6  
7 +static int bcm54210e_config_init(struct phy_device *phydev)
8 +{
9 +       int val;
10 +
11 +       val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
12 +       val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
13 +       val |= MII_BCM54XX_AUXCTL_MISC_WREN;
14 +       bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, val);
15 +
16 +       val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL);
17 +       val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
18 +       bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
19 +
20 +       return 0;
21 +}
22 +
23  static int bcm54810_config(struct phy_device *phydev)
24  {
25         int rc, val;
26 @@ -230,7 +246,11 @@ static int bcm54xx_config_init(struct ph
27             (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
28                 bcm54xx_adjust_rxrefclk(phydev);
29  
30 -       if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
31 +       if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
32 +               err = bcm54210e_config_init(phydev);
33 +               if (err)
34 +                       return err;
35 +       } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
36                 err = bcm54810_config(phydev);
37                 if (err)
38                         return err;
39 @@ -548,6 +568,19 @@ static struct phy_driver broadcom_driver
40         .config_intr    = bcm_phy_config_intr,
41         .driver         = { .owner = THIS_MODULE },
42  }, {
43 +       .phy_id         = PHY_ID_BCM54210E,
44 +       .phy_id_mask    = 0xfffffff0,
45 +       .name           = "Broadcom BCM54210E",
46 +       .features       = PHY_GBIT_FEATURES |
47 +                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
48 +       .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
49 +       .config_init    = bcm54xx_config_init,
50 +       .config_aneg    = genphy_config_aneg,
51 +       .read_status    = genphy_read_status,
52 +       .ack_interrupt  = bcm_phy_ack_intr,
53 +       .config_intr    = bcm_phy_config_intr,
54 +       .driver         = { .owner = THIS_MODULE },
55 +}, {
56         .phy_id         = PHY_ID_BCM5461,
57         .phy_id_mask    = 0xfffffff0,
58         .name           = "Broadcom BCM5461",
59 @@ -710,6 +743,7 @@ module_phy_driver(broadcom_drivers);
60  static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
61         { PHY_ID_BCM5411, 0xfffffff0 },
62         { PHY_ID_BCM5421, 0xfffffff0 },
63 +       { PHY_ID_BCM54210E, 0xfffffff0 },
64         { PHY_ID_BCM5461, 0xfffffff0 },
65         { PHY_ID_BCM54612E, 0xfffffff0 },
66         { PHY_ID_BCM54616S, 0xfffffff0 },
67 --- a/include/linux/brcmphy.h
68 +++ b/include/linux/brcmphy.h
69 @@ -17,6 +17,7 @@
70  #define PHY_ID_BCM5482                 0x0143bcb0
71  #define PHY_ID_BCM5411                 0x00206070
72  #define PHY_ID_BCM5421                 0x002060e0
73 +#define PHY_ID_BCM54210E               0x600d84a0
74  #define PHY_ID_BCM5464                 0x002060b0
75  #define PHY_ID_BCM5461                 0x002060c0
76  #define PHY_ID_BCM54612E               0x03625e60