From nobody@FreeBSD.org  Tue Apr  8 02:24:50 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9195F106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Apr 2008 02:24:50 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7ED628FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  8 Apr 2008 02:24:50 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m382OZZx090708
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 8 Apr 2008 02:24:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m382OZq5090707;
	Tue, 8 Apr 2008 02:24:35 GMT
	(envelope-from nobody)
Message-Id: <200804080224.m382OZq5090707@www.freebsd.org>
Date: Tue, 8 Apr 2008 02:24:35 GMT
From: Greg Himes <greg@laaco.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [bge] Broadcom 5715S no carrier on HP BL460c blade using 6.3-RELEASE 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         122551
>Category:       kern
>Synopsis:       [bge] Broadcom 5715S no carrier on HP BL460c blade using 6.3-RELEASE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 08 02:30:04 UTC 2008
>Closed-Date:    Thu Mar 11 01:42:17 UTC 2010
>Last-Modified:  Thu Mar 11 01:42:17 UTC 2010
>Originator:     Greg Himes
>Release:        6.3-RELEASE
>Organization:
CHL Design Group
>Environment:
FreeBSD mail2.laaco.net 6.3-RELEASE FreeBSD 6.3-RELEASE #10: Mon Apr  7 18:19:40 PDT 2008     greg@mail2.laaco.net:/usr/obj/usr/src/sys/LAACO  i386
>Description:
This problem appears to be similar to earlier bge problems on IBM blades.

System is an HP c-Class blade chassis using BL460c blades.  Each blade has a 
dual bce (Broadcom NetXtreme II BCM5708S) interface on-board, along with an 
add-on HP NC326m mezzanine board which appears as dual bge (Broadcom NetXtreme 
5715S) interfaces.

Both pairs of interfaces connect to HP Virtual Connect Modules to bring the 
connections out of the back of the chassis.  The bce interfaces work fine, 
but the bge interfaces show "no carrier", as shown here in the ifconfig output:

# ifconfig
bce0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=3b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
        ether 00:17:a4:77:00:06
        media: Ethernet autoselect (1000baseSX <full-duplex>)
        status: active
bce1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=3b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU>
        ether 00:17:a4:77:00:06
        media: Ethernet autoselect (1000baseSX <full-duplex>)
        status: active
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
        ether 00:17:a4:77:00:24
        media: Ethernet autoselect (none)
        status: no carrier
bge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
        ether 00:17:a4:77:00:26
        media: Ethernet autoselect (none)
        status: no carrier

Here is the dmesg info:

FreeBSD 6.3-RELEASE #10: Mon Apr  7 18:19:40 PDT 2008
    greg@mail2.laaco.net:/usr/obj/usr/src/sys/LAACO
