Sound Open Firmware
Loading...
Searching...
No Matches
DMA Drivers

SOF DMA Drivers API specification (deprecated interface, to be replaced by Zephyr zephyr/drivers/dma.h interface). More...

Data Structures

struct  dma_sg_elem
 Element of SG list (as array item). More...
struct  dma_cb_data
 Data used in DMA callbacks. More...
struct  dma_sg_elem_array
 SG elem array. More...
struct  dma_sg_config
struct  dma_chan_status
struct  dma_plat_data
struct  dma
struct  dma_chan_data
struct  dma_info
struct  dma_copy

Macros

#define SOF_DMA_DIR_MEM_TO_MEM   BIT(0)
 local memory copy
#define SOF_DMA_DIR_HMEM_TO_LMEM   BIT(1)
 host memory to local mem copy
#define SOF_DMA_DIR_LMEM_TO_HMEM   BIT(2)
 local mem to host mem copy
#define SOF_DMA_DIR_MEM_TO_DEV   BIT(3)
 local mem to dev copy
#define SOF_DMA_DIR_DEV_TO_MEM   BIT(4)
 dev to local mem copy
#define SOF_DMA_DIR_DEV_TO_DEV   BIT(5)
 dev to dev copy
#define SOF_DMA_CAP_HDA   BIT(0)
 HDA DMA.
#define SOF_DMA_CAP_GP_LP   BIT(1)
 GP LP DMA.
#define SOF_DMA_CAP_GP_HP   BIT(2)
 GP HP DMA.
#define SOF_DMA_CAP_BT   BIT(3)
 BT DMA.
#define SOF_DMA_CAP_SP   BIT(4)
 SP DMA.
#define SOF_DMA_CAP_DMIC   BIT(5)
 ACP DMA DMIC >.
#define SOF_DMA_CAP_SP_VIRTUAL   BIT(6)
 SP VIRTUAL DMA.
#define SOF_DMA_CAP_HS_VIRTUAL   BIT(7)
 HS VIRTUAL DMA.
#define SOF_DMA_CAP_HS   BIT(8)
 HS DMA.
#define SOF_DMA_CAP_SW   BIT(9)
 SW DMA.
#define SOF_DMA_CAP_TDM   BIT(10)
 connectable to ACP TDM I2S
#define SOF_DMA_DEV_HOST   BIT(0)
 connectable to host
#define SOF_DMA_DEV_HDA   BIT(1)
 connectable to HD/A link
#define SOF_DMA_DEV_SSP   BIT(2)
 connectable to SSP fifo
#define SOF_DMA_DEV_DMIC   BIT(3)
 connectable to DMIC fifo
#define SOF_DMA_DEV_SSI   BIT(4)
 connectable to SSI / SPI fifo
#define SOF_DMA_DEV_ALH   BIT(5)
 connectable to ALH link
#define SOF_DMA_DEV_SAI   BIT(6)
 connectable to SAI fifo
#define SOF_DMA_DEV_ESAI   BIT(7)
 connectable to ESAI fifo
#define SOF_DMA_DEV_BT   BIT(8)
 connectable to ACP BT I2S
#define SOF_DMA_DEV_SP   BIT(9)
 connectable to ACP SP I2S
#define SOF_DMA_DEV_AFE_MEMIF   BIT(10)
 connectable to AFE fifo
#define SOF_DMA_DEV_SP_VIRTUAL   BIT(11)
 connectable to ACP SP VIRTUAL I2S
#define SOF_DMA_DEV_HS_VIRTUAL   BIT(12)
 connectable to ACP HS VIRTUAL I2S
#define SOF_DMA_DEV_HS   BIT(13)
 connectable to ACP HS I2S
#define SOF_DMA_DEV_MICFIL   BIT(14)
 connectable to MICFIL fifo
#define SOF_DMA_DEV_SW   BIT(15)
 connectable to ACP SW
#define SOF_DMA_DEV_TDM   BIT(16)
 connectable to ACP TDM I2S
#define SOF_DMA_ACCESS_EXCLUSIVE   1
#define SOF_DMA_ACCESS_SHARED   0
#define SOF_DMA_COPY_BLOCKING   BIT(0)
#define SOF_DMA_COPY_ONE_SHOT   BIT(1)
#define SOF_DMA_CHAN_INVALID   0xFFFFFFFF
#define SOF_DMA_CORE_INVALID   0xFFFFFFFF

Typedefs

typedef int(* dma_process_func) (const struct cir_buf_source *source, uint32_t src_channels, struct cir_buf_sink *sink, uint32_t sink_channels, size_t source_samples, uint32_t chmap)

Enumerations

