36 #ifndef __MHAL_DMA_H__
37 #define __MHAL_DMA_H__
39 #include "mhal_osai.h"
656 u8 *buffer, u32 length);
enum dma_type chn_type
DMA channel type.
Definition: mhal_dma.h:431
dma_isr_callback isr_callback_1
For FULL-SIZE DMA and HALF-SIZE DMA, isr_callback_1 is completion isr callback.
Definition: mhal_dma.h:411
void * isr_cb_data_1
isr_callback_1 data
Definition: mhal_dma.h:417
Select DMA burst type as 16-beat.
Definition: mhal_dma.h:268
enum dma_dir dir
Transfer direction, only for HALF-SIZE DMA and VFF DMA.
Definition: mhal_dma.h:315
u32 wrap_point
Wrap point from start address.
Definition: mhal_dma.h:379
The interrupt of DMA channel is pending and waitting for service.
Definition: mhal_dma.h:234
int mtk_mhal_dma_resume(struct dma_controller *controller)
This function is used to resume one DMA channel.
u8 dreq
Throttle and handshake control for DMA Transfer between DMA and Peripheral.
Definition: mhal_dma.h:346
dma_isr_callback isr_callback_2
For HALF-SIZE DMA, isr_callback_2 is half completion isr callback.
Definition: mhal_dma.h:415
struct dma_config * cfg
DMA config.
Definition: mhal_dma.h:435
u8 timeout_int_en
Enable FIFO data timeout interrupt for VFF DMA.
Definition: mhal_dma.h:332
u8 wrap_en
Flag of transfer address-wrapping feature.
Definition: mhal_dma.h:320
u32 alert_len
Specifies the Alert Length of Virtual FIFO DMA.
Definition: mhal_dma.h:400
remaining length of current transfer, only for FULL-SIZE DMA and HALF-SIZE DMA.
Definition: mhal_dma.h:208
int mtk_mhal_dma_get_param(struct dma_controller *controller, enum dma_param param)
This function is used to get DMA parameter which is defined in the dma_param.
u32 timeout_cnt
Interrupt will assert if there is no new data into FIFO more than n T(Bus Clock)
Definition: mhal_dma.h:406
u8 dst_inc_en
Destination addresses automatically increase after every transfer, only for FULL-SIZE DMA and HALF-SI...
Definition: mhal_dma.h:350
int mtk_mhal_dma_update_swptr(struct dma_controller *controller, u32 length_byte)
This function is used to update VFF DMA channel swptr.
Data count of FIFO, only for VFF DMA.
Definition: mhal_dma.h:221
u8 bw_transfer_en
Word to byte or byte to word transfer flag, only for HALF-SIZE DMA.
Definition: mhal_dma.h:342
Interface to DMA, used to pass arguments between OS_HAL and M-HAL.
Definition: mhal_dma.h:425
int mtk_mhal_dma_reset(struct dma_controller *controller)
This function is used to reset DMA channel.
fix_addr specifies the address for peripheral; must be 4-Byte alignment; only for HALF-SIZE DMA and V...
Definition: mhal_dma.h:213
u8 src_inc_en
Source addresses automatically increase after every transfer, only for FULL-SIZE DMA and HALF-SIZE DM...
Definition: mhal_dma.h:354
u8 chn
DMA channel.
Definition: mhal_dma.h:428
dma_burst_type
DMA dma_burst_type definition.
Definition: mhal_dma.h:260
HALF-SIZE DMA.
Definition: mhal_dma.h:195
FIFO size, only for VFF DMA.
Definition: mhal_dma.h:219
u8 half_int_en
Enable half transfer completion interrupt for HALF-SIZE DMA.
Definition: mhal_dma.h:334
u32 wrap_to_addr
The address which DMA will wrap to.
Definition: mhal_dma.h:385
u32 fifo_size
Virtual fifo size, only for VFF DMA.
Definition: mhal_dma.h:402
int mtk_mhal_dma_config(struct dma_controller *controller)
This function is used to configure one DMA channel.
Hardware pointer, only for VFF DMA.
Definition: mhal_dma.h:223
dma_transize
DMA dma_transize definition.
Definition: mhal_dma.h:244
int mtk_mhal_dma_clr_dreq(struct dma_controller *controller)
This function is used to clear dreq signal of DMA channel.
void * isr_cb_data_2
isr_callback_2 data
Definition: mhal_dma.h:419
int mtk_mhal_dma_dump_reg(struct dma_controller *controller)
This function is used to dump DMA register for debug.
The DMA channel is paused.
Definition: mhal_dma.h:238
Select DMA burst type as 4-beat.
Definition: mhal_dma.h:264
dma_param
DMA parameter-type definition.
Definition: mhal_dma.h:204
Select DMA burst type as 8-beat.
Definition: mhal_dma.h:266
int mtk_mhal_dma_clock_disable(struct dma_controller *controller)
This function is used to disable DMA channel clock.
Select DMA transaction size as Long (4-byte)
Definition: mhal_dma.h:250
enum dma_transize transize
Data size within the confine of a bus cycle per transfer.
Definition: mhal_dma.h:358
Select DMA transaction size as Short (2-byte)
Definition: mhal_dma.h:248
int mtk_mhal_dma_start(struct dma_controller *controller)
This function is used to start one DMA channel.
u8 bw_limiter
Bandwidth limiter.
Definition: mhal_dma.h:394
int mtk_mhal_dma_set_param(struct dma_controller *controller, enum dma_param param, u32 value)
This function is used to set DMA parameter which is defined in the dma_param.
u8 alert_cmp_type
Specifies the Compare Equation Between ALTLEN and FIFO_SIZE - FIFO_CNT.
Definition: mhal_dma.h:398
Virtual FIFO DMA.
Definition: mhal_dma.h:197
int mtk_mhal_dma_clear_irq_status(struct dma_controller *controller)
This function is used to clear DMA HW status.
u32 count
For FULL-SIZE DMA and HALF-SIZE DMA, it specifies transfer byte count.
Definition: mhal_dma.h:392
dma_type
DMA channel type definition.
Definition: mhal_dma.h:191
int mtk_mhal_dma_stop(struct dma_controller *controller)
This function is used to stop one DMA channel.
u8 reload_en
Reload transfer count flag, only for HALF-SIZE DMA.
Definition: mhal_dma.h:387
u32 addr_1
For FULL-SIZE DMA, addr_1 is src_addr.
Definition: mhal_dma.h:370
The DMA channel is currently running.
Definition: mhal_dma.h:236
dma_config specifies the DMA channel parameters for data transfer, such as transfer source...
Definition: mhal_dma.h:366
Software pointer, only for VFF DMA.
Definition: mhal_dma.h:225
int mtk_mhal_dma_pause(struct dma_controller *controller)
This function is used to pause one DMA channel.
move data from memory to peripheral
Definition: mhal_dma.h:180
dma_status
DMA dma_status definition.
Definition: mhal_dma.h:232
u32 addr_2
For FULL-SIZE DMA, addr_2 is dst_addr.
Definition: mhal_dma.h:374
int mtk_mhal_dma_vff_read_data(struct dma_controller *controller, u8 *buffer, u32 length)
This function is used to read data from FIFO of VFF DMA channel.
FULL-SIZE DMA.
Definition: mhal_dma.h:193
dma_dir
DMA data transfer direction definition.
Definition: mhal_dma.h:178
move data from peripheral to memory
Definition: mhal_dma.h:182
int mtk_mhal_dma_get_status(struct dma_controller *controller)
This function is used to get DMA channel status.
int mtk_mhal_dma_clock_enable(struct dma_controller *controller)
This function is used to enable DMA channel clock.
Select DMA transaction size as Byte (1-byte)
Definition: mhal_dma.h:246
enum dma_burst_type burst_type
Burst-type, only for FULL-SIZE DMA and HALF-SIZE DMA.
Definition: mhal_dma.h:338
void(* dma_isr_callback)(void *user_data)
This defines the function prototype of DMA interrupt service routines callback.
Definition: mhal_dma.h:294
void __iomem * base
DMA base address.
Definition: mhal_dma.h:427
prog_addr specifies the memory space address; only for HALF-SIZE DMA and VFF DMA. ...
Definition: mhal_dma.h:217
u8 int_en
Enable transfer completion interrupt for FULL-SIZE DMA and HALF-SIZE DMA, or enable FIFO data interru...
Definition: mhal_dma.h:330
Select DMA burst type as single-beat.
Definition: mhal_dma.h:262
u8 wrap_side
The side for using address-wrapping: source or destination, and only one side can activate address-wr...
Definition: mhal_dma.h:325
struct dma_ctrl * ctrls
DMA control setting.
Definition: mhal_dma.h:433
dma_ctrl specifies the DMA channel settings which control the DMA channel transfer mode...
Definition: mhal_dma.h:311