In the example H2C flow, loaddriver.sh loads devices for all available channels. The dma_to_device user program transfers data from host to Card.
The example H2C flow sequence is as follows:
- Open the H2C device and initialize the DMA.
- The user program reads the data file, allocates a buffer pointer, and passes the pointer to write function with the specific device (H2C) and data size.
- The driver creates a descriptor based on input data/size and initializes the DMA with descriptor start address, and if there are any adjacent descriptor.
- The driver writes a control register to start the DMA transfer.
- The DMA reads descriptor from the host and starts processing each descriptor.
- The DMA fetches data from the host and sends the data to the user side. After all data is transferred based on the settings, the DMA generates an interrupt to the 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. It 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.