summaryrefslogtreecommitdiff
path: root/drivers/net/phy/bcm54140.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2020-04-29 01:06:59 +0200
committerDavid S. Miller <davem@davemloft.net>2020-04-30 20:55:49 -0700
commite4e51da66dc812176cca16b0f8a5b87b173deb5d (patch)
tree2f82e77633c682a1f8ac2cccae0f66a723a8d6cd /drivers/net/phy/bcm54140.c
parente9a66851de722dfa97a41e982266603cdb97ea3b (diff)
net: phy: bcm54140: add second PHY ID
This PHY has two PHY IDs depending on its mode. Adjust the mask so that it includes both IDs. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/bcm54140.c')
-rw-r--r--drivers/net/phy/bcm54140.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/phy/bcm54140.c b/drivers/net/phy/bcm54140.c
index d0498ed47878..400d7c3c405a 100644
--- a/drivers/net/phy/bcm54140.c
+++ b/drivers/net/phy/bcm54140.c
@@ -115,6 +115,13 @@
#define BCM54140_HWMON_IN_ALARM_BIT(ch) ((ch) ? BCM54140_RDB_MON_ISR_3V3 \
: BCM54140_RDB_MON_ISR_1V0)
+/* This PHY has two different PHY IDs depening on its MODE_SEL pin. This
+ * pin choses between 4x SGMII and QSGMII mode:
+ * AE02_5009 4x SGMII
+ * AE02_5019 QSGMII
+ */
+#define BCM54140_PHY_ID_MASK 0xffffffe8
+
#define BCM54140_PHY_ID_REV(phy_id) ((phy_id) & 0x7)
#define BCM54140_REV_B0 1
@@ -857,7 +864,7 @@ static int bcm54140_set_tunable(struct phy_device *phydev,
static struct phy_driver bcm54140_drivers[] = {
{
.phy_id = PHY_ID_BCM54140,
- .phy_id_mask = 0xfffffff8,
+ .phy_id_mask = BCM54140_PHY_ID_MASK,
.name = "Broadcom BCM54140",
.features = PHY_GBIT_FEATURES,
.config_init = bcm54140_config_init,
@@ -875,7 +882,7 @@ static struct phy_driver bcm54140_drivers[] = {
module_phy_driver(bcm54140_drivers);
static struct mdio_device_id __maybe_unused bcm54140_tbl[] = {
- { PHY_ID_BCM54140, 0xfffffff8 },
+ { PHY_ID_BCM54140, BCM54140_PHY_ID_MASK },
{ }
};