lkml.org 
[lkml]   [2000]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectLarge (~2MB) PCI-DMA buffer
  Hi!

I'm writing a driver for a PCI adquisition board (this board
is custom-made from an amcc9533 and FPGA logic, so this driver isn't
intended for production use), and I need to get a large, about 2M
bytes, buffer of contiguous PCI memory (ie, it's PCI address has to be
on one large block) to do busmaster transfers. Also, I need to mmap
this buffer to user space.

The problem is that "vmalloc" gives a non-contiguous block, so I
can't use it. I have tried to "reserve" a block of memory at boot
tyme giving LILO the parameter "mem=128M" (the machine has 256MB RAM),
and using it from the driver.
The code to remap looks like:

bufvaddr = ioremap( virt_to_phys(high_memory), BUFFER_SIZE );

And to reserve mmap to user space I coded a loop for each page:

mem_map_reserve(MAP_NR(page_address));

It works in Kernel 2.2.3 but the driver lock's in current kernels
(tried 2.2.10 to 2.2.13).

I suspect that I'm doing something wrong, so mi question is:
Is there any info in how to use large DMA buffers ? Any existing
driver has code to dealing with this?
I think that with a good writen driver to start with, I could
write mine.

Many Thanks!!

Daniel Serpell
daniel@mat.utfsm.cl

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.119 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site