Re: [RFC]DMA API Update


Liu, Baohong
 

From: Tomasz Bursztyka [mailto:tomasz.bursztyka(a)linux.intel.com]
Sent: Friday, January 20, 2017 12:21 AM
Subject: [devel] Re: [RFC]DMA API Update

Hi Baohong,

Very little comment on struct attributes.

Hi everyone,

Based on the feedbacks, I updated the RFC.

Data Structure Definitions
-------

/**
* @brief DMA block configuration structure.
*
* config is a bit field with the following parts:
* source_gather_en [ 0 ] --enable/disable source gather
* dest_scatter_en [ 1 ] --enable/disable destination scatter
* source_inc_en [ 2 ] --enable/disable source address
increment
* dest_inc_en [ 3 ] --enable/disable destination
address increment
* source_reload_en [ 4 ] --reload source address at the end
of block transfer
* dest_reload_en [ 5 ] --reload destination address at the
end of block transfer
* fifo_mode_control [ 6 : 9 ] --How full of the fifo before
transfer start. HW specific.
* flow_control_mode [ 10 ] --source request is served when
data available or
* wait until destination request
happens.
* RESERVED [ 11 : 31 ]
Is there a need of that much reserved space? I am asking this because maybe
we could shrink some attributes to 16bits like config (it would still give 5 bits
left for reserved usage)
Yes. will modify.


* source_address is block starting address at source
* source_gather_count is the continuous transfer count between gather
boundaries
* source_gather_interval is the address adjustment at gather
boundary
These 2 ones above for instance, is this necessary to put them on 32 bits?
Okay. Souce_gather can be changed to smaller size (16 bits) but the
source_gather_interval can be a big number so it is better to keep it to 32-bit.


* dest_address is block starting address at destination
* dest_scatter_count is the continuous transfer count between scatter
boundaries
* dest_scatter_interval is the address adjustment at scatter
boundary
Same here.
Same suggestion as above.

* block_size is the number of bytes to be transferred for this block.
*/
struct dma_block_config {
uint32_t config;
uint32_t source_address;
uint32_t source_gather_count;
uint32_t source_gather_interval;
uint32_t dest_address;
uint32_t dest_scatter_count;
uint32_t dest_scatter_interval;
uint32_t block_size;
struct dma_block_config *next_block;
}
I am also wondering how will we be able to use DMA efficiently in device
drivers.
They can't really use direct dma features. We will need something nicely
made, generic as possible, for sg dma buffers, etc...
Anything specific?


Tomasz

Join devel@lists.zephyrproject.org to automatically receive all group messages.