5.2.3. intel_ssgdma_global.c
Prototype |
intel_ssgdma_return_e intel_ssgdma_enable_prefetch_engine(intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. |
Description |
Enable prefetcher engine. |
Prototype |
int intel_ssgdma_prefetch_engine_is_enabled(intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
INTEL_SSGDMA_NO : 0 -> If disabled. INTEL_SSGDMA_YES : 1 -> If enabled. INTEL_SSGDMA_ERROR : -1 -> Invalid input device. |
Description |
check if prefetcher engine is enabled. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_reset_prefetch_engine(intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. E_INTEL_SSGDMA_BUSY : -5 -> Previous prefetcher reset is not completed. Please enable prefetcher before next reset |
Description |
Reset prefetcher engine. This function only sets the reset prefetcher engine bit. Please refer to intel_ssgdma_global_soft_pause and intel_ssgdma_global_soft_reset for the prefetcher soft reset flow. |
Prototype |
int intel_ssgdma_watchdog_timer_set_state(intel_ssgdma_dev *dev, bool enable) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. |
Description |
Enables/disable watchdog timer |
Prototype |
intel_ssgdma_return_e intel_ssgdma_set_writeback_delay(intel_ssgdma_dev *dev, uint32_t delay) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device or delay > 20 bits |
Description |
Set writeback delay in WB_INTR_TIMEOUT register. Check if delay is within 20 bits. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_set_watchdog_timeout(intel_ssgdma_dev *dev, uint32_t timeout) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device or delay > 20 bits |
Description |
Set writeback delay in WATCHDOG_TIMEOUT register. Check if delay is within 20 bits. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_sync_hw_sw_config(intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. E_INTEL_SSGDMA_HW_SW_MISMATCH : -8 -> the generated sw configuration does not match with the hardware. |
Description |
Read from IP_PARAM1 register to check if the generated sw configuration matches with the hw. For NiosV system, this can be used to detect error, when the hw design in platform designer is modified, but the bsp for the software is not regenerated. If INTEL_SSGDMA_AUTO_CONF_SW is enabled, the driver automatically syncs the configuration. If disabled and configuration does not match; the driver blocks all attempts to setup port when calling intel_ssgdma_setup_device_port. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_global_soft_pause(intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. All device port paused. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. E_INTEL_SSGDMA_BUSY : -5 -> timeout for prefetcher reset. E_INTEL_SSGDMA_TIMEOUT : -6 -> timeout for device port paused |
Description |
This function pauses all dma transaction for the input device. The function blocks until the prefetcher engine is reset and all device ports are paused. If one of the ports failed to pause before timeout, this function stops the flow and return E_INTEL_SSGDMA_TIMEOUT. If blocking is not desired, refer to the flow in this function to implement their own function. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_global_soft_reset(intel_ssgdma_dev *dev, bool reuse_setup) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. E_INTEL_SSGDMA_BUSY : -5 -> Prefetcher running/port not paused. E_INTEL_SSGDMA_TIMEOUT : -6 -> timeout for device port reset. |
Description |
Before calling this function, prefetcher engine must not run and all device ports must be paused. You can pause the device by calling intel_ssgdma_global_soft_pause and ensure that E_INTEL_SSGDMA_OK is returned. This function resets all device ports. Function blocks until all device ports are reset. After reset csr of all device ports is reset to its initial value. If the input reuse_setup is set, you can call intel_ssgdma_global_resume to resume normal operation. If not, please call intel_ssgdma_setup_device_port to setup the port again before intel_ssgdma_global_resume.
Note: Soft pause is currently not supported for H2D_ST and H2D_MM ports.
|
Prototype |
intel_ssgdma_return_e intel_ssgdma_global_resume(intel_ssgdma_dev *dev, bool stop_on_error) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> All device ports are resumed. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid arguments. E_INTEL_SSGDMA_CANT_REUSE_SETUP : -10 -> unable to resume as previous setup is released. Please call intel_ssgdma_setup_device_port, before resume. E_INTEL_SSGDMA_NOT_ALL_RESUMED : -13 -> stop_on_error = false and some ports failed to resume, because they are not setup. Please debug to check if this is intended. |
Description |
This function resumes all device port after paused or reset. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_get_device_errors_flags( intel_ssgdma_dev *dev, uint16_t *error_flag) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. *error_flag is valid. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. |
Description |
Get the value of device_errors_flags. These flags are set to indicate abnormal operation during interrupt. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_clear_device_errors_flags( intel_ssgdma_dev *dev) |
Include |
<intel_ssgdma.h> |
Parameters |
dev - pointer to the SSGDMA device structure. |
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. Flags are cleared. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid input device. |
Description |
Clear the value of device_errors_flags. These flags are set to indicate abnormal operation during interrupt and needs to be cleared by the user. |