The dma_xfer function initiates a DMA transmit, receive, or exchange transaction. The prototype for this function is:
int dma_xfer( void *hdl, uint32_t device, spi_dma_paddr_t *paddr, int len );
The arguments are:
typedef struct { uint64_t rpaddr; uint64_t wpaddr; } spi_dma_paddr_t;
The rpaddr and wpaddr are physical addresses.
This function must return the number of bytes that have been successfully transferred by DMA, or -1 if an error occurred. It's the responsibility of the application to manage the DMA buffer.