03-10-2015 07:32 AM
We have been trying to get the generic uio_dmem_genirq UIO driver working so we can try the AD9361 userspace driver/application example from Analog Devices. Along the way I believe we have identified a bug with the value assigned to priv->dmem_region_start in uio_dmem_genirq_probe(). In the current driver this is effectively set to the size of the pdev->resource array but, if there are non-memory resources defined, eg, interrupts, this appears to be wrong as when the device is opened it indexes uioinfo->mem incorrectly in uio_dmem_genirq_open() and fails to allocate any memory.
In the patch attached we have tried to correct this. The patch also includes code, based on this driver in Analog Devices' Linux repository, to add support for "uio,number-of-dynamic-regions" and "uio,dynamic-regions-sizes" entries in the device tree and it also replicates the "of_id" module parameter code from the current uio_pdev_genirq driver so this driver can be specified in the device tree without further modification and, as with the current uio_pdev_genirq driver, allows the driver to be used with no interrupt assigned when used in this way.
I've shared this patch here in case it helps anyone else trying to get this driver to work.
03-10-2015 07:46 AM
03-10-2015 08:27 AM
AD have developed and recommend their IIO driver for these devices but we are using a kernel based on the latest offering from Xilinx's github. We had hoped to simply copy the IIO driver files for the new part and build them into the Xilinx kernel but there appear to be many significant changes to the core IIO driver files between the two repositories, which left us a bit stumped. We remain hopeful that at some point the updated AD code will find its way into Xilinx's kernel. For the time being, however, we have instead decided to investigate the userspace driver approach whilst we try and prove our hardware.