From: Michael Walle <michael@walle.cc>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Michael Walle <michael@walle.cc>
Subject: [PATCH net-next v2 3/4] net: phy: bcm54140: apply the workaround on b0 chips
Date: Wed, 29 Apr 2020 01:06:58 +0200 [thread overview]
Message-ID: <20200428230659.7754-3-michael@walle.cc> (raw)
In-Reply-To: <20200428230659.7754-1-michael@walle.cc>
The lower three bits of the phy_id specifies the chip stepping. The
workaround is specifically for the B0 stepping. Apply it only on these
chips.
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
changes since v1:
- added reviewed-by tags
drivers/net/phy/bcm54140.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/bcm54140.c b/drivers/net/phy/bcm54140.c
index edafc9dc2f63..d73cbddbc69b 100644
--- a/drivers/net/phy/bcm54140.c
+++ b/drivers/net/phy/bcm54140.c
@@ -115,6 +115,9 @@
#define BCM54140_HWMON_IN_ALARM_BIT(ch) ((ch) ? BCM54140_RDB_MON_ISR_3V3 \
: BCM54140_RDB_MON_ISR_1V0)
+#define BCM54140_PHY_ID_REV(phy_id) ((phy_id) & 0x7)
+#define BCM54140_REV_B0 1
+
#define BCM54140_DEFAULT_DOWNSHIFT 5
#define BCM54140_MAX_DOWNSHIFT 9
@@ -632,9 +635,11 @@ static int bcm54140_config_init(struct phy_device *phydev)
int ret;
/* Apply hardware errata */
- ret = bcm54140_b0_workaround(phydev);
- if (ret)
- return ret;
+ if (BCM54140_PHY_ID_REV(phydev->phy_id) == BCM54140_REV_B0) {
+ ret = bcm54140_b0_workaround(phydev);
+ if (ret)
+ return ret;
+ }
/* Unmask events we are interested in. */
reg &= ~(BCM54140_RDB_INT_DUPLEX |
--
2.20.1
next prev parent reply other threads:[~2020-04-28 23:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 23:06 [PATCH net-next v2 1/4] net: phy: bcm54140: use genphy_soft_reset() Michael Walle
2020-04-28 23:06 ` [PATCH net-next v2 2/4] net: phy: bcm54140: fix phy_id_mask Michael Walle
2020-05-01 3:56 ` David Miller
2020-04-28 23:06 ` Michael Walle [this message]
2020-05-01 3:56 ` [PATCH net-next v2 3/4] net: phy: bcm54140: apply the workaround on b0 chips David Miller
2020-04-28 23:06 ` [PATCH net-next v2 4/4] net: phy: bcm54140: add second PHY ID Michael Walle
2020-04-29 0:12 ` Andrew Lunn
2020-04-29 4:16 ` Florian Fainelli
2020-05-01 3:56 ` David Miller
2020-05-01 3:56 ` [PATCH net-next v2 1/4] net: phy: bcm54140: use genphy_soft_reset() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200428230659.7754-3-michael@walle.cc \
--to=michael@walle.cc \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).