enum  sof_dma_cb_status { SOF_DMA_CB_STATUS_RELOAD = 0 , SOF_DMA_CB_STATUS_END }

Functions

int dmac_init (struct sof *sof)
 API to initialize a platform DMA controllers.
static void dma_sg_init (struct dma_sg_elem_array *ea)
int dma_sg_alloc (struct k_heap *heap, struct dma_sg_elem_array *ea, uint32_t flags, uint32_t direction, uint32_t buffer_count, uint32_t buffer_bytes, uintptr_t dma_buffer_addr, uintptr_t external_addr)
void dma_sg_free (struct k_heap *heap, struct dma_sg_elem_array *ea)
static uint32_t dma_sg_get_size (struct dma_sg_elem_array *ea)
 Get the total size of SG buffer.
int dma_buffer_copy_from (struct comp_buffer *source, struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes, uint32_t chmap)
int stream_copy_from_no_consume (struct comp_dev *dev, struct comp_buffer *source, struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes, uint32_t chmap)
int dma_buffer_copy_to (struct comp_buffer *source, struct comp_buffer *sink, dma_process_func process, uint32_t sink_bytes, uint32_t chmap)
static const struct dma_info * dma_info_get (void)

Detailed Description

SOF DMA Drivers API specification (deprecated interface, to be replaced by Zephyr zephyr/drivers/dma.h interface).

Macro Definition Documentation

◆ SOF_DMA_ACCESS_EXCLUSIVE

#define SOF_DMA_ACCESS_EXCLUSIVE   1

◆ SOF_DMA_ACCESS_SHARED

#define SOF_DMA_ACCESS_SHARED   0

◆ SOF_DMA_CAP_BT

#define SOF_DMA_CAP_BT   BIT(3)

BT DMA.

◆ SOF_DMA_CAP_DMIC

#define SOF_DMA_CAP_DMIC   BIT(5)

ACP DMA DMIC >.

◆ SOF_DMA_CAP_GP_HP

#define SOF_DMA_CAP_GP_HP   BIT(2)

GP HP DMA.

◆ SOF_DMA_CAP_GP_LP

#define SOF_DMA_CAP_GP_LP   BIT(1)

GP LP DMA.

◆ SOF_DMA_CAP_HDA

#define SOF_DMA_CAP_HDA   BIT(0)

HDA DMA.

◆ SOF_DMA_CAP_HS

#define SOF_DMA_CAP_HS   BIT(8)

HS DMA.

◆ SOF_DMA_CAP_HS_VIRTUAL

#define SOF_DMA_CAP_HS_VIRTUAL   BIT(7)

HS VIRTUAL DMA.

◆ SOF_DMA_CAP_SP

#define SOF_DMA_CAP_SP   BIT(4)

SP DMA.

◆ SOF_DMA_CAP_SP_VIRTUAL

#define SOF_DMA_CAP_SP_VIRTUAL   BIT(6)

SP VIRTUAL DMA.

◆ SOF_DMA_CAP_SW

#define SOF_DMA_CAP_SW   BIT(9)

SW DMA.

◆ SOF_DMA_CAP_TDM

#define SOF_DMA_CAP_TDM   BIT(10)

connectable to ACP TDM I2S

◆ SOF_DMA_CHAN_INVALID

#define SOF_DMA_CHAN_INVALID   0xFFFFFFFF

◆ SOF_DMA_COPY_BLOCKING

#define SOF_DMA_COPY_BLOCKING   BIT(0)

◆ SOF_DMA_COPY_ONE_SHOT

#define SOF_DMA_COPY_ONE_SHOT   BIT(1)

◆ SOF_DMA_CORE_INVALID

#define SOF_DMA_CORE_INVALID   0xFFFFFFFF

◆ SOF_DMA_DEV_AFE_MEMIF

#define SOF_DMA_DEV_AFE_MEMIF   BIT(10)

connectable to AFE fifo

◆ SOF_DMA_DEV_ALH

#define SOF_DMA_DEV_ALH   BIT(5)

connectable to ALH link

◆ SOF_DMA_DEV_BT

#define SOF_DMA_DEV_BT   BIT(8)

connectable to ACP BT I2S

◆ SOF_DMA_DEV_DMIC

#define SOF_DMA_DEV_DMIC   BIT(3)

connectable to DMIC fifo

◆ SOF_DMA_DEV_ESAI

#define SOF_DMA_DEV_ESAI   BIT(7)

connectable to ESAI fifo

◆ SOF_DMA_DEV_HDA

#define SOF_DMA_DEV_HDA   BIT(1)

connectable to HD/A link

◆ SOF_DMA_DEV_HOST

#define SOF_DMA_DEV_HOST   BIT(0)

connectable to host

◆ SOF_DMA_DEV_HS

