From owner-freebsd-arm@FreeBSD.ORG Sun Oct 24 21:22:44 2010 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46471106566C for ; Sun, 24 Oct 2010 21:22:44 +0000 (UTC) (envelope-from freebsd-arm@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id 090418FC21 for ; Sun, 24 Oct 2010 21:22:43 +0000 (UTC) Received: from door.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: PLAIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by loki.netlab.sk with esmtp; Sun, 24 Oct 2010 23:23:47 +0200 id 00033C0A.4CC4A3E3.0000BA41 From: Milan Obuch To: Kristof Provost Date: Sun, 24 Oct 2010 23:22:34 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.5.2; i386; ; ) References: <201010202309.40148.freebsd-arm@dino.sk> <201010212313.23283.freebsd-arm@dino.sk> <20101024111438.GA24690@nereid> In-Reply-To: <20101024111438.GA24690@nereid> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010242322.35909.freebsd-arm@dino.sk> Cc: freebsd-arm@freebsd.org Subject: Re: Guruplug Server Plus working to some extent... X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 21:22:44 -0000 On Sunday 24 October 2010 13:14:38 Kristof Provost wrote: > On 2010-10-21 23:13:21 (+0200), Milan Obuch 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