Linux-kernel mailing list archive 2000-01,: Large (~2MB) PCI-DMA buffer

# Large (~2MB) PCI-DMA buffer

Daniel Serpell (daniel@mat.utfsm.cl)
Thu, 06 Jan 2000 13:21:46 -0300

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Miquel van Smoorenburg: "Re: HELP: ANOTHER 6 JAN 2000 Kernel OOPS running under 2.2.14 now"
- Previous message: Richard B. Johnson: "Re: (*(unsigned long *)&jiffies)++;"

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/

- Next message: Miquel van Smoorenburg: "Re: HELP: ANOTHER 6 JAN 2000 Kernel OOPS running under 2.2.14 now"
- Previous message: Richard B. Johnson: "Re: (*(unsigned long *)&jiffies)++;"