Skip to contentSkip to conversation

RTDM mmap and DMA

Xenomai-help Fillod Stephane 2 participants 2 messages Dec 18, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 2 lines · Perrine Martignoni

Thanks for the explanation.
But how can I do to allocate the DMA area ? with the Dma-api of

Linux or

Quoted 1 line
Quoted 1 line
Quoted 1 line

Xenomai offers the possibility to do this ? and what about memory

heap with

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

H_DMA ?
I'm a bit confused with all of this.

Yes, allocation and registration (pci_map*/pci_unmap*) is intended to run via normal Linux. H_DMA (if you were using heaps here), which

leads

Quoted 4 lines
Quoted 1 line

to GFP_DMA, is only involved for old ISA hardware.

GFP_DMA may also make a big difference on some ARMs. See arch/arm/common/dmabounce.c for details.

Not only ARMs. The H_DMA flag appears to work fine with PowerPCs (PQ). This is quite
handy in order to obtain physically contiguous memory, from a user task context.
The question though is whether there's the below 16 MB address mask in action,
which is kind of stupid most of the time on embedded PowerPCs. The patch I sent previously about rt_heap_inquire is also useful to get the physical address of the buffer (hint hint: care to commit it?), which
is needed by most embedded DMAs.

Signature · 1 line
Stephane
#1 lore raw
Quoted 19 lines · Fillod Stephane
Quoted 4 lines · Gilles Chanteperdrix
Quoted 3 lines · Jan Kiszka
Quoted 2 lines · Perrine Martignoni

Thanks for the explanation.
But how can I do to allocate the DMA area ? with the Dma-api of

Linux or

Quoted 1 line
Quoted 1 line
Quoted 1 line

Xenomai offers the possibility to do this ? and what about memory

heap with

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

H_DMA ?
I'm a bit confused with all of this.

Yes, allocation and registration (pci_map*/pci_unmap*) is intended to run via normal Linux. H_DMA (if you were using heaps here), which

leads

Quoted 4 lines
Quoted 1 line

to GFP_DMA, is only involved for old ISA hardware.

GFP_DMA may also make a big difference on some ARMs. See arch/arm/common/dmabounce.c for details.

Quoted 8 lines

Not only ARMs. The H_DMA flag appears to work fine with PowerPCs (PQ). This is quite
handy in order to obtain physically contiguous memory, from a user task context.

The question though is whether there's the below 16 MB address mask in action,
which is kind of stupid most of the time on embedded PowerPCs.

The way I understand the GFP_DMA flags, its aim is not to obtain physically contiguous memory, memory obtained with get_free_pages is always contiguous anyway. The aim seems rather to allocate in a machine dependent memory zone that will allow memory to be used for DMA (for example, allocating it below a 16 MB limit).

Quoted 4 lines

The patch I sent previously about rt_heap_inquire is also useful to get the physical address of the buffer (hint hint: care to commit it?), which
is needed by most embedded DMAs.

I have not looked at the patch, but I think that it is indeed a good idea to have a way to obtain the physical address of a heap.

Signature · 1 line
                                               Gilles Chanteperdrix