From owner-svn-src-stable-7@FreeBSD.ORG Fri May 27 18:40:31 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB91F1065692; Fri, 27 May 2011 18:40:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 814BD8FC4D; Fri, 27 May 2011 18:40:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RIeV3K047329; Fri, 27 May 2011 18:40:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RIeVHw047327; Fri, 27 May 2011 18:40:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105271840.p4RIeVHw047327@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 27 May 2011 18:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222368 - stable/7/sys/dev/vge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 18:40:31 -0000 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 */