17#include <drivers/core/dm.h>
164 rt_bitmap_set_bit(ctrl->dir_cap, dir);
186#define RT_DMA_F_LINEAR RT_BIT(0)
187#define RT_DMA_F_32BITS RT_BIT(1)
188#define RT_DMA_F_NOCACHE RT_BIT(2)
189#define RT_DMA_F_DEVICE RT_BIT(3)
190#define RT_DMA_F_NOMAP RT_BIT(4)
192#define RT_DMA_PAGE_SIZE ARCH_PAGE_SIZE
221 return rt_dm_dev_prop_read_bool(dev,
"dma-coherent");
void * rt_dma_alloc(struct rt_device *dev, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
rt_dma_transfer_direction
rt_err_t rt_dma_controller_register(struct rt_dma_controller *ctrl)
struct rt_dma_chan * rt_dma_chan_request(struct rt_device *dev, const char *name)
rt_err_t rt_dma_chan_release(struct rt_dma_chan *chan)
rt_err_t rt_dma_prep_memcpy(struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
rt_err_t rt_dma_chan_done(struct rt_dma_chan *chan, rt_size_t size)
rt_inline void rt_dma_controller_add_direction(struct rt_dma_controller *ctrl, enum rt_dma_transfer_direction dir)
rt_err_t rt_dma_chan_stop(struct rt_dma_chan *chan)
@ RT_DMA_SLAVE_BUSWIDTH_2_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_64_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_UNDEFINED
@ RT_DMA_SLAVE_BUSWIDTH_BYTES_MAX
@ RT_DMA_SLAVE_BUSWIDTH_32_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_8_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_1_BYTE
@ RT_DMA_SLAVE_BUSWIDTH_3_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_4_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_128_BYTES
@ RT_DMA_SLAVE_BUSWIDTH_16_BYTES
rt_inline void rt_dma_device_set_ops(struct rt_device *dev, const struct rt_dma_map_ops *ops)
rt_err_t rt_dma_controller_unregister(struct rt_dma_controller *ctrl)
rt_err_t rt_dma_prep_single(struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
rt_inline void * rt_dma_alloc_coherent(struct rt_device *dev, rt_size_t size, rt_ubase_t *dma_handle)
struct rt_dma_pool * rt_dma_pool_install(rt_region_t *region)
void rt_dma_free(struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle, rt_ubase_t flags)
rt_err_t rt_dma_chan_config(struct rt_dma_chan *chan, struct rt_dma_slave_config *conf)
rt_err_t rt_dma_sync_in_data(struct rt_device *dev, void *out_data, rt_size_t size, rt_ubase_t dma_handle, rt_ubase_t flags)
rt_err_t rt_dma_sync_out_data(struct rt_device *dev, void *data, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
rt_err_t rt_dma_pool_extract(rt_region_t *region_list, rt_size_t list_len, rt_size_t cma_size, rt_size_t coherent_pool_size)
rt_err_t rt_dma_prep_cyclic(struct rt_dma_chan *chan, struct rt_dma_slave_transfer *transfer)
rt_err_t rt_dma_chan_start(struct rt_dma_chan *chan)
rt_inline void rt_dma_free_coherent(struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle)
rt_inline rt_bool_t rt_dma_device_is_coherent(struct rt_device *dev)
struct rt_list_node rt_list_t
struct rt_dma_slave_config conf
void(* callback)(struct rt_dma_chan *chan, rt_size_t size)
struct rt_dma_slave_transfer transfer
struct rt_dma_controller * ctrl
rt_err_t(* config)(struct rt_dma_chan *chan, struct rt_dma_slave_config *conf)
rt_err_t(* stop)(struct rt_dma_chan *chan)
rt_err_t(* prep_single)(struct rt_dma_chan *chan, rt_ubase_t dma_buf_addr, rt_size_t buf_len, enum rt_dma_transfer_direction dir)
rt_err_t(* prep_memcpy)(struct rt_dma_chan *chan, rt_ubase_t dma_addr_src, rt_ubase_t dma_addr_dst, rt_size_t len)
rt_err_t(* release_chan)(struct rt_dma_chan *chan)
rt_err_t(* prep_cyclic)(struct rt_dma_chan *chan, rt_ubase_t dma_buf_addr, rt_size_t buf_len, rt_size_t period_len, enum rt_dma_transfer_direction dir)
rt_err_t(* start)(struct rt_dma_chan *chan)
const struct rt_dma_controller_ops * ops
RT_BITMAP_DECLARE(dir_cap, RT_DMA_DIR_MAX)
rt_err_t(* sync_in_data)(struct rt_device *dev, void *out_data, rt_size_t size, rt_ubase_t dma_handle, rt_ubase_t flags)
void(* free)(struct rt_device *dev, rt_size_t size, void *cpu_addr, rt_ubase_t dma_handle, rt_ubase_t flags)
rt_err_t(* sync_out_data)(struct rt_device *dev, void *data, rt_size_t size, rt_ubase_t *dma_handle, rt_ubase_t flags)
enum rt_dma_transfer_direction direction
rt_uint32_t dst_port_window_size
rt_uint32_t src_port_window_size
enum rt_dma_slave_buswidth dst_addr_width
enum rt_dma_slave_buswidth src_addr_width