From owner-svn-src-head@freebsd.org Mon Nov 2 22:49:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F312AA2482B; Mon, 2 Nov 2015 22:49:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B371F1F57; Mon, 2 Nov 2015 22:49:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA2Mndvl089357; Mon, 2 Nov 2015 22:49:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA2MndaM089353; Mon, 2 Nov 2015 22:49:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201511022249.tA2MndaM089353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Nov 2015 22:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290309 - in head/sys/arm: arm include xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2015 22:49:41 -0000 Author: ian Date: Mon Nov 2 22:49:39 2015 New Revision: 290309 URL: https://svnweb.freebsd.org/changeset/base/290309 Log: Eliminate the last dregs of the old global arm_root_dma_tag. In the old days, device drivers passed NULL for the parent tag when creating a new tag, and on arm platforms that resulted in a global tag representing overall platform constraints being substituted in the busdma code. Now all drivers use bus_get_dma_tag() and if there is a need to represent overall platform constraints they will be inherited from a tag supplied by nexus or some bus driver in the hierarchy. The only arm platforms still relying on the old global-tag scheme were some xscale boards with special PCI-bus constraints. This change provides those constraints through a tag supplied by the xscale PCI bus driver, and eliminates the few remaining references to the old global var. Reviewed by: cognet Modified: head/sys/arm/arm/busdma_machdep-v6.c head/sys/arm/arm/busdma_machdep.c head/sys/arm/include/bus_dma.h head/sys/arm/xscale/ixp425/ixp425_pci.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Mon Nov 2 22:42:07 2015 (r290308) +++ head/sys/arm/arm/busdma_machdep-v6.c Mon Nov 2 22:49:39 2015 (r290309) @@ -473,11 +473,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; -#if 0 - if (!parent) - parent = arm_root_dma_tag; -#endif - /* Basic sanity checking. */ KASSERT(boundary == 0 || powerof2(boundary), ("dma tag boundary %lu, must be a power of 2", boundary)); Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Mon Nov 2 22:42:07 2015 (r290308) +++ head/sys/arm/arm/busdma_machdep.c Mon Nov 2 22:49:39 2015 (r290309) @@ -224,9 +224,6 @@ static void free_bounce_page(bus_dma_tag static void bus_dmamap_sync_sl(struct sync_list *sl, bus_dmasync_op_t op, int bufaligned); -/* Default tag, as most drivers provide no parent tag. */ -bus_dma_tag_t arm_root_dma_tag; - /* * ---------------------------------------------------------------------------- * Begin block of code useful to transplant to other implementations. @@ -406,8 +403,6 @@ bus_dma_tag_create(bus_dma_tag_t parent, int error = 0; /* Return a NULL tag on failure */ *dmat = NULL; - if (!parent) - parent = arm_root_dma_tag; newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_BUSDMA, M_NOWAIT); if (newtag == NULL) { Modified: head/sys/arm/include/bus_dma.h ============================================================================== --- head/sys/arm/include/bus_dma.h Mon Nov 2 22:42:07 2015 (r290308) +++ head/sys/arm/include/bus_dma.h Mon Nov 2 22:49:39 2015 (r290309) @@ -94,8 +94,6 @@ struct arm32_dma_range { struct arm32_dma_range *bus_dma_get_range(void); int bus_dma_get_range_nb(void); -extern bus_dma_tag_t arm_root_dma_tag; - #endif /* _ARM32_BUS_DMA_PRIVATE */ #endif /* _ARM_BUS_DMA_H */ Modified: head/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci.c Mon Nov 2 22:42:07 2015 (r290308) +++ head/sys/arm/xscale/ixp425/ixp425_pci.c Mon Nov 2 22:49:39 2015 (r290309) @@ -136,14 +136,6 @@ ixppcib_attach(device_t dev) NULL, NULL, &sc->sc_dmat)) panic("couldn't create the PCI dma tag !"); /* - * The PCI bus can only address 64MB. However, due to the way our - * implementation of busdma works, busdma can't tell if a device - * is a PCI device or not. So defaults to the PCI dma tag, which - * restrict the DMA'able memory to the first 64MB, and explicitely - * create less restrictive tags for non-PCI devices. - */ - arm_root_dma_tag = sc->sc_dmat; - /* * Initialize the bus space tags. */ ixp425_io_bs_init(&sc->sc_pci_iot, sc); @@ -361,6 +353,14 @@ ixppcib_release_resource(device_t bus, d return (ENXIO); } +static bus_dma_tag_t +ixppcib_get_dma_tag(device_t bus, device_t child) +{ + struct ixppcib_softc *sc = device_get_softc(bus); + + return (sc->sc_dmat); +} + static void ixppcib_conf_setup(struct ixppcib_softc *sc, int bus, int slot, int func, int reg) @@ -459,7 +459,7 @@ static device_method_t ixppcib_methods[] DEVMETHOD(bus_activate_resource, ixppcib_activate_resource), DEVMETHOD(bus_deactivate_resource, ixppcib_deactivate_resource), DEVMETHOD(bus_release_resource, ixppcib_release_resource), - /* DEVMETHOD(bus_get_dma_tag, ixppcib_get_dma_tag), */ + DEVMETHOD(bus_get_dma_tag, ixppcib_get_dma_tag), /* pcib interface */ DEVMETHOD(pcib_maxslots, ixppcib_maxslots),