From owner-freebsd-arm@FreeBSD.ORG Sun Oct 24 11:25:10 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 CB8BF106564A for ; Sun, 24 Oct 2010 11:25:10 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from winston.telenet-ops.be (winston.telenet-ops.be [195.130.137.75]) by mx1.freebsd.org (Postfix) with ESMTP id 58F7D8FC1A for ; Sun, 24 Oct 2010 11:25:10 +0000 (UTC) Received: from juliette.telenet-ops.be (unknown [195.130.137.74]) by winston.telenet-ops.be (Postfix) with ESMTP id 51F6E31201 for ; Sun, 24 Oct 2010 13:14:43 +0200 (CEST) Received: from triton.sigsegv.be ([81.165.77.237]) by juliette.telenet-ops.be with bizsmtp id NbEh1f00357BtZ506bEhMW; Sun, 24 Oct 2010 13:14:41 +0200 Received: from nereid (nereid.neptune.sigsegv.be [IPv6:2001:470:c8f4:0:200:ff:fe00:8]) by triton.sigsegv.be (Postfix) with SMTP id 1C27D1C170; Sun, 24 Oct 2010 13:14:40 +0200 (CEST) Received: by nereid (sSMTP sendmail emulation); Sun, 24 Oct 2010 13:14:39 +0200 Date: Sun, 24 Oct 2010 13:14:38 +0200 From: Kristof Provost To: Milan Obuch Message-ID: <20101024111438.GA24690@nereid> References: <201010202309.40148.freebsd-arm@dino.sk> <20101021104352.588c6a5f@ernst.jennejohn.org> <201010211119.26731.freebsd-arm@dino.sk> <201010212313.23283.freebsd-arm@dino.sk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010212313.23283.freebsd-arm@dino.sk> X-PGP-Fingerprint: 6B6E 5EED 8ECF FAE7 1F61 7458 5046 7D0E 11B0 0EE8 User-Agent: Mutt/1.5.20 (2009-06-14) 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 11:25:10 -0000 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. 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) { Regards, Kristof