From owner-freebsd-stable@FreeBSD.ORG Mon Dec 28 22:22:55 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 DCB1A1065672 for ; Mon, 28 Dec 2009 22:22:55 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id 8CADE8FC0C for ; Mon, 28 Dec 2009 22:22:55 +0000 (UTC) Received: by qyk6 with SMTP id 6so4547206qyk.3 for ; Mon, 28 Dec 2009 14:22:49 -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=3LCreISeJ/0D2Qg8SmB35HAq35q/ZzcxRuOn7QFDgt8=; b=NJe8y1Pqp3grurXgFFlkmyAXiOP9CxAaxQZ2WsUu67wIusmGkAwYVbVverUYsn9FYh NcrpgPfyFKDKWJdMU3n7IF3sN3V2ITfFEhcB6uX1dRrObKKJXFHxzzteRq1Effuz+cwi 1arm1lD+0dZ6yFnQAeO+ipnuCe+ffNwCfwjbc= 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=fIFzIgCnIFtEtkDI3BxynHTSl2Avz0n9XxY2CoJdaecskBCghuHBsiK8IWQzjxfWRm pcEKsOQ/O6RsUAb78w0M7ukEfHllQvBEt5rKPEawXpfxjPLr3ckords8S7abMX4bUjbm mp0j9oPD588sTLNnIFv4btRXhEYNgHqYsgDzo= Received: by 10.224.69.164 with SMTP id z36mr7717085qai.377.1262038969751; Mon, 28 Dec 2009 14:22:49 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 23sm10782705qyk.7.2009.12.28.14.22.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Dec 2009 14:22:48 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 28 Dec 2009 14:21:40 -0800 From: Pyun YongHyeon Date: Mon, 28 Dec 2009 14:21:40 -0800 To: Olivier Cochard-Labb? Message-ID: <20091228222140.GC1166@michelle.cdnetworks.com> References: <3131aa530912230507q5abd0a9eh1f22ac858518268f@mail.gmail.com> <20091224193320.GD8146@michelle.cdnetworks.com> <3131aa530912281330t34032ad5he5fe7720b4d2744a@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <3131aa530912281330t34032ad5he5fe7720b4d2744a@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: Mon, 28 Dec 2009 22:22:55 -0000 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 28, 2009 at 10:30:25PM +0100, Olivier Cochard-Labb? wrote: > On Thu, Dec 24, 2009 at 8:33 PM, Pyun YongHyeon wrote: > > >> nfe0: MII without any phy! > > ?^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Maybe this is the reason why you can't use NFS. > > If your BIOS has an option that disables management feature > > of ethernet controller try toggle the feature. > > > > Hi, > > I've disabled the "POST Check LAN Cable" in the BIOS: But still the > same "MII without any phy!" message. > 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? > Regards, > > Olivier --nFreZHaLTZJo0R7j Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="nfe.CK804.diff" 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); @@ -599,6 +601,13 @@ 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; + } + /* Do MII setup */ if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, nfe_ifmedia_sts)) { @@ -636,8 +645,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 +2756,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 --nFreZHaLTZJo0R7j--