svn commit: r214219 - head/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Fri Oct 22 19:30:57 UTC 2010


Author: yongari
Date: Fri Oct 22 19:30:56 2010
New Revision: 214219
URL: http://svn.freebsd.org/changeset/base/214219

Log:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Fri Oct 22 19:18:48 2010	(r214218)
+++ head/sys/dev/bge/if_bge.c	Fri Oct 22 19:30:56 2010	(r214219)
@@ -1693,6 +1693,11 @@ bge_blockinit(struct bge_softc *sc)
 		bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0);
 	}
 
+	/* Choose de-pipeline mode for BCM5906 A1. */
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5906 &&
+	    sc->bge_chiprev == BGE_CHIPID_BCM5906_A1)
+		CSR_WRITE_4(sc, BGE_ISO_PKT_TX,
+		    (CSR_READ_4(sc, BGE_ISO_PKT_TX) & ~3) | 2);
 	/*
 	 * The BD ring replenish thresholds control how often the
 	 * hardware fetches new BD's from the producer rings in host

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h	Fri Oct 22 19:18:48 2010	(r214218)
+++ head/sys/dev/bge/if_bgereg.h	Fri Oct 22 19:30:56 2010	(r214219)
@@ -880,6 +880,7 @@
 #define	BGE_SDI_STATS_CTL		0x0C08
 #define	BGE_SDI_STATS_ENABLE_MASK	0x0C0C
 #define	BGE_SDI_STATS_INCREMENT_MASK	0x0C10
+#define	BGE_ISO_PKT_TX			0x0C20
 #define	BGE_LOCSTATS_COS0		0x0C80
 #define	BGE_LOCSTATS_COS1		0x0C84
 #define	BGE_LOCSTATS_COS2		0x0C88


More information about the svn-src-all mailing list