Page MenuHomeFreeBSD

DMA abstaction layer aka xDMA
ClosedPublic

Authored by br on Dec 15 2016, 3:38 PM.

Details

Summary

Ideas for improvement:

  1. SoftDMA - when we have no real dma yet, but already want to use xDMA
  2. Introduce capabilites, so xDMA knows what the transfer types supported by hardware DMA controller, how many data can be copied by single descriptor, etc.
  3. Callback provided with some information, e.g. how many data were actually copied and any errors occurred during transfer
  4. Scatter-Gathering transfer type (WIP)
  5. Non-FDT setup, i.e. real dma controller register itself to xDMA
  6. Might be useful to have xdma interrupt thread, so callbacks can be optionally provided not in the interrupt time, but after
  7. Requests enqueuing support ? not sure if we need that

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

br updated this revision to Diff 22952.Dec 15 2016, 3:38 PM
br retitled this revision from to DMA abstaction layer aka xDMA.
br updated this object.
br edited the test plan for this revision. (Show Details)
br added a reviewer: kan.
br added a reviewer: jmcneill.Dec 15 2016, 3:55 PM
bcr added a subscriber: bcr.Dec 15 2016, 4:07 PM

I've found a couple of typos in comments.

sys/dev/xdma/xdma.c
421 ↗(On Diff #22952)

s/decsriptors/descriptors/

468 ↗(On Diff #22952)

s/decsriptors/descriptors/

sys/dev/xdma/xdma_fdt_test.c
310 ↗(On Diff #22952)

s/succeded/succeeded/

br updated this revision to Diff 22998.Dec 16 2016, 3:54 PM

fix typos repored by bcr@
add man page

br updated this object.Dec 16 2016, 4:06 PM
br updated this object.Dec 16 2016, 4:51 PM
br added a reviewer: imp.
br updated this object.
jmcneill added inline comments.Dec 16 2016, 8:22 PM
sys/dev/xdma/xdma_if.m
66 ↗(On Diff #22998)

I think this should be pcell_t

jmcneill edited edge metadata.Dec 17 2016, 2:49 PM

Thinking about this some more. For Allwinner (ARM) we have a private sunxi_dma_if that is used. The config structure has some additional fields:

struct sunxi_dma_config {
	unsigned int dst_width;
	unsigned int dst_burst_len;
	unsigned int dst_drqtype;
	bool dst_noincr;
	unsigned int dst_blksize;	/* DDMA-only */
	unsigned int dst_wait_cyc;	/* DDMA-only */
	unsigned int src_width;
	unsigned int src_burst_len;
	unsigned int src_drqtype;
	bool src_noincr;
	unsigned int src_blksize;	/* DDMA-only */
	unsigned int src_wait_cyc;	/* DDMA-only */
};

Is the expectation that as more fields are required we will grow xdma_channel_config?

br added a comment.Dec 18 2016, 12:57 PM

Is the expectation that as more fields are required we will grow xdma_channel_config?

Sure! we can grow any time if required.

br updated this revision to Diff 23054.Dec 18 2016, 2:18 PM
br edited edge metadata.

use pcell_t instead of phandle_t asnoticed by jmcneill@

sys/dev/xdma/xdma_if.m
66 ↗(On Diff #22998)

you right, thanks !

br updated this revision to Diff 23055.Dec 18 2016, 2:21 PM
br added a reviewer: emaste.Dec 18 2016, 10:33 PM
This revision was automatically updated to reflect the committed changes.