UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer tnjames
Observer
5,919 Views
Registered: ‎07-08-2013

Bug in uio_dmem_genirq UIO driver + support for device tree binding

Hi

 

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.

 

Tim

Tags (3)
0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
5,914 Views
Registered: ‎09-10-2008

Re: Bug in uio_dmem_genirq UIO driver + support for device tree binding

Hi Tim,

Can you point me to that example userspace driver/application from ADI?

Thanks
John
0 Kudos
Observer tnjames
Observer
5,905 Views
Registered: ‎07-08-2013

Re: Bug in uio_dmem_genirq UIO driver + support for device tree binding

Hi John

 

The source for AD's example for the AD9361/AD9364 can be found here https://github.com/analogdevicesinc/ad9361, using the 'linux' build with device tree entries taken from here.

 

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.

 

Cheers

 

Tim

0 Kudos