From owner-freebsd-stable@FreeBSD.ORG Thu Jul 3 02:02:00 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E33721065674 for ; Thu, 3 Jul 2008 02:02:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by mx1.freebsd.org (Postfix) with ESMTP id AB73D8FC17 for ; Thu, 3 Jul 2008 02:02:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so847422rvf.43 for ; Wed, 02 Jul 2008 19:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from :to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=0VRKDQBdLxoVbLQ1XEcUh5qKCNkMh8iuw1gg1KpAD3o=; b=XYwZgs/7QVZedwwd8XMY4frznFAECJMiYCpmvUJ7r3gV1jANKQncu5GGaQGyaEkmRZ z2CGebcmgNdJCarq83Ox7/8X6+iambd98ZpsWzPRA7QbQyZhxtSQV+DdjY/1jBvOOO7D ghloy84cRGSoBWbH5nfEu44dA+Q/YUPqVHnhc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Ko5RLF+3QShWnHRbj5jFszpNooHFtNhTthhHG5aHcaw0Ld97Ak9wLNzg4/keusBl4x /8edg3L0F53jc7gULpSTDyX5fcSOo0syj0Zp7t6w6kFbAY0FEHW0FmKlFk/U3Xr61AzT 3KcV9XXtxGw924E/mNVhgXUGJpMbivUKrRbgk= Received: by 10.141.69.12 with SMTP id w12mr4742605rvk.273.1215050520176; Wed, 02 Jul 2008 19:02:00 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id k2sm13213031rvb.4.2008.07.02.19.01.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Jul 2008 19:01:59 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id m631xo5n092407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Jul 2008 10:59:50 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m631xm19092406; Thu, 3 Jul 2008 10:59:48 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 3 Jul 2008 10:59:48 +0900 From: Pyun YongHyeon To: Krzysztof J?druczyk Message-ID: <20080703015948.GB92015@cdnetworks.co.kr> References: <1052423937.20080630135423@hot.pl> <20080701004855.GF83626@cdnetworks.co.kr> <486A07A4.1070406@hot.pl> <20080702010929.GA87933@cdnetworks.co.kr> <486C0E69.8020603@hot.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <486C0E69.8020603@hot.pl> User-Agent: Mutt/1.4.2.1i Cc: freebsd-stable@freebsd.org Subject: Re: Marvell Yukon 88E8062 - media selection problem 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: Thu, 03 Jul 2008 02:02:01 -0000 --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jul 03, 2008 at 01:25:29AM +0200, Krzysztof J?druczyk wrote: > Pyun YongHyeon pisze: > > Would you try attached patch? > >The patch is just for checking code path of fiber media. > > It's slightly better - some media gets detected, but looks weird to me > (and doesn't communicate with other machines on the switch): > > # ifconfig > msk0: flags=8802 metric 0 mtu 1500 > options=11a > ether 00:10:f3:0d:d6:45 > media: Ethernet autoselect (autoselect ) > status: active > msk1: flags=8802 metric 0 mtu 1500 > options=11a > ether 00:10:f3:0d:d6:46 > media: Ethernet autoselect (autoselect ) > status: active > > 'autoselect (autoselect )' doesn't seem right to me... > I guess I've clobbered extended address register. How about attached one? > I couldn't see any signs of interface being functional with neither ping > nor tcpdump... > There could be other issues in msk(4) for dual port controllers but let's focus on PHY issue first. > I tried the patch with 7.0-RELEASE-p2, -STABLE and -CURRENT kernels. > > I'm not sure how important is that, but I still can't force it to > 1000baseSX: > > # ifconfig msk0 media 1000baseSX > ifconfig: SIOCSIFMEDIA (media): Device not configured > I guess you may have to specify "mediaopt full-duplex" in the command. But I believe you should not manually set media type on gigabit environments. > > > >Btw, it looks like you have dual port controller, right? > > > Yes, this machine has dual gigabit ports: > http://www.nexcom.com/ProductModel.aspx?id=7541ac3e-ecfd-4008-83cd-52e1ababe6a8 > > Let me know if there is any info I could provide that would help making > this interface functional. > There are a copule of code path that applys to dual port controllers. For example MSI is not supported even though hardware actually support that feature. That would be next item to try. -- Regards, Pyun YongHyeon --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="e1000phy.fiber.patch2" --- sys/dev/mii/e1000phy.c.orig 2007-11-21 14:51:55.000000000 +0900 +++ sys/dev/mii/e1000phy.c 2008-07-03 10:46:06.000000000 +0900 @@ -148,10 +148,13 @@ esc->mii_model = MII_MODEL(ma->mii_id2); switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: - case MII_MODEL_MARVELL_E1112: if (PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK) sc->mii_flags |= MIIF_HAVEFIBER; break; + case MII_MODEL_MARVELL_E1112: + /* XXX Should have a way to get instance info. */ + sc->mii_flags |= MIIF_HAVEFIBER; + break; case MII_MODEL_MARVELL_E3082: /* 88E3082 10/100 Fast Ethernet PHY. */ sc->mii_anegticks = MII_ANEGTICKS; @@ -209,7 +212,7 @@ e1000phy_reset(struct mii_softc *sc) { struct e1000phy_softc *esc; - uint16_t reg; + uint16_t page, reg; esc = (struct e1000phy_softc *)sc; reg = PHY_READ(sc, E1000_SCR); @@ -217,13 +220,14 @@ reg &= ~E1000_SCR_AUTO_X_MODE; PHY_WRITE(sc, E1000_SCR, reg); if (esc->mii_model == MII_MODEL_MARVELL_E1112) { + page = PHY_READ(sc, E1000_EADR); /* Select 1000BASE-X only mode. */ PHY_WRITE(sc, E1000_EADR, 2); reg = PHY_READ(sc, E1000_SCR); reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); - PHY_WRITE(sc, E1000_EADR, 1); + PHY_WRITE(sc, E1000_EADR, page); } } else { switch (esc->mii_model) { @@ -472,8 +476,8 @@ else mii->mii_media_active |= IFM_10_T; } else { - if (ssr & E1000_SSR_1000MBS) - mii->mii_media_active |= IFM_1000_SX; + /* XXX Should have a way to tell IFM_1000_SX/IFM_1000_LX. */ + mii->mii_media_active |= IFM_1000_SX; } if (ssr & E1000_SSR_DUPLEX) --BOKacYhQ+x31HxR3--