Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 May 2011 18:40:31 +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-7@freebsd.org
Subject:   svn commit: r222368 - stable/7/sys/dev/vge
Message-ID:  <201105271840.p4RIeVHw047327@svn.freebsd.org>

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

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/7/sys/dev/vge/if_vge.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/vge/if_vge.c
==============================================================================
--- stable/7/sys/dev/vge/if_vge.c	Fri May 27 18:39:18 2011	(r222367)
+++ stable/7/sys/dev/vge/if_vge.c	Fri May 27 18:40:31 2011	(r222368)
@@ -688,7 +688,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. */
@@ -805,10 +816,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?201105271840.p4RIeVHw047327>