NetBSD Problem Report #8382
Received: (qmail 27817 invoked from network); 12 Sep 1999 13:52:33 -0000
Message-Id: <19990912134221.10094.qmail@mailhost.dave.dtsp.co.nz>
Date: 12 Sep 1999 13:42:21 -0000
From: dave@dtsp.co.nz
Reply-To: dave@dtsp.co.nz
To: gnats-bugs@gnats.netbsd.org
Cc: dave@dtsp.co.nz
Subject: MII based real 21140's fail under new tlp driver
X-Send-Pr-Version: 3.95
>Number: 8382
>Category: kern
>Synopsis: MII based real 21140's fail under new tlp driver
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: thorpej
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Sep 12 07:05:01 +0000 1999
>Closed-Date: Sat Sep 25 00:33:54 +0000 1999
>Last-Modified: Sat Sep 25 00:34:07 +0000 1999
>Originator: Dave Sainty
>Release: 19990912
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Environment:
>Description:
The new driver support for PHYs on the SIO on a real DEC 21140 (and
others) is incorrect. The main problem is that the direction bit is
generally inverted, but also the timing seems to be slightly incorrect
based on the DP83840 data sheets.
>How-To-Repeat:
Hack around on the new driver. Frown as the driver appears to have no
knowledge of the cards PHY.
>Fix:
Apply this patch, after which the driver correctly detects my nsphy
and in fact the network card becomes functional! (relies on other
changes not included here, and the extent of the functionalty is not
well tested)
--- tulip.c.orig Sun Sep 12 13:35:56 1999
+++ tulip.c Mon Sep 13 01:22:37 1999
@@ -2349,7 +2349,7 @@
u_int32_t miirom;
int i;
- miirom = MIIROM_MIIDIR|MIIROM_MDO;
+ miirom = MIIROM_MDO;
MII_EMIT(sc, miirom);
for (i = 0; i < 32; i++) {
@@ -2371,7 +2371,7 @@
{
u_int32_t miirom, i;
- miirom = MIIROM_MIIDIR;
+ miirom = 0;
MII_EMIT(sc, miirom);
for (i = 1 << (nbits - 1); i != 0; i >>= 1) {
@@ -2405,25 +2405,27 @@
tlp_sio_mii_sendbits(sc, phy, 5);
tlp_sio_mii_sendbits(sc, reg, 5);
- MII_EMIT(sc, MIIROM_MIIDIR);
- MII_EMIT(sc, MIIROM_MIIDIR|MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR); /* Direction is input, no clock transition */
- MII_EMIT(sc, 0);
- MII_EMIT(sc, MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR|MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR);
err = TULIP_ISSET(sc, CSR_MIIROM, MIIROM_MDI);
- MII_EMIT(sc, 0);
- MII_EMIT(sc, MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR|MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR);
for (i = 0; i < 16; i++) {
val <<= 1;
- MII_EMIT(sc, 0);
+ /* Read data prior to clock low-high transition */
if (err == 0 && TULIP_ISSET(sc, CSR_MIIROM, MIIROM_MDI))
val |= 1;
- MII_EMIT(sc, MIIROM_MDC);
+
+ MII_EMIT(sc, MIIROM_MIIDIR|MIIROM_MDC);
+ MII_EMIT(sc, MIIROM_MIIDIR);
}
+ /* Direction is output, no clock transition */
MII_EMIT(sc, 0);
return (err ? 0 : val);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->thorpej
Responsible-Changed-By: hwr
Responsible-Changed-When: Sun Sep 12 08:10:29 PDT 1999
Responsible-Changed-Why:
Jason should know this best.
State-Changed-From-To: open->closed
State-Changed-By: thorpej
State-Changed-When: Fri Sep 24 17:33:54 PDT 1999
State-Changed-Why:
21140 supportd now, thanks!
>Unformatted:
System: NetBSD tequila.dave.dtsp.co.nz 1.4K NetBSD 1.4K (TEQUILA) #6: Sat Sep 4 14:24:13 NZST 1999 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userB/u2/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.