Date: Sun, 24 Oct 2010 23:22:34 +0200 From: Milan Obuch <freebsd-arm@dino.sk> To: Kristof Provost <kristof@sigsegv.be> Cc: freebsd-arm@freebsd.org Subject: Re: Guruplug Server Plus working to some extent... Message-ID: <201010242322.35909.freebsd-arm@dino.sk> In-Reply-To: <20101024111438.GA24690@nereid> References: <201010202309.40148.freebsd-arm@dino.sk> <201010212313.23283.freebsd-arm@dino.sk> <20101024111438.GA24690@nereid>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 24 October 2010 13:14:38 Kristof Provost wrote: > On 2010-10-21 23:13:21 (+0200), Milan Obuch <freebsd-arm@dino.sk> wrote: > > Also, when I put mge1's ethernet link address (MAC) into .dts file, it is > > initialised with this value, as expected. But nothing else changed - > > receiving frames works, sending does not. > > > > Maybe it's time for some mge's source tweaking, but I have absolutelly no > > idea where to begin. > > I suspect the PHY asignment. The current code tries to retrieve the PHY > number from the dts but then probes for PHYs and uses the first one. > Well, it may be. I am no expert in this area, but what I do not understand is how bad PHY assignment could affect sending frames but nor receiving. I would expect with wrong assignment failing both, but, again, I am no expert here... > Can you try the following patch? I unfortunately don't have hardware > with two PHYs. > Make sure you have the correct phy number set for mge1 (probably just > 0x1) in your dts. > > It's probably not a final solution though as it relies on the dts for > information which can be probed automatically. > > Index: dev/mge/if_mge.c > =================================================================== > --- dev/mge/if_mge.c (revision 214256) > +++ dev/mge/if_mge.c (working copy) > @@ -626,7 +626,6 @@ > mge_attach(device_t dev) > { > struct mge_softc *sc; > - struct mii_softc *miisc; > struct ifnet *ifp; > uint8_t hwaddr[ETHER_ADDR_LEN]; > int i, error, phy; > @@ -717,8 +716,7 @@ > sc->mii = device_get_softc(sc->miibus); > > /* Tell the MAC where to find the PHY so autoneg works */ > - miisc = LIST_FIRST(&sc->mii->mii_phys); > - MGE_WRITE(sc, MGE_REG_PHYDEV, miisc->mii_phy); > + MGE_WRITE(sc, MGE_REG_PHYDEV, phy); > > /* Attach interrupt handlers */ > for (i = 0; i < 2; ++i) { > Thanks for patch, but behavior did not changed. I played with .dts definition for second port a bit, but it was a bit guesswork, and everytime receiving frames worked and sending frames did not. I did not found good description of .dts or the one I really understand details there :( Milan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010242322.35909.freebsd-arm>