From owner-freebsd-current@FreeBSD.ORG Tue Mar 13 00:43:49 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E4A416A418 for ; Tue, 13 Mar 2007 00:43:49 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6C313C469 for ; Tue, 13 Mar 2007 00:43:48 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so1527448ana for ; Mon, 12 Mar 2007 17:43:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=UBZx/xkFfkw8UCOJapJrPyc1sq8+2trH6KiXkOAq8LWZZiGuPyMK+/0YNMoILiuHXQX7DfLZ8zmejA+bniF9QJ6EzxJNhRPV7et1I/QsFmgVa7EGhPS159NUKtxNzaatYFqp6abqGi18w6zwx3OBW34n8sOBLQqaAZiJcs7ewjQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=p4uE5CV+wmQQY7RfY0ksNUpiyJepaftL0MaKL6y6nmyOnir44Ck66uBc2/xWsJ85gZwtxEcNXwm+CkMLceaAHqq3AWLYG/Bir0JtPutzgJgLKDZr36XlSMufaGDy3UnvieCdXWW77aYLnouIKn5xflssdULWvffo8MKoBZV1KpY= Received: by 10.115.77.1 with SMTP id e1mr2150327wal.1173746627395; Mon, 12 Mar 2007 17:43:47 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTP id m26sm18145959pof.2007.03.12.17.43.45; Mon, 12 Mar 2007 17:43:46 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id l2D0k2gk088542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Mar 2007 09:46:02 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id l2D0k1NP088541; Tue, 13 Mar 2007 09:46:01 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Tue, 13 Mar 2007 09:46:01 +0900 From: Pyun YongHyeon To: Rainer Hurling Message-ID: <20070313004601.GA87608@cdnetworks.co.kr> References: <20070310074734.GC70613@cdnetworks.co.kr> <917080.87242.qm@web34701.mail.mud.yahoo.com> <20070311050627.GC79728@cdnetworks.co.kr> <45F3B94B.3030104@gwdg.de> <20070312045116.GA83433@cdnetworks.co.kr> <45F5C914.3000805@gwdg.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <45F5C914.3000805@gwdg.de> User-Agent: Mutt/1.4.2.1i Cc: darren780@yahoo.com, freebsd-current@freebsd.org Subject: Re: yongari nfe problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2007 00:43:49 -0000 --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 12, 2007 at 10:41:40PM +0100, Rainer Hurling wrote: > Pyun YongHyeon, thank you for reply. > > Sorry for the late answer, but I have been on business trip. > > Pyun YongHyeon schrieb: > >On Sun, Mar 11, 2007 at 09:09:47AM +0100, Rainer Hurling wrote: > > > Pyun YongHyeon schrieb: > > > >[... SNIP ...] > > > > > > > >Did stock nfe(4) work on MCP55? > > > >(I'm not interested in how nve(4) works on MCP55.) > > > >I'm afraid MCP55 requires different programming. Searching archives > > > >for Linux forcedeth driver also reveals issues on MCP55 which is > > > >exactly the same issue I think. > > > >I'll let you know if I find a clue but it's hard to fix due to lack > > > >of MCP55 hardware and documentation. > > > > > > > > > Yes, nfe(4) works on MCP55, but with some strange behaviour, see below. > > > > > > I am working with FreeBSD 7.0-CURRENT from 03/07/2007 on MSI K9N Neo. > > > 'dmesg | grep nfe' gives me: > > > > > > nfe0: port 0xb000-0xb007 mem > > > 0xfbef7000-0xfbef7fff,0xfbefa800-0xfbefa8ff,0xfbefa400-0xfbefa40f irq 21 > > > at device 8.0 on pci0 > > > miibus0: on nfe0 > > > ukphy0: PHY 1 on miibus0 > > > ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, > > > 1000baseT-FDX, auto > > > nfe0: using obsoleted if_watchdog interface > > > nfe0: Ethernet address: xx:xx:xx:xx:xx:xx > > > nfe0: [ITHREAD] > > > > > > It seems that there is a problem with watchdog. Perhaps the choosen > > > media interface ukphy0 is not correct? > > > > > > >Normally nVidia GigEs use Marvell PHY which is served by e1000phy(4) > >so I guess power saving mode had ukphy attach the PHY. > >Booting/loading module with bootverbose mode will show up OUI/model/rev > >of the PHY. Please let me know the OUI/model/rev output of ukphy(4). > > for ukphy0 bootverbose gives me : > > OUI 0x0001c1 model 0x0002 rev. 0 > Hmm, it's gigabit PHY from Vitesse semiconductor. AFAIK there is no driver for the PHY but I guess ciphy(4) would be a possible driver for the PHY. I've checked Vitesse site for the PHY documentation but it seems they require a kind of NDA and it's not available option to me. Please try attached patch and rebuild miibus(4) and give it a spin. > > > > In the context with watchdog I observe an interesting behaviour of > > nfe0: > After running WindowsXP on my board, I am not able to use the > > interface > any more. Booting FreeBSD always gives me messages like this: > > > > > > ----- > > > nfe0: link state changed to DOWN > > > /etc/rc.d/dhclient: WARNING: $background_dhclient_nfe0 is not set > > > properly - > > > see > > > rc.conf(5). > > > nfe0: no link ....nfe0: link state changed to UP > > > got link > > > DHCPREQUEST on nfe0 to 255.255.255.255 port 67 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPREQUEST on nfe0 to 255.255.255.255 port 67 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 5 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 9 > > > nfe0: link state changed to UP > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 14 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 18 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 9 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > nfe0: link state changed to UP > > > DHCPDISCOVER on nfe0 to 255.255.255.255 port 67 interval 6 > > > nfe0: watchdog timeout > > > nfe0: link state changed to DOWN > > > No DHCPOFFERS received. > > > Trying recorded lease xxx.xxx.xxx.xxx > > > nfe0: link state changed to UP > > > bound: renewal in 429590 seconds. > > > lo0: flags=8049 metric 0 mtu 16384 > > > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 > > > inet6 ::1 prefixlen 128 > > > inet 127.0.0.1 netmask 0xff000000 > > > nfe0: flags=8843 metric 0 mtu > > 1500 > > > options=2b > > > ether xx:xx:xx:xx:xx:xx > > > media: Ethernet autoselect (100baseTX ) > > > status: active > > > ----- > > > > > > When booting 'cold' (means full power down) FreeBSD is able to use > > > nfe(4) in the correct way. Also booting FreeBSD again after running > > > FreeBSD gives me no errors. Obviously WindowsXP does not clear up all > > > registers in MCP55 after leaving? > > > > > > >I think Windows put the NIC/PHY in sleep/power saving mode and nfe(4) > >will need a way to take PHY/NIC out of power down mode. > >Try a WIP version at the following URL. > > > >http://people.freebsd.org/~yongari/nfe/WIP/if_nfe.c > >http://people.freebsd.org/~yongari/nfe/WIP/if_nfereg.h > >http://people.freebsd.org/~yongari/nfe/WIP/if_nfevar.h > > > >Note, it's just guess work from the Linux driver and I just tested > >compilation. Due to lack of time/MCP55 hardware it's not easy for me > >to fix. > > I tried your fixes. Bingo, you are right! Now I am able to use nfe(4) > directly (without coldstart) after leaving from WindowsXP. > Great! Thank you for testing. > Thank you very much, > > Rainer Hurling > -- Regards, Pyun YongHyeon --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ciphy.patch" Index: miidevs =================================================================== RCS file: /home/ncvs/src/sys/dev/mii/miidevs,v retrieving revision 1.41 diff -u -r1.41 miidevs --- miidevs 21 Feb 2007 18:17:44 -0000 1.41 +++ miidevs 13 Mar 2007 00:42:49 -0000 @@ -67,6 +67,7 @@ oui TDK 0x00c039 TDK oui TI 0x080028 Texas Instruments oui XAQTI 0x00e0ae XaQti Corp. +oui VITESSE 0x0001c1 Vitesse Semiconductor oui MARVELL 0x005043 Marvell Semiconductor oui xxMARVELL 0x000ac2 Marvell Semiconductor @@ -135,6 +136,7 @@ /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY +model VITESSE VSC8601 0x0002 VSC8601 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY Index: ciphy.c =================================================================== RCS file: /home/ncvs/src/sys/dev/mii/ciphy.c,v retrieving revision 1.8 diff -u -r1.8 ciphy.c --- ciphy.c 2 Dec 2006 19:36:25 -0000 1.8 +++ ciphy.c 13 Mar 2007 00:42:49 -0000 @@ -91,6 +91,7 @@ MII_PHY_DESC(CICADA, CS8201), MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(VITESSE, VSC8601), MII_PHY_END }; @@ -339,7 +340,24 @@ static void ciphy_reset(struct mii_softc *sc) { + struct mii_data *mii; + uint16_t val; + mii = sc->mii_pdata; + if (strcmp(mii->mii_ifp->if_dname, "nfe") == 0) { + /* need to set for 2.5V RGMII for NVIDIA adapters */ + val = PHY_READ(sc, CIPHY_MII_ECTL1); + val &= ~(CIPHY_ECTL1_IOVOL | CIPHY_ECTL1_INTSEL); + val |= (CIPHY_IOVOL_2500MV | CIPHY_INTSEL_RGMII); + PHY_WRITE(sc, CIPHY_MII_ECTL1, val); + /* From Linux. */ + val = PHY_READ(sc, CIPHY_MII_AUXCSR); + val |= CIPHY_AUXCSR_MDPPS; + PHY_WRITE(sc, CIPHY_MII_AUXCSR, val); + val = PHY_READ(sc, CIPHY_MII_10BTCSR); + val |= CIPHY_10BTCSR_ECHO; + PHY_WRITE(sc, CIPHY_MII_10BTCSR, val); + } mii_phy_reset(sc); DELAY(1000); } --sm4nu43k4a2Rpi4c--