Subject: Re: bcm5754 support
To: None <bsd-xen@roguewrt.org>
From: Havard Eidnes <he@netbsd.org>
List: current-users
Date: 01/05/2007 00:39:36
----Next_Part(Fri_Jan__5_00_39_36_2007_053)--
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

> 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=3Da8,delmode=3D1,logical,actlo,level,mask=
ed,dest=3D0> =

> 3000000<target=3D3>
> bge0: interrupting at ioapic0 pin 17, event channel 3
> bge0: firmware handshake timed out, val =3D 4b657654
> bge0: pcie mode=3D0x105000
> 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 mes=
sage is =

> repeated:
>
> bge0: firmware handshake timed out, val =3D 4b657654
> bge0: pcie mode=3D0x105000
>
> The patch has not effected the operation of any normally supported bg=
e =

> interfaces.
>
> Close :)

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.

Best regards,

- H=E5vard

----Next_Part(Fri_Jan__5_00_39_36_2007_053)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename=diff

Index: if_bge.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.122
diff -u -r1.122 if_bge.c
--- if_bge.c	26 Nov 2006 06:09:09 -0000	1.122
+++ if_bge.c	4 Jan 2007 23:32:01 -0000
@@ -277,6 +277,8 @@
 #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)  \
@@ -1986,6 +1988,18 @@
 	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
 	  "BCM5752 A2" },
 
+	{ BGE_CHIPID_BCM5787_A0,
+	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+	  "BCM5754/5787 A0" },
+
+	{ BGE_CHIPID_BCM5787_A1,
+	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+	  "BCM5754/5787 A2" },
+
+	{ BGE_CHIPID_BCM5787_A2,
+	  BGE_QUIRK_ONLY_PHY_1|BGE_QUIRK_5705_CORE,
+	  "BCM5754/5787 A2" },
+
 	{ 0, 0, NULL }
 };
 
@@ -2030,11 +2044,18 @@
 	  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,6 +2212,26 @@
 	  "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,7 +2245,17 @@
    	{ 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,
@@ -2737,6 +2788,11 @@
 			val |= (1<<29);
 		}
 	}
+	/*
+	 * Write the magic number to the firmware mailbox at 0xb50
+	 * so that the driver can synchronize with the firmware.
+	 */
+	bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
 
 	/* Issue global reset */
 	bge_writereg_ind(sc, BGE_MISC_CFG, val);
@@ -2785,12 +2841,6 @@
 	}
 
 	/*
-	 * Prevent PXE restart: write a magic number to the
-	 * general communications memory at 0xB50.
-	 */
-	bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
-
-	/*
 	 * Poll the value location we just wrote until
 	 * we see the 1's complement of the magic number.
 	 * This indicates that the firmware initialization
Index: if_bgereg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bgereg.h,v
retrieving revision 1.39
diff -u -r1.39 if_bgereg.h
--- if_bgereg.h	26 Nov 2006 05:52:15 -0000	1.39
+++ if_bgereg.h	4 Jan 2007 23:32:07 -0000
@@ -275,6 +275,8 @@
 #define BGE_CHIPID_BCM5715_A0		0x90000000
 #define BGE_CHIPID_BCM5715_A1		0x90010000
 #define BGE_CHIPID_BCM5715_A3		0x90030000
+#define BGE_CHIPID_BCM5787_A0		0xb0000000
+#define BGE_CHIPID_BCM5787_A1		0xb0010000
 #define BGE_CHIPID_BCM5787_A2		0xb0020000
 #define BGE_CHIPID_BCM5906_A1		0xc0010000
 

----Next_Part(Fri_Jan__5_00_39_36_2007_053)----