Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jul 1999 21:22:34 +0200 (CEST)
From:      Wilko Bulte <wilko@yedi.iaf.nl>
To:        gibbs@caspian.plutotech.com (Justin T. Gibbs)
Cc:        gibbs@plutotech.com, hackers@FreeBSD.ORG
Subject:   Re: any docs on how to use bus_dma_tag_create e.a. ?
Message-ID:  <199907211922.VAA04796@yedi.iaf.nl>
In-Reply-To: <199907211603.KAA03304@caspian.plutotech.com> from "Justin T. Gibbs" at "Jul 21, 1999 10: 3:14 am"

next in thread | previous in thread | raw e-mail | index | archive | help
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




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