#define SOF_DMA_DEV_HS   BIT(13)

connectable to ACP HS I2S

◆ SOF_DMA_DEV_HS_VIRTUAL

#define SOF_DMA_DEV_HS_VIRTUAL   BIT(12)

connectable to ACP HS VIRTUAL I2S

◆ SOF_DMA_DEV_MICFIL

#define SOF_DMA_DEV_MICFIL   BIT(14)

connectable to MICFIL fifo

◆ SOF_DMA_DEV_SAI

#define SOF_DMA_DEV_SAI   BIT(6)

connectable to SAI fifo

◆ SOF_DMA_DEV_SP

#define SOF_DMA_DEV_SP   BIT(9)

connectable to ACP SP I2S

◆ SOF_DMA_DEV_SP_VIRTUAL

#define SOF_DMA_DEV_SP_VIRTUAL   BIT(11)

connectable to ACP SP VIRTUAL I2S

◆ SOF_DMA_DEV_SSI

#define SOF_DMA_DEV_SSI   BIT(4)

connectable to SSI / SPI fifo

◆ SOF_DMA_DEV_SSP

#define SOF_DMA_DEV_SSP   BIT(2)

connectable to SSP fifo

◆ SOF_DMA_DEV_SW

#define SOF_DMA_DEV_SW   BIT(15)

connectable to ACP SW

◆ SOF_DMA_DEV_TDM

#define SOF_DMA_DEV_TDM   BIT(16)

connectable to ACP TDM I2S

◆ SOF_DMA_DIR_DEV_TO_DEV

#define SOF_DMA_DIR_DEV_TO_DEV   BIT(5)

dev to dev copy

◆ SOF_DMA_DIR_DEV_TO_MEM

#define SOF_DMA_DIR_DEV_TO_MEM   BIT(4)

dev to local mem copy

◆ SOF_DMA_DIR_HMEM_TO_LMEM

#define SOF_DMA_DIR_HMEM_TO_LMEM   BIT(1)

host memory to local mem copy

◆ SOF_DMA_DIR_LMEM_TO_HMEM

#define SOF_DMA_DIR_LMEM_TO_HMEM   BIT(2)

local mem to host mem copy

◆ SOF_DMA_DIR_MEM_TO_DEV

#define SOF_DMA_DIR_MEM_TO_DEV   BIT(3)

local mem to dev copy

◆ SOF_DMA_DIR_MEM_TO_MEM

#define SOF_DMA_DIR_MEM_TO_MEM   BIT(0)

local memory copy

Typedef Documentation

◆ dma_process_func

typedef int(* dma_process_func) (const struct cir_buf_source *source, uint32_t src_channels, struct cir_buf_sink *sink, uint32_t sink_channels, size_t source_samples, uint32_t chmap)

Enumeration Type Documentation

◆ sof_dma_cb_status

Enumerator
SOF_DMA_CB_STATUS_RELOAD 
SOF_DMA_CB_STATUS_END 

Function Documentation

◆ dma_buffer_copy_from()

int dma_buffer_copy_from ( struct comp_buffer * source,
struct comp_buffer * sink,
dma_process_func process,
uint32_t source_bytes,
uint32_t chmap )

◆ dma_buffer_copy_to()

int dma_buffer_copy_to ( struct comp_buffer * source,
struct comp_buffer * sink,
dma_process_func process,
uint32_t sink_bytes,
uint32_t chmap )

◆ dma_info_get()

const struct dma_info * dma_info_get ( void )
inlinestatic

◆ dma_sg_alloc()

int dma_sg_alloc ( struct k_heap * heap,
struct dma_sg_elem_array * ea,
uint32_t flags,
uint32_t direction,
uint32_t buffer_count,
uint32_t buffer_bytes,
uintptr_t dma_buffer_addr,
uintptr_t external_addr )

◆ dma_sg_free()

void dma_sg_free ( struct k_heap * heap,
struct dma_sg_elem_array * ea )

◆ dma_sg_get_size()

uint32_t dma_sg_get_size ( struct dma_sg_elem_array * ea)
inlinestatic

Get the total size of SG buffer.

Parameters
eaArray of SG elements.
Returns
Size of the buffer.

◆ dma_sg_init()

void dma_sg_init ( struct dma_sg_elem_array * ea)
inlinestatic

◆ dmac_init()

int dmac_init ( struct sof * sof)

API to initialize a platform DMA controllers.

Parameters
[in]sofPointer to firmware main context.

◆ stream_copy_from_no_consume()

int stream_copy_from_no_consume ( struct comp_dev * dev,
struct comp_buffer * source,
struct comp_buffer * sink,
dma_process_func process,
uint32_t source_bytes,
uint32_t chmap )