In the example C2H flow, loaddriver.sh loads the devices for all available channels. The dma_from_device user program transfers data from Card to host.
The example C2H flow sequence is as follows:
- Open device C2H and initialize the DMA.
- The user program allocates buffer pointer (based on size), passes pointer to read function with specific device (C2H) and data size.
- The driver creates descriptor based on size and initializes the DMA with descriptor start address. Also if there are any adjacent descriptor.
- The driver writes control register to start the DMA transfer.
- The DMA reads descriptor from host and starts processing each descriptor.
- The DMA fetches data from Card and sends data to host. After all data is transferred based on the settings, the DMA generates an interrupt to host.
- The ISR driver processes the interrupt to find out which engine is sending the interrupt and checks the status to see if there are any errors and also checks how many descriptors are processed.
- After the status is good, the drive returns transfer byte length to user side so it can check for the same.