Azure Sphere MT3620 M4 API Reference Manual
|
This section provides DMA M-HAL APIs(defined as Common Interface) to fully control the MediaTek DMA HW. More...
This section provides DMA M-HAL APIs(defined as Common Interface) to fully control the MediaTek DMA HW.
Functions | |
int | mtk_mhal_dma_config (struct dma_controller *controller) |
This function is used to configure one DMA channel. More... | |
int | mtk_mhal_dma_start (struct dma_controller *controller) |
This function is used to start one DMA channel. More... | |
int | mtk_mhal_dma_stop (struct dma_controller *controller) |
This function is used to stop one DMA channel. More... | |
int | mtk_mhal_dma_pause (struct dma_controller *controller) |
This function is used to pause one DMA channel. More... | |
int | mtk_mhal_dma_resume (struct dma_controller *controller) |
This function is used to resume one DMA channel. More... | |
int | mtk_mhal_dma_get_status (struct dma_controller *controller) |
This function is used to get DMA channel status. More... | |
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. More... | |
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. More... | |
int | mtk_mhal_dma_clear_irq_status (struct dma_controller *controller) |
This function is used to clear DMA HW status. More... | |
int | mtk_mhal_dma_dump_reg (struct dma_controller *controller) |
This function is used to dump DMA register for debug. More... | |
int | mtk_mhal_dma_clock_enable (struct dma_controller *controller) |
This function is used to enable DMA channel clock. More... | |
int | mtk_mhal_dma_clock_disable (struct dma_controller *controller) |
This function is used to disable DMA channel clock. More... | |
int | mtk_mhal_dma_reset (struct dma_controller *controller) |
This function is used to reset DMA channel. More... | |
int | mtk_mhal_dma_update_swptr (struct dma_controller *controller, u32 length_byte) |
This function is used to update VFF DMA channel swptr. More... | |
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. More... | |
int | mtk_mhal_dma_clr_dreq (struct dma_controller *controller) |
This function is used to clear dreq signal of DMA channel. More... | |
int mtk_mhal_dma_config | ( | struct dma_controller * | controller | ) |
This function is used to configure one DMA channel.
Usage: OS-HAL driver should call it before starting DMA. According to the DMA channel type,
users should set right dma_ctrl and dma_config value in dma_controller. Stop the DMA channel first
before calling this function.
[in] | controller | : The pointer of struct dma_controller. |
int mtk_mhal_dma_start | ( | struct dma_controller * | controller | ) |
This function is used to start one DMA channel.
Usage: OS-HAL driver should call it after configuring DMA successfully.
[in] | controller | : The pointer of struct dma_controller. |
int mtk_mhal_dma_stop | ( | struct dma_controller * | controller | ) |
This function is used to stop one DMA channel.
Usage: OS-HAL driver should call it after starting DMA. Calling this function will stop transfer immediately and DMA channel will return idle status.
[in] | controller | : The pointer of struct dma_controller. |
int mtk_mhal_dma_pause | ( | struct dma_controller * | controller | ) |
This function is used to pause one DMA channel.
Usage: OS-HAL driver should call it after starting DMA. After calling this function, DMA channel will complete last count data transfer and then be into pause status.
[in] | controller | : The pointer of struct dma_controller. |
int mtk_mhal_dma_resume | ( | struct dma_controller * | controller | ) |
This function is used to resume one DMA channel.
Usage: OS-HAL driver should call it after pausing DMA. Users call this function to cancel pause status for DMA channel.
[in] | controller | : The pointer of struct dma_controller. |
int mtk_mhal_dma_get_status | ( | struct dma_controller * | controller | ) |
This function is used to get DMA channel status.
Usage: If OS-HAL driver call MHAL API without DMA callback, it can call this API to get DMA channel status so as to check DMA channel working status.
[in] | controller | : The pointer of struct dma_controller. |
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.
Usage: Users should call this function carefully if DMA channel is running.
[in] | controller | : The pointer of struct dma_controller. |
[in] | param | : The parameter type whose value to be set. |
[in] | value | : The new parameter value. |
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.
Usage: Users should call this function carefully if DMA channel is running.
[in] | controller | : The pointer of struct dma_controller. |
[in] | param | : The parameter type whose value to be got. |
int mtk_mhal_dma_clear_irq_status | ( | struct dma_controller * | controller | ) |
This function is used to clear DMA HW status.
Usage: It's called in IRQ function to clear DMA HW IRQ status.
[in] | controller | : DMA controller used with the device. |
int mtk_mhal_dma_dump_reg | ( | struct dma_controller * | controller | ) |
This function is used to dump DMA register for debug.
Usage:Used for OS-HAL to dump DMA register.
[in] | controller | : DMA controller used with the device. |
int mtk_mhal_dma_clock_enable | ( | struct dma_controller * | controller | ) |
This function is used to enable DMA channel clock.
Usage:Used for OS-HAL to enable DMA channel clock before config.
[in] | controller | : DMA controller used with the device. |
int mtk_mhal_dma_clock_disable | ( | struct dma_controller * | controller | ) |
This function is used to disable DMA channel clock.
Usage:Used for OS-HAL to disable DMA channel clock.
[in] | controller | : DMA controller used with the device. |
int mtk_mhal_dma_reset | ( | struct dma_controller * | controller | ) |
This function is used to reset DMA channel.
Usage:Used for OS-HAL to reset DMA channel.
[in] | controller | : DMA controller used with the device. |
int mtk_mhal_dma_update_swptr | ( | struct dma_controller * | controller, |
u32 | length_byte | ||
) |
This function is used to update VFF DMA channel swptr.
Usage: Used for OS-HAL to update VFF DMA channel swptr. If user read data from vfifo or write data into vfifo, user should update swptr to control read pointer or write pointer of fifo control engine.
[in] | controller | : DMA controller used with the device. |
[in] | length_byte | : The updated byte count. It cannot be larger than vfifo size. |
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.
Usage:Used for OS-HAL to read data from FIFO of VFF DMA channel. This api will also update swptr after reading data.
[in] | controller | : DMA controller used with the device. |
[out] | buffer | : buffer for saving read data. |
[in] | length | : byte number which users want to read. It cannot be larger than vfifo size. |
int mtk_mhal_dma_clr_dreq | ( | struct dma_controller * | controller | ) |
This function is used to clear dreq signal of DMA channel.
Usage:Used for OS-HAL to clear dreq signal of DMA channel.
[in] | controller | : DMA controller used with the device. |