From owner-freebsd-current@FreeBSD.ORG Thu Jan 14 17:48:16 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3721065670 for ; Thu, 14 Jan 2010 17:48:16 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE4C8FC22 for ; Thu, 14 Jan 2010 17:48:15 +0000 (UTC) Received: by qyk4 with SMTP id 4so11848841qyk.7 for ; Thu, 14 Jan 2010 09:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=mQpDYMEISCwsF+3x1/+Y6d4YF1aKH63r63ijFTrBRnE=; b=othow6ypM5yf3sg4WSCAL7eIhwI9LcenimrUPpqjNO10gsDaufosX3LDBfDaD9Z92S 6/yQ+Ud6lOicr80ZtACm7wIkwvtRuHjQXtjYufgHDPnSB2Ay9+n5Su3QGVIwJnOpsmtj kDJ55y6VCX+1jUJF1rAJsvrWSVXjtoTrVIvkY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Ol8TJp0HRWZef2iKc4WF+H05Y7OpJ59I3qL7WACKPyrpPiNWDCM0ABnYH3wqvoNmfP ySvxVRT/au22w1ANiU9BB7m95AHTJvLJahncS2p4H1R9klBBHY0SusmleCpY3M/BeHt3 lWQZ15cQfSfEJ+FVTGgbNajzqWAUFfuy2oAMk= Received: by 10.224.86.199 with SMTP id t7mr1069765qal.142.1263491284719; Thu, 14 Jan 2010 09:48:04 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 2sm2347575qwi.57.2010.01.14.09.48.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 09:48:03 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 14 Jan 2010 09:47:23 -0800 From: Pyun YongHyeon Date: Thu, 14 Jan 2010 09:47:23 -0800 To: Oliver Fromme Message-ID: <20100114174723.GV1228@michelle.cdnetworks.com> References: <20100113194647.GO1228@michelle.cdnetworks.com> <201001141604.o0EG4Vx8067123@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FEz7ebHBGB6b2e8X" Content-Disposition: inline In-Reply-To: <201001141604.o0EG4Vx8067123@lurza.secnetix.de> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@FreeBSD.ORG Subject: Re: bge(4), 5715S, IBM BladeCenter, no carrier X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 17:48:16 -0000 --FEz7ebHBGB6b2e8X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 14, 2010 at 05:04:31PM +0100, Oliver Fromme wrote: > Pyun YongHyeon wrote: > > On Wed, Jan 13, 2010 at 11:28:55AM -0800, Pyun YongHyeon wrote: > > > On Wed, Jan 13, 2010 at 08:02:10PM +0100, Oliver Fromme wrote: > > > > Hmm. Interestingly, I don't see any PHY in the verbose dmesg > > > > output from the 9-current driver. Maybe I should merge the > > > > brgphy driver from 9-current to the 8-stable machine, too. > > > > I'll try that tomorrow. > > > > > > I guess that wouldn't help. > > You were right, it didn't help. > > > > If bge(4) think it have to directly handle PHY without using mii(4) > > > it wouldn't use mii(4) such that you wouldn't see mii(4) related > > > message. > > > ATM bge(4) directly handles fiber PHYs under certain conditions as > > > em(4) does. em(4) does not use mii(4) at all so that wouldn't be > > > problem on em(4). But bge(4) also uses mii(4) so it only uses > > > mii(4) under certain cases. I don't like that behavior and would > > > like to remove that but it would require a lot of code to properly > > > handle link state changes. I still didn't fully understand the > > > complexity of link state handling used in driver. > > > [...] > > > You said controller has fiber PHY, but brgphy(4) incorrectly > > > think it has copper PHY. Maybe this is the real problem. I'll see > > > what can be done. > > > > Would you show me the output of "devinfo -rv | grep brgphy" and > > "pciconf -lcv" for your bge(4) controller? > > Ok, I've got more information. > > As a reminder, this is a 8-stable snapshot from December, > with if_bge and brgphy from 9-current as of today. > (In fact I just copied the whole mii directory, not just > brgphy.) > > The result is that there is no brgphy found at all, so > devinfo doesn't list it either. > > Next thing I did was to apply the patch from PR 122551 > because the problem description sounds somewhat similar > to what I have (though not identical). > > The result: Now a brgphy is found, but it lists only > copper media, not 1000baseSX. I'm pretty sure this is > a fiber PHY, though. So, still "no carrier". :-( > > Here's the information you requested (with the patch > from PR 122551) ... > > devinfo -rv: > > bge0 pnpinfo vendor=0x14e4 device=0x1679 subvendor=0x1014 subdevice=0x0367 class=0x020000 at slot=4 function=0 > Interrupt request lines: > 256 > I/O memory addresses: > 0x97a00000-0x97a0ffff > miibus0 > brgphy0 pnpinfo oui=0x818 model=0x34 rev=0x0 at phyno=1 > > pciconf -lcv: > > bge0@pci0:22:4:0: class=0x020000 card=0x03671014 chip=0x167914e4 rev=0xa3 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'NetXtreme 5715S Gigabit Ethernet' > class = network > subclass = ethernet > cap 07[40] = PCI-X 64-bit supports 133MHz, 2048 burst read, 1 split transaction > cap 01[48] = powerspec 2 supports D0 D3 current D0 > cap 03[50] = VPD > cap 05[58] = MSI supports 8 messages, 64 bit enabled with 1 message > > dmesg (verbose boot): > > bge0: mem 0x97a00000-0x97a0ffff,0x97a10000-0x97a1ffff irq 24 at device 4.0 on pci22 > bge0: Reserved 0x10000 bytes for rid 0x10 type 3 at 0x97a00000 > bge0: attempting to allocate 1 MSI vectors (8 supported) > msi: routing MSI IRQ 256 to local APIC 0 vector 56 > bge0: using IRQ 256 for MSI > bge0: CHIP ID 0x00009003; ASIC REV 0x09; CHIP REV 0x90; PCI-X > miibus0: on bge0 > brgphy0: PHY 1 on miibus0 > brgphy0: OUI 0x000818, model 0x0034, rev. 0 > brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto > bge0: bpf attached > bge0: Ethernet address: 00:21:5e:4c:07:22 > bge0: [MPSAFE] > bge0: [ITHREAD] > > ifconfig -m: > > bge0: flags=8843 metric 0 mtu 1500 > options=9b > capabilities=9b > ether 00:21:5e:4c:07:22 > inet xx.xx.xx.xx netmask 0xffffff00 broadcast xx.xx.xx.255 > media: Ethernet autoselect (none) > status: no carrier > supported media: > media autoselect > media 1000baseT mediaopt full-duplex > media 1000baseT > media 100baseTX mediaopt full-duplex > media 100baseTX > media 10baseT/UTP mediaopt full-duplex > media 10baseT/UTP > media none > Thanks for the information. Would you try attached patch? If the patch still reports 10/100/1000 copper PHY, try adding 'sc->mii_flags |= MIIF_HAVEFIBER' to force setting MIIF_HAVEFIBER flag in brgphy.c:brgphy_attach. > Actually, the blade (its an IBM BladeCenter HS22) contains > four NICs: two bge(4) and two bce(4). All of them are > fiber (1000baseSX). None of them work. I can open a new > thread for the bce(4) issue, but first I would prefer to > get the bge(4) interfaces working. > Ok, let's fix bge(4) first. --FEz7ebHBGB6b2e8X Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="bge.BCM5715S.diff" Index: sys/dev/bge/if_bgereg.h =================================================================== --- sys/dev/bge/if_bgereg.h (revision 202268) +++ sys/dev/bge/if_bgereg.h (working copy) @@ -2603,6 +2603,7 @@ #define BGE_FLAG_JUMBO 0x00000002 #define BGE_FLAG_WIRESPEED 0x00000004 #define BGE_FLAG_EADDR 0x00000008 +#define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c (revision 202268) +++ sys/dev/bge/if_bge.c (working copy) @@ -902,7 +902,8 @@ mii = device_get_softc(sc->bge_miibus); BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); else BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); @@ -1783,13 +1784,20 @@ if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | + BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | + BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | + BGE_MACMODE_FRMHDR_DMA_ENB; + + if (sc->bge_flags & BGE_FLAG_TBI) + val |= BGE_PORTMODE_TBI; + else if (sc->bge_flags & BGE_FLAG_MII_SERDES) + val |= BGE_PORTMODE_GMII; + else + val |= BGE_PORTMODE_MII; + /* Turn on DMA, clear stats */ - CSR_WRITE_4(sc, BGE_MAC_MODE, BGE_MACMODE_TXDMA_ENB | - BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | - BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | - BGE_MACMODE_TX_STATS_ENB | BGE_MACMODE_FRMHDR_DMA_ENB | - ((sc->bge_flags & BGE_FLAG_TBI) ? - BGE_PORTMODE_TBI : BGE_PORTMODE_MII)); + CSR_WRITE_4(sc, BGE_MAC_MODE, val); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2851,12 +2859,14 @@ hwcfg = ntohl(hwcfg); } - if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) - sc->bge_flags |= BGE_FLAG_TBI; - /* The SysKonnect SK-9D41 is a 1000baseSX card. */ - if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41) - sc->bge_flags |= BGE_FLAG_TBI; + if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == + SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { + if (BGE_IS_5714_FAMILY(sc)) + sc->bge_flags |= BGE_FLAG_MII_SERDES; + else + sc->bge_flags |= BGE_FLAG_TBI; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, Index: sys/dev/mii/brgphy.c =================================================================== --- sys/dev/mii/brgphy.c (revision 202269) +++ sys/dev/mii/brgphy.c (working copy) @@ -197,6 +197,7 @@ case MII_OUI_xxBROADCOM: switch (bsc->mii_model) { case MII_MODEL_xxBROADCOM_BCM5706: + case MII_MODEL_xxBROADCOM_BCM5714: /* * The 5464 PHY used in the 5706 supports both copper * and fiber interfaces over GMII. Need to check the --FEz7ebHBGB6b2e8X--