Scalable Scatter-Gather DMA Intel® FPGA IP User Guide

ID 823097
Date 4/07/2025
Public
Document Table of Contents

5.2.3. intel_ssgdma_global.c

Table 76.  intel_ssgdma_enable_prefetch_engine  

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. 

Table 77.  intel_ssgdma_prefetch_engine_is_enabled 

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. 

 
Table 78.  intel_ssgdma_reset_prefetch_engine 

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. 

 
Table 79.  intel_ssgdma_watchdog_timer_set_state

Prototype 

int intel_ssgdma_watchdog_timer_set_state(intel_ssgdma_dev *dev, bool enable) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev      - pointer to the SSGDMA device structure
  • enable - 1 for enable or 0 for disable

Return 

E_INTEL_SSGDMA_OK                                  :  0  -> Success. 

E_INTEL_SSGDMA_INVALID_ARGUMENT : -1  -> Invalid input device. 

Description 

Enables/disable watchdog timer 

Table 80.  intel_ssgdma_set_writeback_delay  

Prototype 

intel_ssgdma_return_e intel_ssgdma_set_writeback_delay(intel_ssgdma_dev *dev, uint32_t delay) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev    - pointer to the SSGDMA device structure. 
  • delay - delay[2ns] (width: 20 bits). 

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. 

Table 81.  intel_ssgdma_set_watchdog_timeout  

Prototype 

intel_ssgdma_return_e intel_ssgdma_set_watchdog_timeout(intel_ssgdma_dev *dev, uint32_t timeout) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev - pointer to the SSGDMA device structure
  • timeout - timeout[2ns] (width: 20 bits)

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. 

Table 82.  intel_ssgdma_sync_hw_sw_config

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. 

Table 83.  intel_ssgdma_global_soft_pause 

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. 

Table 84.  intel_ssgdma_global_soft_reset

Prototype 

intel_ssgdma_return_e intel_ssgdma_global_soft_reset(intel_ssgdma_dev *dev, bool reuse_setup) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev - pointer to the SSGDMA device structure
  • reuse_setup - reuse previous setup

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.
Table 85.  intel_ssgdma_global_resume

Prototype 

intel_ssgdma_return_e intel_ssgdma_global_resume(intel_ssgdma_dev *dev, bool stop_on_error) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev                     - pointer to the SSGDMA device structure
  • stop_on_error  - stop resuming other ports, if the previous one has error

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. 

Table 86.  intel_ssgdma_get_device_errors_flags  

Prototype 

intel_ssgdma_return_e intel_ssgdma_get_device_errors_flags( 

    intel_ssgdma_dev *dev, uint16_t *error_flag) 

Include 

<intel_ssgdma.h> 

Parameters 

  • dev - pointer to the SSGDMA device structure
  • error_flag  - pointer to return the device error flags

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. 

Table 87.  intel_ssgdma_clear_device_errors_flags 

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.