Subject: Re: bcm5754 support
To: Havard Eidnes <he@netbsd.org>
From: Sarton O'Brien <bsd-xen@roguewrt.org>
List: current-users
Date: 01/02/2007 09:38:43
--Boundary-00=_01YmFZ2Zp3hFsin
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Thursday 28 December 2006 15:54, Sarton O'Brien wrote:
> On Sunday 24 December 2006 06:19, you wrote:
> > The attached is a minimal patch to sys/dev/pci/if_bge.c in 4.0, which
> > I've not tried to compile...  It more or less mirrors the
> > corresponding change in FreeBSD, but as I said earlier, there's a bit
> > of divergence between the FreeBSD and NetBSD drivers, so I don't know
> > if this depends on some earlier change in FreeBSD's driver.
> >
> > It's worth a shot, though.  I'd appreciate to see the relevant part of
> > your dmesg whatever the result.

With the attached diff applied, the resulting dmesg is:

pci4: i/o space, memory space enabled
bge0 at pci4 dev 0 function 0: Broadcom BCM5754 Gigabit Ethernet
ioapic0: int17 1a9a8<vector=a8,delmode=1,logical,actlo,level,masked,dest=0> 
3000000<target=3>
bge0: interrupting at ioapic0 pin 17, event channel 3
bge0: firmware handshake timed out, val = 4b657654
bge0: pcie mode=0x105000
bge0: ASIC unknown BCM5787 (0xb002), Ethernet address 00:13:72:39:7e:e3
bge0: setting short Tx thresholds

The interface is there and configurable but not functioning. This message is 
repeated:

bge0: firmware handshake timed out, val = 4b657654
bge0: pcie mode=0x105000

The patch has not effected the operation of any normally supported bge 
interfaces.

Close :)

This sort of error was present under xen for the older bge interfaces and had 
to do with SMP interupt handling. Hopefully in this case it's isolated to the 
driver.

Sarton

--Boundary-00=_01YmFZ2Zp3hFsin
Content-Type: text/x-diff;
  charset="utf-8";
  name="if_bge.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="if_bge.diff"

*** if_bge.c.~1.122.~	Wed Dec 20 21:04:08 2006
--- if_bge.c	Sat Dec 23 00:34:17 2006
***************
*** 277,282 ****
--- 277,284 ----
  #define BGE_IS_5750_OR_BEYOND(sc)  \
  	(BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5750 || \
  	 BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752 || \
+ 	 BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || \
+ 	 BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || \
  	 BGE_IS_5714_FAMILY(sc) )
  
  #define BGE_IS_5705_OR_BEYOND(sc)  \
***************
*** 2030,2040 ****
--- 2032,2049 ----
  	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
  	  "unknown BCM5752 family" },
  
+ 	{ BGE_ASICREV_BCM5755,
+ 	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ 	  "unknown BCM5755" },
  
  	{ BGE_ASICREV_BCM5780,
  	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
  	  "unknown BCM5780" },
  
+ 	{ BGE_ASICREV_BCM5787,
+ 	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+ 	  "unknown BCM5787" },
+ 
  	{ 0,
  	  0,
  	  NULL }
***************
*** 2191,2196 ****
--- 2200,2225 ----
  	  "Broadcom BCM5752M Gigabit Ethernet",
  	  },
  
+ 	{ PCI_VENDOR_BROADCOM,
+ 	  PCI_PRODUCT_BROADCOM_BCM5754,
+ 	  "Broadcom BCM5754 Gigabit Ethernet",
+ 	},
+ 
+ 	{ PCI_VENDOR_BROADCOM,
+ 	  PCI_PRODUCT_BROADCOM_BCM5754M,
+ 	  "Broadcom BCM5754M Gigabit Ethernet",
+ 	},
+ 
+ 	{ PCI_VENDOR_BROADCOM,
+ 	  PCI_PRODUCT_BROADCOM_BCM5755,
+ 	  "Broadcom BCM5755 Gigabit Ethernet",
+ 	},
+ 
+ 	{ PCI_VENDOR_BROADCOM,
+ 	  PCI_PRODUCT_BROADCOM_BCM5755M,
+ 	  "Broadcom BCM5755M Gigabit Ethernet",
+ 	},
+ 
     	{ PCI_VENDOR_BROADCOM,
  	  PCI_PRODUCT_BROADCOM_BCM5780,
  	  "Broadcom BCM5780 Gigabit Ethernet",
***************
*** 2204,2210 ****
     	{ PCI_VENDOR_BROADCOM,
  	  PCI_PRODUCT_BROADCOM_BCM5782,
  	  "Broadcom BCM5782 Gigabit Ethernet",
! 	  },
  
     	{ PCI_VENDOR_BROADCOM,
  	  PCI_PRODUCT_BROADCOM_BCM5788,
--- 2233,2249 ----
     	{ PCI_VENDOR_BROADCOM,
  	  PCI_PRODUCT_BROADCOM_BCM5782,
  	  "Broadcom BCM5782 Gigabit Ethernet",
! 	},
! 
! 	{ PCI_VENDOR_BROADCOM,
! 	  PCI_PRODUCT_BROADCOM_BCM5787,
! 	  "Broadcom BCM5787 Gigabit Ethernet",
! 	},
! 
! 	{ PCI_VENDOR_BROADCOM,
! 	  PCI_PRODUCT_BROADCOM_BCM5787M,
! 	  "Broadcom BCM5787M Gigabit Ethernet",
! 	},
  
     	{ PCI_VENDOR_BROADCOM,
  	  PCI_PRODUCT_BROADCOM_BCM5788,

--Boundary-00=_01YmFZ2Zp3hFsin--