Subject: kern/33282: Add support for Broadcom BCM5789 chip
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <chwalek@poczta.onet.pl>
List: netbsd-bugs
Date: 04/18/2006 11:50:01
>Number:         33282
>Category:       kern
>Synopsis:       Add support for Broadcom BCM5789 chip
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 18 11:50:01 +0000 2006
>Originator:     Pawel Chwalowski
>Release:        3.0
>Organization:
>Environment:
NetBSD pe4 3.0 NetBSD 3.0 (GENERIC) #0: Tue Apr 18 15:01:09 CEST 2006  pawel@PE4:/usr/src/sys/arch/i386/compile/GENERIC i386

>Description:
Broadcom BCM5789 is not supported.

I have the GA-81945PL-G mainboard with onboard Broadcom 5789 chip (10/100/1000 Mbit).

dmesg output:
Broadcom product 0x169d (ethernet network, revision 0x11) at pci3 dev 0 function 0 not configured

I provide a patch based on a patch by Stefan Aeschbacher (FreeBSD 5.4 stable)
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=84604+0+archive/2005/freebsd-hackers/20050522.freebsd-hackers

It probably needs testing, but it just works for me.

>How-To-Repeat:

>Fix:
--- if_bge.c_ori	2006-04-18 14:39:31.000000000 +0200
+++ if_bge.c	2006-04-18 14:52:15.000000000 +0200
@@ -2127,6 +2127,10 @@
 	  PCI_PRODUCT_BROADCOM_BCM5788,
 	  "Broadcom BCM5788 Gigabit Ethernet",
 	  },
+	{ PCI_VENDOR_BROADCOM,
+	  PCI_PRODUCT_BROADCOM_BCM5789,
+	  "Broadcom BCM5789 Gigabit Ethernet",
+	  },
 
    	{ PCI_VENDOR_BROADCOM,
 	  PCI_PRODUCT_BROADCOM_BCM5901,
--- if_bgereg.h_ori	2006-04-18 14:42:05.000000000 +0200
+++ if_bgereg.h	2006-04-18 14:43:19.000000000 +0200
@@ -1892,6 +1892,7 @@
 #define BCOM_VENDORID			0x14E4
 #define BCOM_DEVICEID_BCM5700		0x1644
 #define BCOM_DEVICEID_BCM5701		0x1645
+#define BCOM_DEVICEID_BCM5789		0x169d
 
 /*
  * Alteon AceNIC PCI vendor/device ID.
--- pcidevs.h_ori	2006-04-18 14:57:34.000000000 +0200
+++ pcidevs.h	2006-04-18 14:58:40.000000000 +0200
@@ -1173,6 +1173,7 @@
 #define	PCI_PRODUCT_BROADCOM_BCM5751M	0x167d		/* BCM5751M 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5782	0x1696		/* BCM5782 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5788	0x169c		/* BCM5788 10/100/1000 Ethernet */
+#define PCI_PRODUCT_BROADCOM_BCM5789	0x169d		/* BCM5789 10/100/1000 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM4401_B0	0x170c		/* BCM4401-B0 10/100 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5901	0x170d		/* BCM5901 10/100 Ethernet */
 #define	PCI_PRODUCT_BROADCOM_BCM5901A2	0x170e		/* BCM5901A 10/100 Ethernet */
--- pcidevs_ori	2006-04-18 14:55:59.000000000 +0200
+++ pcidevs	2006-04-18 14:56:56.000000000 +0200
@@ -1166,6 +1166,7 @@
 product BROADCOM BCM5751M	0x167d	BCM5751M 10/100/1000 Ethernet
 product BROADCOM BCM5782	0x1696	BCM5782 10/100/1000 Ethernet
 product BROADCOM BCM5788	0x169c	BCM5788 10/100/1000 Ethernet
+product BROADCOM BCM5789	0x169d	BCM5789 10/100/1000 Ethernet
 product BROADCOM BCM4401_B0	0x170c	BCM4401-B0 10/100 Ethernet
 product BROADCOM BCM5901	0x170d	BCM5901 10/100 Ethernet
 product BROADCOM BCM5901A2	0x170e	BCM5901A 10/100 Ethernet




Now dmesg output looks like this:

bge0 at pci3 dev 0 function 0: Broadcom BCM5789 Gigabit Ethernet
bge0: interrupting at irq 5
bge0: ASIC BCM5751 A1 (0x4101), Ethernet address 00:14:85:3a:56:00
brgphy0 at bge0 phy 1: BCM5750 1000BASE-T media interface, rev. 0
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FD
X, auto