Skip to content

Commit 0fc9ae1

Browse files
Rafał Miłeckidavem330
authored andcommitted
net: phy: broadcom: add support for BCM54210E
It's Broadcom PHY simply described as single-port RGMII 10/100/1000BASE-T PHY. It requires disabling delay skew and GTXCLK bits. Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a00ebc4 commit 0fc9ae1

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

drivers/net/phy/broadcom.c

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ MODULE_DESCRIPTION("Broadcom PHY driver");
3030
MODULE_AUTHOR("Maciej W. Rozycki");
3131
MODULE_LICENSE("GPL");
3232

33+
static int bcm54210e_config_init(struct phy_device *phydev)
34+
{
35+
int val;
36+
37+
val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC);
38+
val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN;
39+
val |= MII_BCM54XX_AUXCTL_MISC_WREN;
40+
bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, val);
41+
42+
val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL);
43+
val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
44+
bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
45+
46+
return 0;
47+
}
48+
3349
static int bcm54810_config(struct phy_device *phydev)
3450
{
3551
int rc, val;
@@ -230,7 +246,11 @@ static int bcm54xx_config_init(struct phy_device *phydev)
230246
(phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE))
231247
bcm54xx_adjust_rxrefclk(phydev);
232248

233-
if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
249+
if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54210E) {
250+
err = bcm54210e_config_init(phydev);
251+
if (err)
252+
return err;
253+
} else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54810) {
234254
err = bcm54810_config(phydev);
235255
if (err)
236256
return err;
@@ -541,6 +561,17 @@ static struct phy_driver broadcom_drivers[] = {
541561
.read_status = genphy_read_status,
542562
.ack_interrupt = bcm_phy_ack_intr,
543563
.config_intr = bcm_phy_config_intr,
564+
}, {
565+
.phy_id = PHY_ID_BCM54210E,
566+
.phy_id_mask = 0xfffffff0,
567+
.name = "Broadcom BCM54210E",
568+
.features = PHY_GBIT_FEATURES,
569+
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
570+
.config_init = bcm54xx_config_init,
571+
.config_aneg = genphy_config_aneg,
572+
.read_status = genphy_read_status,
573+
.ack_interrupt = bcm_phy_ack_intr,
574+
.config_intr = bcm_phy_config_intr,
544575
}, {
545576
.phy_id = PHY_ID_BCM5461,
546577
.phy_id_mask = 0xfffffff0,
@@ -680,6 +711,7 @@ module_phy_driver(broadcom_drivers);
680711
static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
681712
{ PHY_ID_BCM5411, 0xfffffff0 },
682713
{ PHY_ID_BCM5421, 0xfffffff0 },
714+
{ PHY_ID_BCM54210E, 0xfffffff0 },
683715
{ PHY_ID_BCM5461, 0xfffffff0 },
684716
{ PHY_ID_BCM54612E, 0xfffffff0 },
685717
{ PHY_ID_BCM54616S, 0xfffffff0 },

include/linux/brcmphy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define PHY_ID_BCM5482 0x0143bcb0
1818
#define PHY_ID_BCM5411 0x00206070
1919
#define PHY_ID_BCM5421 0x002060e0
20+
#define PHY_ID_BCM54210E 0x600d84a0
2021
#define PHY_ID_BCM5464 0x002060b0
2122
#define PHY_ID_BCM5461 0x002060c0
2223
#define PHY_ID_BCM54612E 0x03625e60

0 commit comments

Comments
 (0)