| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 170 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 170 Page - STMicroelectronics |
|
170 / 245 page ![]() Accelerator engine device drivers UM0851 170/245 Doc ID 16604 Rev 2 Terminate DMA transfer In some cases, DMA transfer has to be stopped due to some error condition occurring in the client driver. This can be done using the following function. /* It can't be called directly, call it using chan pointer: chan->device->device_terminate_all(chan); */ void device_terminate_all(struct dma_chan *chan); Client un-registration After all the transfers are over, the client must free the channels so that they can be used by some other user. For this client must un-registered itself. This can be done by the following call: dma_async_client_unregister(&dma_client1); This will call dma_event() with status parameter set as DMA_RESOURCE_REMOVED. DMA usage example The following example transfers 100 bytes from memory to the tx_register of the skull driver. #include <linux/spr_dmac_pl080.h> struct dma_chan *chan; static int src_buf[100]; struct scatterlist *sg; u32 sg_len; dma_cookie_t cookie; struct dw_dma_slave dma_slave = { .src_master = DMA_MASTER_MEMORY; .dest_master = DMA_MASTER_SKULL; .slave.tx_reg = (dma_addr_t)skull_tx_reg; .slave.rx_reg = (dma_addr_t)skull_rx_reg; .slave.reg_width = DMA_SLAVE_WIDTH_32BIT; .cfg = DWC_CFG_FLOW_CTRL(DMA_MEMORY_TO_PERIPHERAL) | DWC_CFG_DEST_RQID(DMA_REQ_SKULL_TX); .ctl = DWC_CTL_USER_MODE | DWC_CTL_NON_BUFFERABLE | DWC_CTL_NON_CACHEABLE | DWC_CTL_SRC_ADDR_INC | DWC_CTL_DEST_BURST(BURST_8) | DWC_CTL_SRC_BURST(BURST_8) | DWC_CTL_SRC_WIDTH(WIDTH_WORD); } struct dma_client dma_client = { .event_callback = dma_event; .slave = &dma_slave.slave; } static enum dma_state_client dma_event(struct dma_client *client, struct dma_chan *chan, enum dma_state state); void dma_xfer(void) { struct dma_async_tx_descriptor *tx; u32 dma_addr; dma_cap_set(DMA_SLAVE, dma_client.cap_mask); /* Details of this function are not provided here. * It will create a scatter list of 2 nodes */ sg_len = create_sg(sg, src_buf, 100); dma_chan_get(chan); |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |