Large (~2MB) PCI-DMA buffer

From: Daniel Serpell (daniel@mat.utfsm.cl)
Date: Thu Jan 06 2000 - 11:21:46 EST


  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/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:06 EST