Re: DMA driver API, source_burst_length, dest_burst_length


Liu, Baohong
 

-----Original Message-----
From: zephyr-devel-bounces@... [mailto:zephyr-devel-
bounces@...] On Behalf Of Johann Fischer
Sent: Thursday, June 8, 2017 6:40 AM
To: zephyr-devel@...
Subject: [Zephyr-devel] DMA driver API, source_burst_length, dest_burst_length

Hi,

The DMA API describes the source_burst_length and dest_burst_length of the
struct dma_config as:

...
* source_burst_length [ 0 : 15 ] - number of source data units
* dest_burst_length [ 16 : 31 ] - number of destination data units
...

What are the data units? octets?
This is HW related. It can't specified here in the generic API.

Burst length should be used together with transfer width. Let me give an example.

For a single DMA data transfer, the source can only send data out at 2 bytes each transfer and the destination can only accept data at one byte each transfer (this is HW related.). The DMA engine will get 2 bytes from the source and sends the data to the destination one byte each time (do this twice). For this case, the DMA burst length will be 2 bytes long, since this is the minimum data unit the source side can deal with. So,
source_burst_length = 1
source_transfer_width = 2
dest_burst_length = 2
dest_transfer_width = 1

Note: 1 or 2 in the above is absolute value. Since in the API, the enum starts from 0, 1 or 2 should be changed to 0 or 1.


From the test code, it is also not clear:

tests/drivers/dma/test_loop_transfer/src/dma.c:

initializes dma_cfg.dest_burst_length = 1;


tests/drivers/dma/test_chan_blen_transfer/src/test_dma.c

initializes dma_cfg.dest_burst_length = blen; /* blen = (8 | 16) */

--
Best Regards,
Johann Fischer
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

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