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
Visitor arunjs
Visitor
580 Views
Registered: ‎01-27-2019

Accessing interrupts from AXI timer in PL using Linux

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!

0 Kudos
3 Replies
Explorer
Explorer
549 Views
Registered: ‎09-28-2018

Re: Accessing interrupts from AXI timer in PL using Linux

HI @arunjs 

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/

My post : https://forums.xilinx.com/t5/Embedded-Linux/Axi-DMA-access-via-user-space-configuration/td-p/954942

Web : https://yurovsky.github.io/2014/10/10/linux-uio-gpio-interrupt.html

Moderator
Moderator
528 Views
Registered: ‎09-12-2007

Re: Accessing interrupts from AXI timer in PL using Linux

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:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842490/Testing+UIO+with+Interrupt+on+Zynq+Ultrascale

 

Note: there are some typo here with respect to devicetree. Thids should look like

&axi_gpio_0 {
    compatible = "generic-uio";
};
0 Kudos
Explorer
Explorer
512 Views
Registered: ‎09-28-2018

Re: Accessing interrupts from AXI timer in PL using Linux

Hi @arunjs 

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: 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841648/TTC+Standalone+Driver

 

Deville

0 Kudos