Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2010 09:47:23 -0800
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        Oliver Fromme <olli@lurza.secnetix.de>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: bge(4), 5715S, IBM BladeCenter, no carrier
Message-ID:  <20100114174723.GV1228@michelle.cdnetworks.com>
In-Reply-To: <201001141604.o0EG4Vx8067123@lurza.secnetix.de>
References:  <20100113194647.GO1228@michelle.cdnetworks.com> <201001141604.o0EG4Vx8067123@lurza.secnetix.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--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: <Broadcom NetXtreme Gigabit Fiber Controller, ASIC rev. 0x009003> 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: <MII bus> on bge0
> brgphy0: <BCM5714 10/100/1000baseTX PHY> 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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
> 	capabilities=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
> 	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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100114174723.GV1228>