I am developing a device driver suitable for the Linux RapidIO Subsystem (https://www.kernel.org/doc/html/v5.4/driver-api/rapidio/index.html) which must drive an FPGA in which are instantiated 3 DMA IPs (Intellectual Property) working together with a SRIO IP.

At the moment the code I wrote only implements the maintenance functions verified through a user space test application which opens "/dev/rio_mport0" and executes on it an ioctl passing RIO_MPORT_MAINT_XXXXX defined in https://elixir.bootlin.com/linux/v5.15/source/include/uapi/linux/rio_mport_cdev.h#L237

The next step is to generate traffic on the RAPID_IO network: this means to be able to exchange on the RIO net the N_READ/N_WRITE/N_WRITE_R transactions. If I understand correctly, the way provided by the Linux RapidIO Subsystem to carry out these transactions is to execute an ioctl passing RIO_TRANSFER (https://elixir.bootlin.com/linux/v5.15/source/include/uapi/linux/rio_mport_cdev.h#L269): this ioctl systematically fails if the dma_device included in rio_mport (https://elixir.bootlin.com/linux/v5.15/source/include/linux/rio.h#L291) is unable to provide channels ( https://elixir.bootlin.com/linux/v5.15/source/drivers/rapidio/devices/rio_mport_cdev.c#L651). So I think it's mandatory to implement the dma_device included in rio_mport and register it on the dma_engine.

However, the supplier of the 3 IP DMAs makes available the Linux Device Driver which drives these 3 IP DMAs; this driver registers itself in dma_engine. My intention is therefore to use the dma_engine API to implement the device_XXX functions present in dma_device (https://elixir.bootlin.com/linux/v5.15/source/include/linux/dmaengine.h#L887).

Questions:

  1. The path I want to follow is it correct?
  2. What's the best way to implement the dma_device included in rio_mport to reuse the dma device drivers already present in dma_engine?

Thanks in advance!

0

There are 0 best solutions below