Date: Mon, 28 Dec 2009 14:21:40 -0800 From: Pyun YongHyeon <pyunyh@gmail.com> To: Olivier Cochard-Labb? <olivier@cochard.me> Cc: stable@freebsd.org Subject: Re: FreeBSD 8.0: can't PXE Boot using nvidia nForce4 network card Message-ID: <20091228222140.GC1166@michelle.cdnetworks.com> In-Reply-To: <3131aa530912281330t34032ad5he5fe7720b4d2744a@mail.gmail.com> References: <3131aa530912230507q5abd0a9eh1f22ac858518268f@mail.gmail.com> <20091224193320.GD8146@michelle.cdnetworks.com> <3131aa530912281330t34032ad5he5fe7720b4d2744a@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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 <pyunyh@gmail.com> 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
[-- Attachment #2 --]
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091228222140.GC1166>
