svn commit: r245151 - stable/9/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Tue Jan 8 05:29:55 UTC 2013


Author: yongari
Date: Tue Jan  8 05:29:54 2013
New Revision: 245151
URL: http://svnweb.freebsd.org/changeset/base/245151

Log:
  MFC r243686:
    Add preliminary support for BCM57766 ASIC.
    While I'm here add BCM57762 device id which is found on Apple
    Thunderbolt ethernet.

Modified:
  stable/9/sys/dev/bge/if_bge.c
  stable/9/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Tue Jan  8 05:28:55 2013	(r245150)
+++ stable/9/sys/dev/bge/if_bge.c	Tue Jan  8 05:29:54 2013	(r245151)
@@ -216,7 +216,9 @@ static const struct bge_type {
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5906M },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57760 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57761 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57762 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57765 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57766 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57780 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57781 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM57785 },
@@ -347,6 +349,7 @@ static const struct bge_revision bge_maj
 	{ BGE_ASICREV_BCM5787,		"unknown BCM5754/5787" },
 	{ BGE_ASICREV_BCM5906,		"unknown BCM5906" },
 	{ BGE_ASICREV_BCM57765,		"unknown BCM57765" },
+	{ BGE_ASICREV_BCM57766,		"unknown BCM57766" },
 	{ BGE_ASICREV_BCM57780,		"unknown BCM57780" },
 	{ BGE_ASICREV_BCM5717,		"unknown BCM5717" },
 	{ BGE_ASICREV_BCM5719,		"unknown BCM5719" },
@@ -362,6 +365,7 @@ static const struct bge_revision bge_maj
 #define	BGE_IS_575X_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_575X_PLUS)
 #define	BGE_IS_5755_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5755_PLUS)
 #define	BGE_IS_5717_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5717_PLUS)
+#define	BGE_IS_57765_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_57765_PLUS)
 
 const struct bge_revision * bge_lookup_rev(uint32_t);
 const struct bge_vendor * bge_lookup_vendor(uint16_t);
@@ -2243,7 +2247,7 @@ bge_blockinit(struct bge_softc *sc)
 	} else if (!BGE_IS_5705_PLUS(sc))
 		limit = BGE_RX_RINGS_MAX;
 	else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
-	    sc->bge_asicrev == BGE_ASICREV_BCM57765)
+	    BGE_IS_57765_PLUS(sc))
 		limit = 4;
 	else
 		limit = 1;
@@ -2657,7 +2661,9 @@ bge_probe(device_t dev)
 					    BGE_PCI_GEN2_PRODID_ASICREV, 4);
 					break;
 				case BCOM_DEVICEID_BCM57761:
+				case BCOM_DEVICEID_BCM57762:
 				case BCOM_DEVICEID_BCM57765:
+				case BCOM_DEVICEID_BCM57766:
 				case BCOM_DEVICEID_BCM57781:
 				case BCOM_DEVICEID_BCM57785:
 				case BCOM_DEVICEID_BCM57791:
@@ -3283,7 +3289,9 @@ bge_attach(device_t dev)
 			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
 			break;
 		case BCOM_DEVICEID_BCM57761:
+		case BCOM_DEVICEID_BCM57762:
 		case BCOM_DEVICEID_BCM57765:
+		case BCOM_DEVICEID_BCM57766:
 		case BCOM_DEVICEID_BCM57781:
 		case BCOM_DEVICEID_BCM57785:
 		case BCOM_DEVICEID_BCM57791:
@@ -3346,10 +3354,13 @@ bge_attach(device_t dev)
 
 	/* Save chipset family. */
 	switch (sc->bge_asicrev) {
+	case BGE_ASICREV_BCM57765:
+	case BGE_ASICREV_BCM57766:
+		sc->bge_flags |= BGE_FLAG_57765_PLUS;
+		/* FALLTHROUGH */
 	case BGE_ASICREV_BCM5717:
 	case BGE_ASICREV_BCM5719:
 	case BGE_ASICREV_BCM5720:
-	case BGE_ASICREV_BCM57765:
 		sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS |
 		    BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO |
 		    BGE_FLAG_JUMBO_FRAME;
@@ -3763,12 +3774,9 @@ bge_attach(device_t dev)
 		sc->bge_phy_flags |= BGE_PHY_NO_3LED;
 	if ((BGE_IS_5705_PLUS(sc)) &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5906 &&
-	    sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
-	    sc->bge_asicrev != BGE_ASICREV_BCM5719 &&
-	    sc->bge_asicrev != BGE_ASICREV_BCM5720 &&
 	    sc->bge_asicrev != BGE_ASICREV_BCM5785 &&
-	    sc->bge_asicrev != BGE_ASICREV_BCM57765 &&
-	    sc->bge_asicrev != BGE_ASICREV_BCM57780) {
+	    sc->bge_asicrev != BGE_ASICREV_BCM57780 &&
+	    !BGE_IS_5717_PLUS(sc)) {
 		if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
 		    sc->bge_asicrev == BGE_ASICREV_BCM5784 ||

Modified: stable/9/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/9/sys/dev/bge/if_bgereg.h	Tue Jan  8 05:28:55 2013	(r245150)
+++ stable/9/sys/dev/bge/if_bgereg.h	Tue Jan  8 05:29:54 2013	(r245151)
@@ -360,6 +360,7 @@
 #define	BGE_ASICREV_BCM5784		0x5784
 #define	BGE_ASICREV_BCM5785		0x5785
 #define	BGE_ASICREV_BCM57765		0x57785
+#define	BGE_ASICREV_BCM57766		0x57766
 #define	BGE_ASICREV_BCM57780		0x57780
 
 /* chip revisions */
@@ -2483,7 +2484,9 @@ struct bge_status_block {
 #define	BCOM_DEVICEID_BCM5906M		0x1713
 #define	BCOM_DEVICEID_BCM57760		0x1690
 #define	BCOM_DEVICEID_BCM57761		0x16B0
+#define	BCOM_DEVICEID_BCM57762		0x1682
 #define	BCOM_DEVICEID_BCM57765		0x16B4
+#define	BCOM_DEVICEID_BCM57766		0x1686
 #define	BCOM_DEVICEID_BCM57780		0x1692
 #define	BCOM_DEVICEID_BCM57781		0x16B1
 #define	BCOM_DEVICEID_BCM57785		0x16B5
@@ -2971,6 +2974,7 @@ struct bge_softc {
 #define	BGE_FLAG_5755_PLUS	0x00100000
 #define	BGE_FLAG_5788		0x00200000
 #define	BGE_FLAG_5717_PLUS	0x00400000
+#define	BGE_FLAG_57765_PLUS	0x00800000
 #define	BGE_FLAG_40BIT_BUG	0x01000000
 #define	BGE_FLAG_4G_BNDRY_BUG	0x02000000
 #define	BGE_FLAG_RX_ALIGNBUG	0x04000000


More information about the svn-src-stable-9 mailing list