Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2011 18:39:19 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r222367 - stable/8/sys/dev/vge
Message-ID:  <201105271839.p4RIdJCn047253@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri May 27 18:39:18 2011
New Revision: 222367
URL: http://svn.freebsd.org/changeset/base/222367

Log:
  MFC r222142:
    Datasheet says vge(4) controllers support DAC but it seems that's
    not true on old PCI based controllers.  DAC configuration is read
    from EEPROM in device reset phase and driver can override DAC
    configuration.  However I guess there is an undocumented reason why
    EEPROM configuration does not enable DAC so do not blindly override
    DAC configuration.  Recent PCIe based controllers are supposed to
    support 64bit DMA so allow 64bit DMA only on PCIe based controllers.
  
    PR:	kern/157184

Modified:
  stable/8/sys/dev/vge/if_vge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/vge/if_vge.c
==============================================================================
--- stable/8/sys/dev/vge/if_vge.c	Fri May 27 17:47:19 2011	(r222366)
+++ stable/8/sys/dev/vge/if_vge.c	Fri May 27 18:39:18 2011	(r222367)
@@ -685,7 +685,18 @@ vge_dma_alloc(struct vge_softc *sc)
 	bus_addr_t lowaddr, tx_ring_end, rx_ring_end;
 	int error, i;
 
-	lowaddr = BUS_SPACE_MAXADDR;
+	/*
+	 * It seems old PCI controllers do not support DAC.  DAC
+	 * configuration can be enabled by accessing VGE_CHIPCFG3
+	 * register but honor EEPROM configuration instead of
+	 * blindly overriding DAC configuration.  PCIe based
+	 * controllers are supposed to support 64bit DMA so enable
+	 * 64bit DMA on these controllers.
+	 */
+	if ((sc->vge_flags & VGE_FLAG_PCIE) != 0)
+		lowaddr = BUS_SPACE_MAXADDR;
+	else
+		lowaddr = BUS_SPACE_MAXADDR_32BIT;
 
 again:
 	/* Create parent ring tag. */
@@ -802,10 +813,14 @@ again:
 		goto again;
 	}
 
+	if ((sc->vge_flags & VGE_FLAG_PCIE) != 0)
+		lowaddr = VGE_BUF_DMA_MAXADDR;
+	else
+		lowaddr = BUS_SPACE_MAXADDR_32BIT;
 	/* Create parent buffer tag. */
 	error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */
 	    1, 0,			/* algnmnt, boundary */
-	    VGE_BUF_DMA_MAXADDR,	/* lowaddr */
+	    lowaddr,			/* lowaddr */
 	    BUS_SPACE_MAXADDR,		/* highaddr */
 	    NULL, NULL,			/* filter, filterarg */
 	    BUS_SPACE_MAXSIZE_32BIT,	/* maxsize */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105271839.p4RIdJCn047253>