Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
DMA
- 01-06-2005
- Brad Pelletier
January 6, 2005, 9:16 pm

Hello,
I am trying to figure out how to make a program from user land that can
use the DMA controller. I would like it to read values, returned from
the SPI port, and store the values in the SDRAM. Can this be done?
I have figured out that I need to use a physical address when
programming the DMA controller, not a virtual address such as is used in
application programs. Is there a way to find the physical address from
the virtual address?
Thanks in advance to anyone who can help.
BJ
I am trying to figure out how to make a program from user land that can
use the DMA controller. I would like it to read values, returned from
the SPI port, and store the values in the SDRAM. Can this be done?
I have figured out that I need to use a physical address when
programming the DMA controller, not a virtual address such as is used in
application programs. Is there a way to find the physical address from
the virtual address?
Thanks in advance to anyone who can help.
BJ

Re: DMA

You're question is rather vauge, but I think what you need to
do is write a device driver that does the DMA to/from a buffer.
That device driver can then allow the user-program to mmap()
the DMA buffers into user-space.
--
Grant Edwards grante Yow! AIEEEEE! I am having
at an UNDULATING EXPERIENCE!
Grant Edwards grante Yow! AIEEEEE! I am having
at an UNDULATING EXPERIENCE!
We've slightly trimmed the long signature. Click to see the full one.

Re: DMA

Here's a demo I did many years ago that sort of does that:
ftp://ftp.visi.com/users/grante/stuff/demomm.tar.gz
It supports mmapping a PCI card's memory region into user
space, as well as a "scratch" buffer that can be used for DMA.
It's 5 years old, and hasn't been touched since kernel 2.2. I
suspect that the kernal API has changed so much it's worthless.
--
Grant Edwards grante Yow! -- In 1962, you could
at buy a pair of SHARKSKIN
Grant Edwards grante Yow! -- In 1962, you could
at buy a pair of SHARKSKIN
We've slightly trimmed the long signature. Click to see the full one.

Re: DMA
Bus master DMA (e.g. by a PCI card) or using a DMA utility in the
Motherboard or processor.
If (2) you need to find out a free controller and reserve same for your
driver.
Generally it's not a good idea at all to try to do any DMA related work
in userland. You should do a device driver and call that from you
program, providing userland addresses for the buffer and then ave the
driver do the work.
-Michael
Motherboard or processor.
If (2) you need to find out a free controller and reserve same for your
driver.
Generally it's not a good idea at all to try to do any DMA related work
in userland. You should do a device driver and call that from you
program, providing userland addresses for the buffer and then ave the
driver do the work.
-Michael
Site Timeline
- » DMA Drivers?
- — Next thread in » Embedded Linux
-
- » Generate an EXT2 image without being root
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Orcad Pspice purchase
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Dual Line driver
- — The site's Last Updated Thread. Posted in » Electronics Design
-