From owner-freebsd-current@FreeBSD.ORG Wed Sep 23 18:41:59 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B80B106568B for ; Wed, 23 Sep 2009 18:41:59 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from jacques.telenet-ops.be (jacques.telenet-ops.be [195.130.132.50]) by mx1.freebsd.org (Postfix) with ESMTP id 905048FC1D for ; Wed, 23 Sep 2009 18:41:58 +0000 (UTC) Received: from triton.sigsegv.be ([213.119.96.179]) by jacques.telenet-ops.be with bizsmtp id kJhw1c0093sCccd0JJhwZa; Wed, 23 Sep 2009 20:41:56 +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 346191C1E1; Wed, 23 Sep 2009 22:43:02 +0200 (CEST) Received: by nereid (sSMTP sendmail emulation); Wed, 23 Sep 2009 20:41:55 +0200 Date: Wed, 23 Sep 2009 20:41:54 +0200 From: Kristof Provost To: Pyun YongHyeon Message-ID: <20090923184149.GF19069@nereid> References: <20090922211012.GE19069@nereid> <20090922235350.GB1520@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090922235350.GB1520@michelle.cdnetworks.com> X-PGP-Fingerprint: 6B6E 5EED 8ECF FAE7 1F61 7458 5046 7D0E 11B0 0EE8 User-Agent: Mutt/1.5.14 (2007-03-31) Cc: current@freebsd.org Subject: Re: mge, mii/e1000phy X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 18:41:59 -0000 On 2009-09-22 16:53:50 (-0700), Pyun YongHyeon wrote: > On Tue, Sep 22, 2009 at 11:10:18PM +0200, Kristof Provost wrote: > > I've been trying to get CURRENT running on a TS-7800 [1]. > > It's based around a Marvell Orion SoC, with a Marvell 88E1118 PHY. > > > > It boots and tries to do bootpc_init. This fails because there are no > > packets coming in or going out. > > > > A few thing's I've noticed: > > - The PHY is misdetected as an 88E1116. Changing sys/dev/mii/miidevs so > > it's detected as the 88E1118 it really is doesn't help. > > Please show me the output of "devinfo -rv | grep phy". > A little difficult as I need networking to get the root file system. Instead I've got the content of the PHY ID 1 & 2 registers: mii_id1: 0x0141, mii_id2: 0x0e11 This seems to translate to a mii_model of 0x21, which corresponds to a 'Marvell 88E1116 Gigabit PHY' according to sys/dev/mii/miidevs. > > - sys/dev/mii/e1000phy.c appears to contain a bug: > > e1000phy_reset performs a switch on MII_MODEL(esc->mii_model) while > > the rest of the code just uses esc->mii_model. This seems to be wrong > > as the cases for 1118 (or 1116) are not triggered. Changing this also > > doesn't appear to help. > > It's not a bug. First, I have to see your PHY id to know why you > think so. > The switch on line 251 in e1000phy.c [1] is the only place the MII_MODEL macro is used. The rest of the file (even in an earlier switch in the same function) uses esc->mii_model directly. I've also confirmed the code falls into the default case instead of the case MII_MODEL_MARVELL_E1116 as I'd expect (because it detects the PHY as an E1116). The esc->mii_model value is already translated by MII_MODEL on line 147. > > - Forcing the mge driver to IFM_100_TX (in mge_set_port_serial_control) > > does work. The system manages to acquire a DHCP address. > > Would you also show me the output of "ifconfig -m mge0"? > What are you looking for? I can't run ifconfig obviously, but I can probably extract the required information with a few strategic printfs. > I'm not author of mge(4) so I'm not familiar with mge(4). But it > seems that mge(4) lacks link state change handler. Normally NICs > are required to reprogram MAC to match resolved speed/duplex/ > flow-control of link when it know it established a valid link which > is notified from mii(4). > If that's the case I'd expect the driver not to work on my Sheevaplug either. The only difference I see is the PHY. Thanks, Kristof [1] http://svn.freebsd.org/viewvc/base/head/sys/dev/mii/e1000phy.c?annotate=196366