03-26-2019 06:54 AM
Hi,I want to access AXI timer in PL using linux to load a value and catch the interrupt to execute an ISR when the timer expires.Can i access it directly from linux or is it necessary to use a driver for that?If driver is needed,can i use the xilinx provided driver for timer?
Any help is appreciated!
03-28-2019 09:56 AM - edited 03-29-2019 02:11 AM
I'm struggling with the same issues, documentation is limited. I did however stumble upon an uio_pdrv_genirq example on a blog somewhere with exact your topic handled. See links below..
I think you should look at the uio_pdrv_genirq driver indeed, which if installed generated a /dev/uio* file where you can poll any interrupt events. You need to bind it in the device tree and load it into the kernel ( It is set default to "m" in the kernel config file, so you'll need to change that and rebuild the kernel or load the module after a boot.
The kernel does not do interrupts like the low level u-controllers do, because the kernel is preemptive you'll never know when your threads are being handled. If you want interrupts close to the kernel, you'll need to write your own device driver.
Web tutorial on counters: http://fpga.org/2013/05/28/how-to-design-and-access-a-memory-mapped-device-part-two/
03-29-2019 01:34 AM
You could just create a UIO driver for this, and write to this IP's register map. Something similar to use case in the wiki below:
Note: there are some typo here with respect to devicetree. Thids should look like
03-29-2019 09:57 AM
Quick responce on your thread here: I've found on this forum an example code for user space. @achutha from Xilinx attached this once to a forum post.
The code simply polls for an interrupt coming from the generic kernel driver.
I also found this for you: