aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2021-06-22 14:48:10 +0100
committerMichael Brown <mcb30@ipxe.org>2021-06-24 12:36:46 +0100
commit5622575c5e4bffb07307f39903bb95caad7d172d (patch)
tree3bb74d96b17d6807ecfe4cdd8298fdf3a1149c20 /src/drivers
parent0688114ea63fee21c39d94cc8df9e2a5003ac283 (diff)
downloadipxe-5622575c5e4bffb07307f39903bb95caad7d172d.zip
ipxe-5622575c5e4bffb07307f39903bb95caad7d172d.tar.gz
ipxe-5622575c5e4bffb07307f39903bb95caad7d172d.tar.bz2
[realtek] Work around hardware bug on RTL8211Brealtek_hack
The RTL8211B seems to have a bug that prevents the link from coming up unless the MII_MMD_DATA register is cleared. The Linux kernel driver applies this workaround (in rtl8211b_resume()) only to the specific RTL8211B PHY model, along with a matching workaround to set bit 9 of MII_MMD_DATA when suspending the PHY. Since we have no need to ever suspend the PHY, and since writing a zero ought to be harmless, we just clear the register unconditionally. Debugged-by: Nikolay Pertsev <nikolay.p@cos.flag.org> Tested-by: Nikolay Pertsev <nikolay.p@cos.flag.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/realtek.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/net/realtek.c b/src/drivers/net/realtek.c
index 0af3416..a43efb6 100644
--- a/src/drivers/net/realtek.c
+++ b/src/drivers/net/realtek.c
@@ -420,6 +420,16 @@ static int realtek_phy_reset ( struct realtek_nic *rtl ) {
*/
}
+ /* Some cards (e.g. RTL8211B) have a hardware errata that
+ * requires the MII_MMD_DATA register to be cleared before the
+ * link will come up.
+ */
+ if ( ( rc = mii_write ( &rtl->mii, MII_MMD_DATA, 0 ) ) != 0 ) {
+ /* Ignore failures, since the register may not be
+ * present on all PHYs.
+ */
+ }
+
/* Restart autonegotiation */
if ( ( rc = mii_restart ( &rtl->mii ) ) != 0 ) {
DBGC ( rtl, "REALTEK %p could not restart MII: %s\n",