[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DMA channels with PCI devices



At 16:01 12.09.96 -0400, Craig Mathewson wrote:
>Hello,
>
>I was wondering if there are predefined dma channels assigned to PCI devices.
>In my AIX device driver I need to include dma support and one of the support
>routines needs this information.
>
>I know that AIX isn't your OS John but perhaps you can still tell me if PCI
devices
>use channels or dma arbitration levels.
>
>d_map_init(int bid, int flags, int bus_flags, uint channel)
>arguments:
>	int bid;		bus type/number identifier
>	int flags;	device capabilities
>	int bus_flags;	flags specific to the target bus
>	uint channel;	channel assignment specific to dev/bus
>
>I tryed putting an entry in my odm database but the values I used 1-15 were
>not accepted.  Are dma channels only valid on ISA.? Should I put 0 for the 
>channel parameter?  The reason I wonder is that we use the same routine
when performing DMA with ISA boards, where I know you can assign DMA channels.
>0-3 usually.


As far as I know, there are no global DMA resources predefined for PCI. On the
other hand, (as Steve writes) PCI controllers have built-in DMA resources. That
means the DMA resources are distrubuted to each PCI board. I know the PLX9060
has 2 separate DMA channels while the AMCC5933S has one channel.

When I used the d_map_init kernel service to map the PCI adapter DMA into
main memory,
I set the 'channel' parameter to 0 because I use the boards own DMA resources.

I suppose it is possible to use the DMA resources on the main board as well,
but this
is probably not a good idea. 
1) They are usually only 24 bits 
2) The programming may be more difficult or not supported in the OS


>
>For Hans eyes only ;)
>
>To answer your question about attaching and detaching, we've done away with
>a device driver and instead of turned my driver into a kernel extension
that links
>a bunch of service routines right into the kernel.  This can be done
dynamically
>of course.  I still use ODM to get it going but the main code doesn't
> interface with open, read, write, close but with direct calls to the
device like 
>P1394_afo (Firewire serial bus asynchronous send).  Anyways it's much
>quicker and I attached and detached ONLY ONCE at the beginning and the
>end of a session. (sorry for the indenting I don't know why Microsoft Exchange
>is doing this.)  If this interests you look into AIX Kernel Extensions.
>
>Craig Mathewson
>craig@sederta.com
>
>

Right now, I have implemented the device handling as a device driver. The
data rates 
we are running at the AIX system is relatively slow, so I believe the device
driver 
will be fast enought.

However, when I speed it up, I may need other ways to do the device
handling. I didn't
know you could implement it all as a kernel extention and have no device
driver. I
will have to dig further into it when I have tested my device driver. People
are 
breathing me in the neck, waiting for my device driver.

Question:

To avoid memory copying, I would like to map a memory area allocated in
kernel space
into user space. I have done this in my Solaris device driver, but I haven't
found
any way to do it in AIX. Do you know a way to do it?


Regards


Hans Berglund


-------------------------------------------------
Hans Berglund,        Phone:      +47 77 66 08 00
Kongsberg Spacetec,   url: http://www.spacetec.no
9005 Tromso, Norway.  email:       hb@spacetec.no
-------------------------------------------------
úx
g