module_register: module pci/bce already exists!
Module pci/bce failed to register: 17
module_register: module bce/miibus already exists!
Module bce/miibus failed to register: 17
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Xeon(R) CPU            5160  @ 3.00GHz (3000.12-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6f6  Stepping = 6
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x4e3bd<SSE3,RSVD2,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA>
  AMD Features=0x20000000<LM>
  AMD Features2=0x1<LAHF>
  Cores per package: 2
real memory  = 3487916032 (3326 MB)
avail memory = 3408941056 (3251 MB)
ACPI APIC Table: <HP     ProLiant>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
 cpu2 (AP): APIC ID:  6
 cpu3 (AP): APIC ID:  7
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
hptrr: HPT RocketRAID controller driver v1.1 (Apr  7 2008 18:19:28)
acpi0: <HP ProLiant> on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x908-0x90b on acpi0
acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 900
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
pcib0: <ACPI Host-PCI bridge> on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 2.0 on pci0
pci4: <ACPI PCI bus> on pcib1
pcib2: <ACPI PCI-PCI bridge> at device 0.0 on pci4
pci5: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> at device 0.0 on pci5
pci6: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> at device 0.0 on pci6
pci7: <ACPI PCI bus> on pcib4
bce0: <Broadcom NetXtreme II BCM5708 1000Base-SX (B2)> mem 0xfa000000-0xfbffffff irq 16 at device 0.0 on pci7
miibus0: <MII bus> on bce0
brgphy0: <BCM5708S 1000/2500BaseSX PHY> on miibus0
brgphy0:  1000baseSX-FDX, auto
bce0: Ethernet address: 00:17:a4:77:00:0a
bce0: ASIC (0x57081021); Rev (B2); Bus (PCI-X, 64-bit, 133MHz); F/W (0x01090605); Flags( )
pcib5: <ACPI PCI-PCI bridge> at device 1.0 on pci5
pci8: <ACPI PCI bus> on pcib5
pcib6: <ACPI PCI-PCI bridge> at device 0.3 on pci4
pci9: <ACPI PCI bus> on pcib6
pcib7: <ACPI PCI-PCI bridge> at device 3.0 on pci0
pci10: <ACPI PCI bus> on pcib7
pcib8: <PCI-PCI bridge> at device 0.0 on pci10
pci11: <PCI bus> on pcib8
pcib9: <PCI-PCI bridge> at device 4.0 on pci11
pci12: <PCI bus> on pcib9
ciss0: <HP Smart Array E200i> port 0x4000-0x40ff mem 0xfdb80000-0xfdbfffff,0xfdb70000-0xfdb77fff irq 18 at device 8.0 on pci11
ciss0: [GIANT-LOCKED]
pcib10: <ACPI PCI-PCI bridge> at device 4.0 on pci0
pci13: <ACPI PCI bus> on pcib10
ciss1: <HP Smart Array P400> port 0x5000-0x50ff mem 0xfdd00000-0xfddfffff,0xfdcf0000-0xfdcf0fff irq 19 at device 0.0 on pci13
ciss1: [GIANT-LOCKED]
pcib11: <ACPI PCI-PCI bridge> at device 5.0 on pci0
pci16: <ACPI PCI bus> on pcib11
pcib12: <ACPI PCI-PCI bridge> at device 0.0 on pci16
pci17: <ACPI PCI bus> on pcib12
bge0: <Broadcom BCM5715 A3, ASIC rev. 0x9003> mem 0xfdef0000-0xfdefffff,0xfdee0000-0xfdeeffff irq 18 at device 4.0 on pci17
bge0: Ethernet address: 00:17:a4:77:00:24
bge1: <Broadcom BCM5715 A3, ASIC rev. 0x9003> mem 0xfded0000-0xfdedffff,0xfdec0000-0xfdecffff irq 19 at device 4.1 on pci17
bge1: Ethernet address: 00:17:a4:77:00:26
pcib13: <ACPI PCI-PCI bridge> at device 6.0 on pci0
pci19: <ACPI PCI bus> on pcib13
isp0: <Qlogic ISP 2432 PCI FC-AL Adapter> port 0x6000-0x60ff mem 0xfdff0000-0xfdff3fff irq 19 at device 0.0 on pci19
isp0: [GIANT-LOCKED]
isp0: Board Type 2422, Chip Revision 0x2, resident F/W Revision 4.0.70
isp1: <Qlogic ISP 2432 PCI FC-AL Adapter> port 0x6400-0x64ff mem 0xfdfe0000-0xfdfe3fff irq 16 at device 0.1 on pci19
isp1: [GIANT-LOCKED]
isp1: Board Type 2422, Chip Revision 0x2, resident F/W Revision 4.0.70
pcib14: <ACPI PCI-PCI bridge> at device 7.0 on pci0
pci22: <ACPI PCI bus> on pcib14
pcib15: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib15
pcib16: <ACPI PCI-PCI bridge> at device 0.0 on pci2
pci3: <ACPI PCI bus> on pcib16
bce1: <Broadcom NetXtreme II BCM5708 1000Base-SX (B2)> mem 0xf6000000-0xf7ffffff irq 16 at device 0.0 on pci3
miibus1: <MII bus> on bce1
brgphy1: <BCM5708S 1000/2500BaseSX PHY> on miibus1
brgphy1:  1000baseSX-FDX, auto
bce1: Ethernet address: 00:17:a4:77:00:08
bce1: ASIC (0x57081021); Rev (B2); Bus (PCI-X, 64-bit, 133MHz); F/W (0x01090605); Flags( )
Timecounters tick every 1.000 msec
SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
SMP: AP CPU #3 Launched!

Here is selected pciconf -lv output:

# pciconf -lv
pcib4@pci6:0:0: class=0x060400 card=0x00000000 chip=0x01031166 rev=0xc3 hdr=0x01
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'BCM5715 Broadcom dual gigabit, pci bridge'
    class      = bridge
    subclass   = PCI-PCI
bce0@pci7:0:0:  class=0x020000 card=0x703b103c chip=0x16ac14e4 rev=0x12 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'NetXtreme II BCM5708S Gigabit Ethernet'
    class      = network
    subclass   = ethernet
pcib8@pci10:0:0:        class=0x060400 card=0x00000000 chip=0x01031166 rev=0xb4 hdr=0x01
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'BCM5715 Broadcom dual gigabit, pci bridge'
    class      = bridge
    subclass   = PCI-PCI
pcib12@pci16:0:0:       class=0x060400 card=0x00000000 chip=0x01031166 rev=0xb5 hdr=0x01
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'BCM5715 Broadcom dual gigabit, pci bridge'
    class      = bridge
    subclass   = PCI-PCI
bge0@pci17:4:0: class=0x020000 card=0x1707103c chip=0x167914e4 rev=0xa3 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'NetXtreme 5715S Gigabit Ethernet'
    class      = network
    subclass   = ethernet
bge1@pci17:4:1: class=0x020000 card=0x1707103c chip=0x167914e4 rev=0xa3 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'NetXtreme 5715S Gigabit Ethernet'
    class      = network
    subclass   = ethernet
pcib16@pci2:0:0:        class=0x060400 card=0x00000000 chip=0x01031166 rev=0xc3 hdr=0x01
    vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
    device     = 'BCM5715 Broadcom dual gigabit, pci bridge'
    class      = bridge
    subclass   = PCI-PCI
bce1@pci3:0:0:  class=0x020000 card=0x703b103c chip=0x16ac14e4 rev=0x12 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'NetXtreme II BCM5708S Gigabit Ethernet'
    class      = network
    subclass   = ethernet

Had same results with HP's 1Gb ethernet pass-thru modules.

Have tried manually setting the interfaces with ifconfig to 
1000baseSX full-duplex, but still no carrier.

bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
        ether 00:17:a4:77:00:24
        media: Ethernet 1000baseSX <full-duplex> (none)
        status: no carrier



>How-To-Repeat:

Install HP NC326m mezzanine board on BL460c blade. 
Boot 6.3-RELEASE.
Verify status:no carrier with ifconfig
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Tue Apr 8 20:47:21 UTC 2008 
Responsible-Changed-Why:  

looking like a phy problem 
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122551 

From: Greg Himes <greg@laaco.net>
To: bug-followup@FreeBSD.org, Greg Himes <greg@laaco.net>
Cc:  
Subject: Re: kern/122551: [bge] Broadcom 5715S no carrier on HP BL460c blade using 6.3-RELEASE
Date: Wed, 28 May 2008 15:42:38 -0700

 Same problem on 7.0-RELEASE
 
 

From: Katsushi Kobayashi <ikob@ni.aist.go.jp>
To: bug-followup@FreeBSD.org,
 greg@laaco.net
Cc:  
Subject: Re: kern/122551: [bge] Broadcom 5715S no carrier on HP BL460c blade using 6.3-RELEASE
Date: Sat, 14 Feb 2009 02:54:39 +0900

 --Apple-Mail-6-689925422
 Content-Type: text/plain;
 	charset=US-ASCII;
 	format=flowed;
 	delsp=yes
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 We have tried FreeBSD 7.1 on our new HP blade server as BL260c G5
 accommodating GbE i/f with Broafcom 5715S chipset. Unfortunately,
 the network interface did not come UP as the similar situation with  
 PR122551.
 We resolved the trouble with the attached patch. Our device attach  
 messages
 and PCI info are also attached.
 
 I hope this patch will help you.
 
 pciconf -lv
 pcib1@pci0:0:2:0:	class=0x060400 card=0x00000000 chip=0x65e28086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x4 Port 2'
      class      = bridge
      subclass   = PCI-PCI
 pcib3@pci0:0:3:0:	class=0x060400 card=0x00000000 chip=0x65e38086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x4 Port 3'
      class      = bridge
      subclass   = PCI-PCI
 pcib4@pci0:0:4:0:	class=0x060400 card=0x00000000 chip=0x65e48086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x4 Port 4'
      class      = bridge
      subclass   = PCI-PCI
 pcib5@pci0:0:5:0:	class=0x060400 card=0x00000000 chip=0x65e58086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x4 Port 5'
      class      = bridge
      subclass   = PCI-PCI
 pcib6@pci0:0:6:0:	class=0x060400 card=0x00000000 chip=0x65f98086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x8 Port 6-7'
      class      = bridge
      subclass   = PCI-PCI
 pcib7@pci0:0:7:0:	class=0x060400 card=0x00000000 chip=0x65e78086  
 rev=0x90 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(??) PCIe x4 Port 7'
      class      = bridge
      subclass   = PCI-PCI
 pcib8@pci0:0:30:0:	class=0x060401 card=0x31fe103c chip=0x244e8086  
 rev=0x92 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801 Family (ICH2/3/4/4/5/5/6/7/8/9,63xxESB) Hub  
 Interface to PCI Bridge'
      class      = bridge
      subclass   = PCI-PCI
 pcib2@pci0:2:0:0:	class=0x060400 card=0x00000000 chip=0x01031166  
 rev=0xb5 hdr=0x01
      vendor     = 'ServerWorks (Was: Reliance Computer Corp)'
      device     = 'BCM5715 Broadcom dual gigabit, pci bridge'
      class      = bridge
      subclass   = PCI-PCI
 bge0@pci0:3:4:0:	class=0x020000 card=0x703c103c chip=0x167914e4  
 rev=0xa3 hdr=0x00
      vendor     = 'Broadcom Corporation'
      device     = 'NetXtreme 5715S Gigabit Ethernet'
      class      = network
      subclass   = ethernet
 bge1@pci0:3:4:1:	class=0x020000 card=0x703c103c chip=0x167914e4  
 rev=0xa3 hdr=0x00
      vendor     = 'Broadcom Corporation'
      device     = 'NetXtreme 5715S Gigabit Ethernet'
      class      = network
      subclass   = ethernet
 
 pcib2: <ACPI PCI-PCI bridge> at device 0.0 on pci2
 pci3: <ACPI PCI bus> on pcib2
 bge0: <HP NC326i Dual Port PCI-E Gigabit Adapter, ASIC rev. 0x9003>  
 mem 0xfdff0000-0xfdffffff,0xfdfe0000-0xfdfeffff irq 16 at device 4.0  
 on pci3
 miibus0: <MII bus> on bge0
 brgphy0: <BCM5714 10/100/1000baseTX PHY> PHY 1 on miibus0
 brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,  
 1000baseT-FDX, auto
 bge0: Ethernet address: 00:22:64:04:53:ca
 bge0: [ITHREAD]
 bge1: <HP NC326i Dual Port PCI-E Gigabit Adapter, ASIC rev. 0x9003>  
 mem 0xfdfd0000-0xfdfdffff,0xfdfc0000-0xfdfcffff irq 17 at device 4.1  
 on pci3
 miibus1: <MII bus> on bge1
 brgphy1: <BCM5714 10/100/1000baseTX PHY> PHY 1 on miibus1
 brgphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,  
 1000baseT-FDX, auto
 bge1: Ethernet address: 00:22:64:04:53:cb
 bge1: [ITHREAD]
 
 
 ----
 Katsushi Kobayashi
 
 
 --Apple-Mail-6-689925422
 Content-Disposition: attachment;
 	filename=diff.txt
 Content-Type: text/plain;
 	x-unix-mode=0644;
 	name="diff.txt"
 Content-Transfer-Encoding: 7bit
 
 Index: sys/dev/bge/if_bgereg.h
 ===================================================================
 --- sys/dev/bge/if_bgereg.h	(revision 1)
 +++ sys/dev/bge/if_bgereg.h	(working copy)
 @@ -2533,6 +2533,9 @@
  #define	BGE_FLAG_JUMBO		0x00000002
  #define	BGE_FLAG_WIRESPEED	0x00000004
  #define	BGE_FLAG_EADDR		0x00000008
 +
 +#define	BGE_FLAG_MIISERDES	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 1)
 +++ sys/dev/bge/if_bge.c	(working copy)
 @@ -838,8 +838,11 @@
  	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 ||
 +                (sc->bge_flags & BGE_FLAG_MIISERDES))
 +	{
  		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII);
 +	}
  	else
  		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII);
  
 @@ -1719,8 +1722,8 @@
  	    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));
 +            ((sc->bge_flags & BGE_FLAG_TBI) ?
 +            BGE_PORTMODE_TBI : (sc->bge_flags & BGE_FLAG_MIISERDES ) ? BGE_PORTMODE_GMII : BGE_PORTMODE_MII));
  
  	/* Set misc. local control, enable interrupts on attentions */
  	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 @@ -2654,7 +2657,13 @@
  	}
  
  	if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
 -		sc->bge_flags |= BGE_FLAG_TBI;
 +        {
 +                if(sc->bge_flags & BGE_FLAG_5714_FAMILY){
 +                        sc->bge_flags |= BGE_FLAG_MIISERDES;
 +                } else {
 +                        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)
 @@ -3267,6 +3276,7 @@
  	if (cmd == POLL_AND_CHECK_STATUS)
  		if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
  		    sc->bge_chipid != BGE_CHIPID_BCM5700_B2) ||
 +			(sc->bge_flags & BGE_FLAG_MIISERDES) ||
  		    sc->bge_link_evt || (sc->bge_flags & BGE_FLAG_TBI))
  			bge_link_upd(sc);
  
 Index: sys/dev/mii/brgphy.c
 ===================================================================
 --- sys/dev/mii/brgphy.c	(revision 1)
 +++ sys/dev/mii/brgphy.c	(working copy)
 @@ -540,10 +540,21 @@
  				mii->mii_media_active |= IFM_NONE; break;
  			}
  		}
 +		 else if(bmsr & BRGPHY_BMSR_LINK){
 +			mii->mii_media_status |= IFM_ACTIVE;
 +		}
  	} else {
  		/* If serdes link is up, get the negotiated speed/duplex. */
  		if (bmsr & BRGPHY_BMSR_LINK) {
  			mii->mii_media_status |= IFM_ACTIVE;
 +			/* If autoneg enabled, read negotiated duplex settings */
 +			if (bmcr & BRGPHY_BMCR_AUTOEN) {
 +				val = PHY_READ(sc, BRGPHY_SERDES_ANAR) & PHY_READ(sc, BRGPHY_SERDES_ANLPAR);
 +				if (val & BRGPHY_SERDES_ANAR_FDX)
 +					mii->mii_media_active |= IFM_FDX;
 +				else
 +					mii->mii_media_active |= IFM_HDX;
 +			}
  		}
  
  		/* Check the link speed/duplex based on the PHY type. */
 @@ -619,6 +630,7 @@
  		/* Pause capability advertisement (pause capable & asymmetric) */
  		PHY_WRITE(sc, BRGPHY_MII_ANAR,
  	    	BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA |
 +		ANAR_X_FD | ANAR_X_HD | ANAR_FC | 0x0800 |
  	    	BRGPHY_ANAR_ASP | BRGPHY_ANAR_PC);
  	} else {
  		PHY_WRITE(sc, BRGPHY_SERDES_ANAR, BRGPHY_SERDES_ANAR_FDX |
 
 --Apple-Mail-6-689925422
 Content-Type: text/plain;
 	charset=US-ASCII;
 	format=flowed
 Content-Transfer-Encoding: 7bit
 
 
 
 
 --Apple-Mail-6-689925422--
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Mon Jan 18 20:32:13 UTC 2010 
State-Changed-Why:  
I've committed patch to address this(r202293, r202294). Would you 
try latest bge(4) and brgphy(4) in HEAD? 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Mon Jan 18 20:32:13 UTC 2010 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122551 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/122551: commit references a PR
Date: Thu, 21 Jan 2010 00:45:25 +0000 (UTC)

 Author: yongari
 Date: Thu Jan 21 00:45:12 2010
 New Revision: 202726
 URL: http://svn.freebsd.org/changeset/base/202726
 
 Log:
   MFC r202293:
     For controllers that has dual mode PHY(copper or fiber) interfaces
     over GMII, make sure to enable GMII. With this change brgphy(4) is
     used to handle the dual mode PHY. Since we still don't have a sane
     way to pass PHY specific information to mii(4) layer special
     handling is needed in brgphy(4) to determine which mode of PHY was
     configured in parent interface.
     This change make BCM5715S work.
   
     Tested by:	olli
     Obtained from:	OpenBSD
     PR:	kern/122551
 
 Modified:
   stable/8/sys/dev/bge/if_bge.c
   stable/8/sys/dev/bge/if_bgereg.h
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/dev/bge/if_bge.c
 ==============================================================================
 --- stable/8/sys/dev/bge/if_bge.c	Thu Jan 21 00:39:45 2010	(r202725)
 +++ stable/8/sys/dev/bge/if_bge.c	Thu Jan 21 00:45:12 2010	(r202726)
 @@ -901,7 +901,8 @@ bge_miibus_statchg(device_t dev)
  	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);
 @@ -1782,13 +1783,20 @@ bge_blockinit(struct bge_softc *sc)
  	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);
 @@ -2849,12 +2857,14 @@ bge_attach(device_t dev)
  		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,
 
 Modified: stable/8/sys/dev/bge/if_bgereg.h
 ==============================================================================
 --- stable/8/sys/dev/bge/if_bgereg.h	Thu Jan 21 00:39:45 2010	(r202725)
 +++ stable/8/sys/dev/bge/if_bgereg.h	Thu Jan 21 00:45:12 2010	(r202726)
 @@ -2602,6 +2602,7 @@ struct bge_softc {
  #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
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/122551: commit references a PR
Date: Thu, 21 Jan 2010 00:47:42 +0000 (UTC)

 Author: yongari
 Date: Thu Jan 21 00:46:54 2010
 New Revision: 202727
 URL: http://svn.freebsd.org/changeset/base/202727
 
 Log:
   MFC r202293:
     For controllers that has dual mode PHY(copper or fiber) interfaces
     over GMII, make sure to enable GMII. With this change brgphy(4) is
     used to handle the dual mode PHY. Since we still don't have a sane
     way to pass PHY specific information to mii(4) layer special
     handling is needed in brgphy(4) to determine which mode of PHY was
     configured in parent interface.
     This change make BCM5715S work.
   
     Tested by:	olli
     Obtained from:	OpenBSD
     PR:	kern/122551
 
 Modified:
   stable/7/sys/dev/bge/if_bge.c
   stable/7/sys/dev/bge/if_bgereg.h
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/bge/if_bge.c
 ==============================================================================
 --- stable/7/sys/dev/bge/if_bge.c	Thu Jan 21 00:45:12 2010	(r202726)
 +++ stable/7/sys/dev/bge/if_bge.c	Thu Jan 21 00:46:54 2010	(r202727)
 @@ -901,7 +901,8 @@ bge_miibus_statchg(device_t dev)
  	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);
 @@ -1782,13 +1783,20 @@ bge_blockinit(struct bge_softc *sc)
  	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);
 @@ -2849,12 +2857,14 @@ bge_attach(device_t dev)
  		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,
 
 Modified: stable/7/sys/dev/bge/if_bgereg.h
 ==============================================================================
 --- stable/7/sys/dev/bge/if_bgereg.h	Thu Jan 21 00:45:12 2010	(r202726)
 +++ stable/7/sys/dev/bge/if_bgereg.h	Thu Jan 21 00:46:54 2010	(r202727)
 @@ -2602,6 +2602,7 @@ struct bge_softc {
  #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
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/122551: commit references a PR
Date: Thu, 21 Jan 2010 00:49:24 +0000 (UTC)

 Author: yongari
 Date: Thu Jan 21 00:49:14 2010
 New Revision: 202728
 URL: http://svn.freebsd.org/changeset/base/202728
 
 Log:
   MFC r202294:
     Add check for fiber mode for BCM5714 PHY. This PHY supports both
     copper and fiber interfaces over GMII so an explicit check is
     necessary to know whether it was configured for fiber interface.
     This change make BCM5715S work.
   
     Tested by:	olli
     PR:	kern/122551
 
 Modified:
   stable/8/sys/dev/mii/brgphy.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/dev/mii/brgphy.c
 ==============================================================================
 --- stable/8/sys/dev/mii/brgphy.c	Thu Jan 21 00:46:54 2010	(r202727)
 +++ stable/8/sys/dev/mii/brgphy.c	Thu Jan 21 00:49:14 2010	(r202728)
 @@ -197,6 +197,7 @@ brgphy_attach(device_t dev)
  	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
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/122551: commit references a PR
Date: Thu, 21 Jan 2010 00:50:55 +0000 (UTC)

 Author: yongari
 Date: Thu Jan 21 00:50:46 2010
 New Revision: 202729
 URL: http://svn.freebsd.org/changeset/base/202729
 
 Log:
   MFC r202294:
     Add check for fiber mode for BCM5714 PHY. This PHY supports both
     copper and fiber interfaces over GMII so an explicit check is
     necessary to know whether it was configured for fiber interface.
     This change make BCM5715S work.
   
     Tested by:	olli
     PR:	kern/122551
 
 Modified:
   stable/7/sys/dev/mii/brgphy.c
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/mii/brgphy.c
 ==============================================================================
 --- stable/7/sys/dev/mii/brgphy.c	Thu Jan 21 00:49:14 2010	(r202728)
 +++ stable/7/sys/dev/mii/brgphy.c	Thu Jan 21 00:50:46 2010	(r202729)
 @@ -197,6 +197,7 @@ brgphy_attach(device_t dev)
  	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
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->closed 
State-Changed-By: yongari 
State-Changed-When: Thu Mar 11 01:41:44 UTC 2010 
State-Changed-Why:  
The fix was already MFCed to stable/8 and stable/7. 
If you still get issues please let me know. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=122551 
>Unformatted:
