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

Pyun YongHyeon yongari at FreeBSD.org
Wed Oct 26 18:37:03 UTC 2011


Author: yongari
Date: Wed Oct 26 18:37:02 2011
New Revision: 226807
URL: http://svn.freebsd.org/changeset/base/226807

Log:
  BCM5719 cannot handle DMA requests for DMA segments that have
  larger than 4KB in size.  However the maximum DMA segment size
  created in DMA tag is 4KB, so we wouldn't encounter the issue here.
  Just record this issue such that let developers not to create a DMA
  segment that is larger than 4KB for BCM5719. It's possible to split
  a DMA segment into multiple smaller ones in run time but I believe
  it's not worth to implement that.

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	Wed Oct 26 18:27:01 2011	(r226806)
+++ head/sys/dev/bge/if_bge.c	Wed Oct 26 18:37:02 2011	(r226807)
@@ -2927,6 +2927,15 @@ bge_attach(device_t dev)
 	if (BGE_IS_5755_PLUS(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5906)
 		sc->bge_flags |= BGE_FLAG_SHORT_DMA_BUG;
 
+	/*
+	 * BCM5719 cannot handle DMA requests for DMA segments that
+	 * have larger than 4KB in size.  However the maximum DMA
+	 * segment size created in DMA tag is 4KB for TSO, so we
+	 * wouldn't encounter the issue here.
+	 */
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5719)
+		sc->bge_flags |= BGE_FLAG_4K_RDMA_BUG;
+
 	misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID;
 	if (sc->bge_asicrev == BGE_ASICREV_BCM5705) {
 		if (misccfg == BGE_MISCCFG_BOARD_ID_5788 ||

Modified: head/sys/dev/bge/if_bgereg.h
==============================================================================
--- head/sys/dev/bge/if_bgereg.h	Wed Oct 26 18:27:01 2011	(r226806)
+++ head/sys/dev/bge/if_bgereg.h	Wed Oct 26 18:37:02 2011	(r226807)
@@ -2797,6 +2797,7 @@ struct bge_softc {
 #define	BGE_FLAG_4G_BNDRY_BUG	0x02000000
 #define	BGE_FLAG_RX_ALIGNBUG	0x04000000
 #define	BGE_FLAG_SHORT_DMA_BUG	0x08000000
+#define	BGE_FLAG_4K_RDMA_BUG	0x10000000
 	uint32_t		bge_phy_flags;
 #define	BGE_PHY_NO_WIRESPEED	0x00000001
 #define	BGE_PHY_ADC_BUG		0x00000002


More information about the svn-src-head mailing list