Subject: Re: bcm5754 support
To: Havard Eidnes <he@netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: current-users
Date: 01/09/2007 15:48:36
--Boundary-00=_EKwoFy8JIwDSTEB
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Friday 05 January 2007 12:39, Havard Eidnes wrote:
> OK, I think I found a change in the FreeBSD driver which is meant
> to fix "firmware handshake" issues with certain cards.  I also
> added the ASIC revision number to a table so that it's not printed
> as "unknown".
>
> New diff attached below, relative to 1.39 of if_bgereg.h and 1.222
> of if_bge.c.

I'm trying to get an Optiplex 745 going with current and it has a 
bcm5754 so I tried the patch and I don't get any errors reported, the 
device seems to configure correctly I just don't see any packets 
going in or out of it.

I thought it might have been that it was trying to use the ukphy 
rather than brgphy so I made the further patch attached below and now 
get:

bge0 at pci3 dev 0 function 0: Broadcom BCM5754 Gigabit Ethernet
bge0: interrupting at irq 11
bge0: pcie mode=0x105000
bge0: ASIC BCM5754/5787 A2 (0xb002), Ethernet address 
00:18:8b:2a:d8:0a
bge0: setting short Tx thresholds
brgphy0 at bge0 phy 1: BCM5754 1000BASE-T media interface, rev. 0
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto

but still it doesn't work - I don't appear to see any packets.

Couple of odd things I noted:
- Don't know why the BROADCOM2 OUI appears to be the reverse 
endianness from the OpenBSD and FreeBSD values (but this is what 
matched for me).

- When I first ifconfig the bge0 interface I get the following kernel 
messages logged:

	bge0: pcie mode=0x105000
	uhci0: host controller halted

uhci0 is on the same irq (11) as bge0.

Any suggestions on how to debug/fix this?

cheers
mark

--Boundary-00=_EKwoFy8JIwDSTEB
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="mii.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="mii.diff"

Index: brgphy.c
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/mii/brgphy.c,v
retrieving revision 1.31
diff -u -r1.31 brgphy.c
--- brgphy.c	26 Nov 2006 16:31:48 -0000	1.31
+++ brgphy.c	6 Jan 2007 20:37:11 -0000
@@ -174,6 +174,9 @@
 	{ MII_OUI_BROADCOM,		MII_MODEL_BROADCOM_BCM5780,
 	  MII_STR_BROADCOM_BCM5780 },
 
+	{ MII_OUI_BROADCOM2,		MII_MODEL_BROADCOM2_BCM5754,
+	  MII_STR_BROADCOM2_BCM5754 },
+
 	{ 0,				0,
 	  NULL },
 };
@@ -258,6 +261,7 @@
 	case MII_MODEL_BROADCOM_BCM5780:
 	case MII_MODEL_BROADCOM_BCM5750:
 	case MII_MODEL_BROADCOM_BCM5752:
+	case MII_MODEL_BROADCOM2_BCM5754:
 		sc->mii_funcs = &brgphy_5750_funcs;
 		break;
 
Index: miidevs
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/mii/miidevs,v
retrieving revision 1.69
diff -u -r1.69 miidevs
--- miidevs	26 Nov 2006 16:26:35 -0000	1.69
+++ miidevs	6 Jan 2007 20:35:57 -0000
@@ -55,6 +55,7 @@
 oui ALTIMA			0x0010a9	Altima Communications
 oui AMD				0x00001a	Advanced Micro Devices
 oui BROADCOM			0x001018	Broadcom Corporation
+oui BROADCOM2			0x000af7	Broadcom Corporation
 oui CICADA			0x0003F1	Cicada Semiconductor
 oui DAVICOM			0x00606e	Davicom Semiconductor
 oui ENABLESEMI			0x0010dd	Enable Semiconductor
@@ -141,6 +142,7 @@
 model BROADCOM BCM5750		0x0018 BCM5750 1000BASE-T media interface
 model BROADCOM BCM5714		0x0034 BCM5714 1000BASE-T media interface
 model BROADCOM BCM5780		0x0035 BCM5780 1000BASE-T media interface
+model BROADCOM2 BCM5754		0x000e BCM5754 1000BASE-T media interface
  
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */
 model CICADA CS8201		0x0001 Cicada CS8201 10/100/1000TX PHY
Index: miidevs.h
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/mii/miidevs.h,v
retrieving revision 1.72
diff -u -r1.72 miidevs.h
--- miidevs.h	26 Nov 2006 16:28:19 -0000	1.72
+++ miidevs.h	6 Jan 2007 20:36:06 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs.h,v 1.72 2006/11/26 16:28:19 tsutsui Exp $	*/
+/*	$NetBSD$	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -62,6 +62,7 @@
 #define	MII_OUI_ALTIMA	0x0010a9	/* Altima Communications */
 #define	MII_OUI_AMD	0x00001a	/* Advanced Micro Devices */
 #define	MII_OUI_BROADCOM	0x001018	/* Broadcom Corporation */
+#define	MII_OUI_BROADCOM2	0x000af7	/* Broadcom Corporation */
 #define	MII_OUI_CICADA	0x0003F1	/* Cicada Semiconductor */
 #define	MII_OUI_DAVICOM	0x00606e	/* Davicom Semiconductor */
 #define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
@@ -176,6 +177,8 @@
 #define	MII_STR_BROADCOM_BCM5714	"BCM5714 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM_BCM5780	0x0035
 #define	MII_STR_BROADCOM_BCM5780	"BCM5780 1000BASE-T media interface"
+#define	MII_MODEL_BROADCOM2_BCM5754	0x000e
+#define	MII_STR_BROADCOM2_BCM5754	"BCM5754 1000BASE-T media interface"
  
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */
 #define	MII_MODEL_CICADA_CS8201	0x0001
Index: miidevs_data.h
===================================================================
RCS file: /src/cvs/netbsd/src/sys/dev/mii/miidevs_data.h,v
retrieving revision 1.62
diff -u -r1.62 miidevs_data.h
--- miidevs_data.h	26 Nov 2006 16:28:19 -0000	1.62
+++ miidevs_data.h	6 Jan 2007 20:36:06 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs_data.h,v 1.62 2006/11/26 16:28:19 tsutsui Exp $	*/
+/*	$NetBSD$	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -72,6 +72,7 @@
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5750, MII_STR_BROADCOM_BCM5750 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5714, MII_STR_BROADCOM_BCM5714 },
  { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5780, MII_STR_BROADCOM_BCM5780 },
+ { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5754, MII_STR_BROADCOM2_BCM5754 },
  { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201, MII_STR_CICADA_CS8201 },
  { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, MII_STR_CICADA_CS8201A },
  { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, MII_STR_CICADA_CS8201B },

--Boundary-00=_EKwoFy8JIwDSTEB--