Subject: kern/20638: DP83815 driver probably needs patch released by Nat. Semiconductor
To: None <gnats-bugs@gnats.netbsd.org>
From: seebs <seebs@vash.cel.plethora.net>
List: netbsd-bugs
Date: 03/09/2003 08:40:19
>Number:         20638
>Category:       kern
>Synopsis:       Nat. Semiconductor released a patch for the 83815 driver for linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 09 08:41:03 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     seebs
>Release:        NetBSD 1.6P
>Organization:
	
>Environment:
System: NetBSD vash.cel.plethora.net 1.6P NetBSD 1.6P (VASH) #1: Fri Feb 28 22:14:13 CST 2003 seebs@vash.cel.plethora.net:/usr/src/sys/arch/i386/compile/VASH i386
Architecture: i386
Machine: i386
>Description:
	There's a National Semiconductor patch for the Linux 83815 driver
	(sip(4) in NetBSD) which we may or may not need; I can't find any
	of the magic numbers from it in sip(4), so we probably need it.

>How-To-Repeat:
	Poke around soekris.com, and find out that some of their boards are
	affected.

>Fix:
	http://www.soekris.com/Issue0002.htm

	gives the following patch, written against the linux driver:

    // Add by Bruce to do the PHY coefficient check
    if( !(phy_status & DP_PHYSTS_SPEED_10)){
	    DP_REG32_WRITE(DP_PHY_PAGE, DP_PHY_PAGE_VAL);
	    tmpVal = DP_REG32_READ(DP_PHY_DSPCFG);
	    tmpVal &= 0xFFF;
	    DP_REG32_WRITE(DP_PHY_DSPCFG,(tmpVal | 0x1000));
	    udelay(100);
	    tmpVal = DP_REG32_READ(DP_PHY_TDATA);
	    tmpVal &= 0x00FF;
	    if( !(tmpVal &0x0080) || ((tmpVal >=0x00D8)&&(tmpVal <= 0x00FF))){
		    DP_REG32_WRITE(DP_PHY_TDATA,0x00E8);
		    tmpVal = DP_REG32_READ(DP_PHY_DSPCFG);
		    DP_REG32_WRITE(DP_PHY_DSPCFG,(tmpVal | 0x0020));
	    }
    	    DP_REG32_WRITE(DP_PHY_PAGE,0);
    }
	
	Of course, this doesn't say *when* to do the check, but the site
	says "The check has to be done every time the chip's physical
	interface is reset and a 100base-TX link is detected, so the code will
	needed to be added at the right point the the drivers physical layer
	handling code."

I don't understand the driver enough to say where this should go; I'm just
passing it on.  :)

-s
>Release-Note:
>Audit-Trail:
>Unformatted: