From owner-freebsd-hackers Wed Jul 21 12:41:36 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from uni4nn.gn.iaf.nl (osmium.gn.iaf.nl [193.67.144.12]) by hub.freebsd.org (Postfix) with ESMTP id 098C514C4C for ; Wed, 21 Jul 1999 12:41:23 -0700 (PDT) (envelope-from wilko@yedi.iaf.nl) Received: from yedi.iaf.nl (uucp@localhost) by uni4nn.gn.iaf.nl (8.9.2/8.9.2) with UUCP id VAA10306; Wed, 21 Jul 1999 21:30:39 +0200 (MET DST) Received: (from wilko@localhost) by yedi.iaf.nl (8.9.3/8.9.3) id VAA04796; Wed, 21 Jul 1999 21:22:34 +0200 (CEST) (envelope-from wilko) From: Wilko Bulte Message-Id: <199907211922.VAA04796@yedi.iaf.nl> Subject: Re: any docs on how to use bus_dma_tag_create e.a. ? In-Reply-To: <199907211603.KAA03304@caspian.plutotech.com> from "Justin T. Gibbs" at "Jul 21, 1999 10: 3:14 am" To: gibbs@caspian.plutotech.com (Justin T. Gibbs) Date: Wed, 21 Jul 1999 21:22:34 +0200 (CEST) Cc: gibbs@plutotech.com, hackers@FreeBSD.ORG X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-pgp-info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG As Justin T. Gibbs wrote ... Excellent help, thanks. Some more questions inserted below. > >shared memory stuff? I found some DMA stuff in ahc_pci.c: > > > > /* Allocate a dmatag for our SCB DMA maps */ > > /* XXX Should be a child of the PCI bus dma tag */ > > error = bus_dma_tag_create(/*parent*/NULL, > > A parent tag would indicate the restrictions of any parent bridge between > the device you are talking to and CPU memory. We haven't modified the > new bus code yet to pass through this information, so just leave it NULL > for now. > /*alignment*/1, > > Any alignment constraints on the target memory region of a DMA specified in > bytes. If the allocation must be 32bit aligned, you would specify 4. > > > /*boundary*/0, > > Any boundary constraints on the target memory region of a DMA, for instance > if the DMA cannot cross a 64k boundary, you would set this to 64K. > > > /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, > > /*highaddr*/BUS_SPACE_MAXADDR, > > low and high address of the region that the DMA engine cannot access. Meaning e.g. the 16Mbyte barrier that ISA DMA has? For PCI this would be a 4Gb range(?). > > /*filter*/NULL, /*filterarg*/NULL, > > If the device's DMA constraints cannot be specified with a single region, > you must specify a region that encompasses all such regions and specify > a filter function to provide a finer level of control. > > > /*maxsize*/MAXBSIZE, > > Maximum DMA transfer size. > > > /*nsegments*/AHC_NSEG, > > Maximum number of discontinuities in the mapped region. Eh.. ? > > /*maxsegsz*/AHC_MAXTRANSFER_SIZE, > > Maximum size of a segment. maxsize <= nsegments * maxsegsz. Eh.. ? > > /*flags*/BUS_DMA_ALLOCNOW > > Allocate all necessary resources to handle a single mapping for this tag > at the time the tag is created. > > >Most (?) drivers seem to use the older framework (can I distinguish > >those by COMPAT_PCI_DRIVER() ?). > > You should use the new API if possible. That is what I'm planning to do. The amount of sample code in the various drivers is rather limited as most drivers use the old code. So I hope you don't mind me asking some more questions, Wilko -- | / o / / _ Arnhem, The Netherlands - Powered by FreeBSD - |/|/ / / /( (_) Bulte WWW : http://www.tcja.nl http://www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message