#include <dma.h>
#include <slist.h>
#include <types.h>
#include <buffer.h>
#include <chip/dma_controller.h>


Go to the source code of this file.
Data Structures | |
| struct | dmac_request |
| Asynchronous DMA request. More... | |
| struct | dmac_channel |
| A DMA Controller Channel. More... | |
| struct | dma_controller |
| A DMA Controller. More... | |
Enumerations | |
| enum | dmac_reg_width { DMAC_REG_WIDTH_8BIT = 0, DMAC_REG_WIDTH_16BIT = 1, DMAC_REG_WIDTH_32BIT = 2 } |
| Peripheral register width. More... | |
| enum | dmac_burst_length { DMAC_BURST_LENGTH_1 = 0, DMAC_BURST_LENGTH_4 = 1, DMAC_BURST_LENGTH_8 = 2, DMAC_BURST_LENGTH_16 = 3, DMAC_BURST_LENGTH_32 = 4 } |
| Transaction burst length. More... | |
Functions | |
| static struct dmac_channel * | dmac_alloc_channel (struct dma_controller *dmac, enum dmac_periph_id rx_periph, enum dmac_periph_id tx_periph, phys_addr_t rx_reg_addr, phys_addr_t tx_reg_addr) |
| Allocate a channel on a given DMA Controller. | |
| static void | dmac_free_channel (struct dma_controller *dmac, struct dmac_channel *chan) |
| Free a previously allocated DMA Controller channel. | |
| static void | dmac_chan_submit_request (struct dmac_channel *chan, struct dmac_request *req) |
| Submit a DMA transfer request. | |
| static void | dmac_chan_reset (struct dmac_channel *chan) |
| Reset a DMA channel. | |
| static void | dmac_req_init (struct dmac_request *req) |
| Initialize a DMA request. | |
| static void | dmac_req_add_buffer (struct dmac_request *req, struct buffer *buf) |
| Assign the buffer buf to the DMA request req. | |
A DMA Controller (DMAC) is a device capable of doing data transfers between memory and a peripheral device without CPU intervention. Some controllers also support memory-to-memory transfers.
Definition in file dma_controller.h.
| enum dmac_burst_length |
Transaction burst length.
| DMAC_BURST_LENGTH_1 | 1 item |
| DMAC_BURST_LENGTH_4 | 4 items |
| DMAC_BURST_LENGTH_8 | 8 items |
| DMAC_BURST_LENGTH_16 | 16 items |
| DMAC_BURST_LENGTH_32 | 32 items |
Definition at line 71 of file dma_controller.h.
| enum dmac_reg_width |
| static struct dmac_channel* dmac_alloc_channel | ( | struct dma_controller * | dmac, | |
| enum dmac_periph_id | rx_periph, | |||
| enum dmac_periph_id | tx_periph, | |||
| phys_addr_t | rx_reg_addr, | |||
| phys_addr_t | tx_reg_addr | |||
| ) | [static, read] |
Allocate a channel on a given DMA Controller.
| dmac | The DMA Controller on which to allocate a channel | |
| rx_periph | Perpiheral ID to use when receiving data, or DMAC_PERIPH_NONE if the channel is to be used for TX only. | |
| tx_periph | Perpiheral ID to use when transmitting data, or DMAC_PERIPH_NONE if the channel is to be used for RX only. | |
| rx_reg_addr | Physical address of the Receive Data Register | |
| tx_reg_addr | Physical address of the Transmit Data Register |
Definition at line 146 of file dma_controller.h.
References dma_controller::alloc_chan.
| static void dmac_chan_reset | ( | struct dmac_channel * | chan | ) | [inline, static] |
Reset a DMA channel.
This function stops the DMA Controller and terminates all pending requests.
| chan | The Channel to be reset |
Definition at line 191 of file dma_controller.h.
References dmac_channel::reset.
| static void dmac_chan_submit_request | ( | struct dmac_channel * | chan, | |
| struct dmac_request * | req | |||
| ) | [inline, static] |
Submit a DMA transfer request.
This function does not return any value indicating if the request was successful; set up a req_done() callback and check dmac_request::status to verify the status of the request.
| chan | The channel on which to submit the request | |
| req | The request to be submitted |
Definition at line 178 of file dma_controller.h.
References dmac_channel::submit_req.
Referenced by aes_submit_request(), and sdmmc_mcihost_load_data().
| static void dmac_free_channel | ( | struct dma_controller * | dmac, | |
| struct dmac_channel * | chan | |||
| ) | [inline, static] |
Free a previously allocated DMA Controller channel.
| dmac | The DMA Controller from which the channel was allocated | |
| chan | The Channel to be freed |
Definition at line 162 of file dma_controller.h.
References dma_controller::free_chan.
| static void dmac_req_add_buffer | ( | struct dmac_request * | req, | |
| struct buffer * | buf | |||
| ) | [inline, static] |
Assign the buffer buf to the DMA request req.
buf will be transfered after any previously assigned buffers.
Definition at line 210 of file dma_controller.h.
References dmac_request::buf_list, buffer::node, and slist_insert_tail().

| static void dmac_req_init | ( | struct dmac_request * | req | ) | [inline, static] |
Initialize a DMA request.
| req | The request to be initialized |
Definition at line 200 of file dma_controller.h.
References dmac_request::buf_list, and slist_init().
Referenced by sdmmc_mcihost_init().

1.5.8