Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii Fix a bug that atphy(4) doesn't work with Attans...
details: https://anonhg.NetBSD.org/src/rev/1e1d92ffd1d6
branches: trunk
changeset: 745833:1e1d92ffd1d6
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Mar 13 18:57:49 2020 +0000
description:
Fix a bug that atphy(4) doesn't work with Attansic L2 rev. 1.
Reported by Rocky Hotas.
- On ASUS M2N-MX SE Plus (NVIDIA MCP61 with Attansic L2 rev. 1), changing
debug port 0x29's value makes the next PHY read fail with error. Read any
register to ignore this problem if the PHY is Attansic L2 revision 1.
I don't know if this problem is from L2 rev. 1 itself or from the
combination because I have only one machine which has L2 rev. "1".
At least, ASUS eee pc 900 (Attansic L2 rev. "2") has no this problem.
- Add comment. AR8021 document has no description about the power saving
control register(debug port 0x29).
- Add comment. AR8031 document says the lower 14 bits are reserved and the
default value is 0x36d0. Shouldn't we clear those bits?
- I have no document neither L1(F1) nor L2(F2), so I don't know whether the
debug port access is correct or not.
Tested with the following machines:
- ASUS P5B SE, L1 rev. 5, age(4)
- ASUS K50IJ, L1 rev. 9, ale(4)
- ASUS eee pc 900, L2 rev. 2, lii(4)
- ASUS M2N-MX SE Plus, L2 rev. 1, nfe(4)
- Intel DP55WB, 82578(AR8021 rev. 2), wm(4)
- Dell inspiron 14z, AR0835 rev. 9, alc(4)
diffstat:
sys/dev/mii/atphy.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r bb502e827028 -r 1e1d92ffd1d6 sys/dev/mii/atphy.c
--- a/sys/dev/mii/atphy.c Fri Mar 13 18:17:40 2020 +0000
+++ b/sys/dev/mii/atphy.c Fri Mar 13 18:57:49 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $ */
+/* $NetBSD: atphy.c,v 1.29 2020/03/13 18:57:49 msaitoh Exp $ */
/* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */
/*-
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.28 2020/03/13 04:44:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.29 2020/03/13 18:57:49 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -404,10 +404,30 @@
uint16_t reg;
int i;
- /* Take PHY out of power down mode. */
+ /*
+ * Take PHY out of power down mode.
+ *
+ * XXX AR8021 document has no description about the power saving
+ * control register. Shouldn't we write it?
+ */
PHY_WRITE(sc, 29, 0x29);
+ /*
+ * XXX AR8031 document says the lower 14 bits are reserved and the
+ * default value is 0x36d0. Shouldn't we clear those bits?
+ * I have no document neither L1(F1) nor L2(F2).
+ */
PHY_WRITE(sc, 30, 0);
+ if ((sc->mii_mpd_model == MII_MODEL_ATTANSIC_L2)
+ && (sc->mii_mpd_rev == 1)) {
+ /*
+ * On NVIDIA MCP61 with Attansic L2 rev. 1, changing debug
+ * port 0x29's value makes the next PHY read fail with error.
+ * This is observed on ASUS M2N-MX SE Plus. Read any register
+ * to ignore this problem.
+ */
+ (void)PHY_READ(sc, ATPHY_SCR, ®);
+ }
PHY_READ(sc, ATPHY_SCR, ®);
/* Enable automatic crossover. */
reg |= ATPHY_SCR_AUTO_X_MODE;
Home |
Main Index |
Thread Index |
Old Index