From owner-freebsd-stable@FreeBSD.ORG Tue Dec 29 00:38:49 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50036106568B for ; Tue, 29 Dec 2009 00:38:49 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 2E96D8FC0A for ; Tue, 29 Dec 2009 00:38:51 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so2319060qwb.7 for ; Mon, 28 Dec 2009 16:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Xz39dzCrNDqMit8IB/lNbk7DGgEeB59dQ4fiXagUbrQ=; b=BawEVm82aETKBRoO7Mn8j8FrhQ8i0q7eLclWkxMbwsCMn+ES1FVzxSA4RyLTuPw78B 7F1iwggLokjYFXy7gNFHZ3X9oxePHKk3ezyY6tPOoiR/Wg1ZAa16AitWumgW4ZcnoNVn Fbsj33aX0/9+IpCZ4O1YH+gAQfcktko168pdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=PDSGWqE0M3Kw4Kx8P+mVrI4osD91ZVy3N1IuWn+cNC8TzXP6BJAptrJ6IsNAqRwyL8 mvlZ9m36GhY9koRhrKi4EBXoBgOJR4FUliiz4i3JrGbTlipXTP/PGQ8SYv2j2V1Zg82y 5UXv5Pq+1RpPXGfumLHjMwNDKzgInEi3oJ6Sg= Received: by 10.224.106.3 with SMTP id v3mr7773281qao.243.1262047125976; Mon, 28 Dec 2009 16:38:45 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 23sm10883207qyk.3.2009.12.28.16.38.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Dec 2009 16:38:44 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 28 Dec 2009 16:37:35 -0800 From: Pyun YongHyeon Date: Mon, 28 Dec 2009 16:37:35 -0800 To: Olivier Cochard-Labb? Message-ID: <20091229003735.GD1166@michelle.cdnetworks.com> References: <3131aa530912230507q5abd0a9eh1f22ac858518268f@mail.gmail.com> <20091224193320.GD8146@michelle.cdnetworks.com> <3131aa530912281330t34032ad5he5fe7720b4d2744a@mail.gmail.com> <20091228222140.GC1166@michelle.cdnetworks.com> <3131aa530912281622v3a4a15c5r38766eed989ff30e@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <3131aa530912281622v3a4a15c5r38766eed989ff30e@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: stable@freebsd.org Subject: Re: FreeBSD 8.0: can't PXE Boot using nvidia nForce4 network card X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2009 00:38:49 -0000 --8GpibOaaTibBMecb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 29, 2009 at 01:22:40AM +0100, Olivier Cochard-Labb? wrote: > On Mon, Dec 28, 2009 at 11:21 PM, Pyun YongHyeon wrote: > > > Ok, it seems Linux forcedeth driver seems to poke NFE_STATUS > > register before accessing PHY. I'm not sure whether this code could > > be related with the issue but would you try attached patch? > > > > Allready a patch to try! Thanks for your reactivity! > > The patch was applyed successfully and new kernel compiled/installed > without problem but same error message: > > FreeBSD 8.0-STABLE #4: Mon Dec 28 23:48:36 CET 2009 > root@debugger.bsdrp.net:/usr/obj/usr/src/sys/GENERIC i386 > (...) > nfe0: irq 21 at device > 10.0 on pci0 > nfe0: Lazy allocation of 0x1000000 bytes rid 0x10 type 3 at 0x81000000 > nfe0: Reserved 0x1000000 bytes for rid 0x10 type 3 at 0x81000000 > nfe0: MII without any phy! > device_attach: nfe0 attach returned 6 > (...) > Trying to mount root from nfs:10.0.0.1:/usr/tftpboot > nfs_diskless: no interface > ROOT MOUNT ERROR: > (...) > :-( How about this one? Sorry, I'm just guessing(no hardware, no documentation). > Regards, > > Olivier --8GpibOaaTibBMecb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="nfe.CK804.diff2" Index: sys/dev/nfe/if_nfe.c =================================================================== --- sys/dev/nfe/if_nfe.c (revision 201135) +++ sys/dev/nfe/if_nfe.c (working copy) @@ -340,6 +340,7 @@ struct nfe_softc *sc; struct ifnet *ifp; bus_addr_t dma_addr_max; + uint32_t phystat, phyrestore; int error = 0, i, msic, reg, rid; sc = device_get_softc(dev); @@ -349,6 +350,7 @@ MTX_DEF); callout_init_mtx(&sc->nfe_stat_ch, &sc->nfe_mtx, 0); TASK_INIT(&sc->nfe_link_task, 0, nfe_link_task, sc); + phyrestore = 0; pci_enable_busmaster(dev); @@ -513,6 +515,8 @@ break; } + NFE_READ(sc, NFE_WOL_CTL); + NFE_WRITE(sc, NFE_WOL_CTL, 0); nfe_power(sc); /* Check for reversed ethernet address */ if ((NFE_READ(sc, NFE_TX_UNK) & NFE_MAC_ADDR_INORDER) != 0) @@ -599,6 +603,14 @@ ifp->if_capabilities |= IFCAP_POLLING; #endif + phystat = NFE_READ(sc, NFE_STATUS) & NFE_STATUS_RUNNING; + if ((phystat & NFE_STATUS_RUNNING) != 0) { + phystat &= ~NFE_STATUS_RUNNING; + NFE_WRITE(sc, NFE_STATUS, phystat); + phyrestore = 1; + } + NFE_WRITE(sc, NFE_PHY_STATUS, 0xf); + /* Do MII setup */ if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, nfe_ifmedia_sts)) { @@ -636,8 +648,11 @@ } fail: - if (error) + if (error) { + if (phyrestore != 0) + NFE_WRITE(sc, NFE_STATUS, phystat | NFE_STATUS_RUNNING); nfe_detach(dev); + } return (error); } @@ -2744,7 +2759,8 @@ NFE_WRITE(sc, NFE_SETUP_R6, NFE_R6_MAGIC); /* update MAC knowledge of PHY; generates a NFE_IRQ_LINK interrupt */ - NFE_WRITE(sc, NFE_STATUS, sc->mii_phyaddr << 24 | NFE_STATUS_MAGIC); + NFE_WRITE(sc, NFE_STATUS, sc->mii_phyaddr << NFE_STATUS_PHYSHIFT | + NFE_STATUS_PHYVALID | NFE_STATUS_RUNNING); NFE_WRITE(sc, NFE_SETUP_R4, NFE_R4_MAGIC); NFE_WRITE(sc, NFE_WOL_CTL, NFE_WOL_MAGIC); Index: sys/dev/nfe/if_nfereg.h =================================================================== --- sys/dev/nfe/if_nfereg.h (revision 201135) +++ sys/dev/nfe/if_nfereg.h (working copy) @@ -137,7 +137,11 @@ #define NFE_PHY_BUSY 0x08000 #define NFE_PHYADD_SHIFT 5 -#define NFE_STATUS_MAGIC 0x140000 +#define NFE_STATUS_START 0x00000002 +#define NFE_STATUS_LINKUP 0x00000004 +#define NFE_STATUS_PHYVALID 0x00040000 +#define NFE_STATUS_RUNNING 0x00100000 +#define NFE_STATUS_PHYSHIFT 24 #define NFE_R1_MAGIC_1000 0x14050f #define NFE_R1_MAGIC_10_100 0x16070f --8GpibOaaTibBMecb--