cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pullanlu
Observer
Observer
14,490 Views
Registered: ‎04-21-2012

Zynq Software Generated Interrupts (SGI) questions

I have a few questions about SGI:

 

1. Does Xilinx-Linux use Zynq's SGI?

2. If yes to 1, is there a way to register a callback function to execute when an SGI occurs? and how to trigger a SGI interrupt?

3. If no to 1, how do I register an ISR to handle SGI interrupt(s)? and how to trigger a SGI interrupt (other than using devmem to poke SGI register)?

4. Do you have sample code?

 

Thanks

 

Pullan

0 Kudos
10 Replies
marcel5398757
Newbie
Newbie
14,153 Views
Registered: ‎04-11-2013

i have the same question. Have you an answer for this problem. i will program in C.

0 Kudos
zackshef
Visitor
Visitor
14,073 Views
Registered: ‎05-09-2013

I'm also looking at doing something similar. I couldn't find much but I found this. It is used for generating interrupts in the PL. Perhaps you and I could learn how to use it for SGI. Looks like it uses the xscugic.h library.


Good luck!

-Zack
-Zack
Tags (4)
0 Kudos
13,562 Views
Registered: ‎11-04-2013

Did you manage to get this to work? 

0 Kudos
vipersnh
Newbie
Newbie
12,389 Views
Registered: ‎12-17-2014

Even I want the same, except I want to use UIO driver for handling SGI on Linux side.

BTW, i was able to generate SGI interrupts of ID0-ID4 by simply writing to GIC register ICDSGIR manually from Linux mmap'ing the GIC address space.

I saw that interrupts were indeed generated by viewing at /proc/interrupts file

 

 

 

0 Kudos
kenkrz
Observer
Observer
11,952 Views
Registered: ‎03-18-2015

Did you ever get a solution to this problem? It seems like a great idea for an AMP configuration for the BareMetal CPU to signal the Linux CPU through a SGI.

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
11,947 Views
Registered: ‎09-10-2008

Hi,

Yes this does work as we are using it in a newer AMP framework that you'll see more about in the future.

Linux SMP uses IPI to communication between the CPUs.

You can also see some more details about this in the Inter A9 Communications video/PDF out on xilinx.com at

http://www.xilinx.com/member/zynq_videos/index.htm?@playlistCombo=3944811176001&bctid=3946101407001

Thanks,
John
0 Kudos
10,788 Views
Registered: ‎05-16-2015

Hi,

could you be more specific?


The video you pointed to is about the DMA and doesn't mention anything about SGI.
I also read/watched this: http://www.xilinx.com/member/zynq_videos/pdf/Zynq-Inter-A9-Communication.pdf

It seems that what we want to do is possible, but the video doesn't say anything about any implementation or example available...

 

Generating interrupts from Linux (CPU0) to the Baremetal application (CPU1) is not an issue, it is as easy as:
gic_raise_softirq(cpumask_of(1), <SGI_n>);

 

Generating an interrupt from the CPU0 to CPU1 is also quite simple:

XScuGic_SoftwareIntr(&GicInst,<SGI_N>, XSCUGIC_SPI_CPU0_MASK /*CPU DST*/); //CPU0=1, CPU1=2

 

Doing the same from the Linux application is rather undocumented...

Trying to register a SGI interrupt using:

request_irq()

is always producing an error. Even thaugh /proc/interrupts do not shows that are in use...

 

Do you have any input here?

 

Thanks

0 Kudos
prasanna_mn
Observer
Observer
6,270 Views
Registered: ‎11-10-2016

Hi,

 

We are using Zynq7000 in AMP mode, Linux(CPU 0) and Freertos (CPU 1).

 

Need to send interrupt from CPU 0 to CPU 1.

 

In Linux Application when I use #include <asm/irqchip/arm-gic.h>


fatal error: linux/irqchip/arm-gic.h: No such file or directory   

 

Do you have any suggestion, Is any kernel configuration is needed??

 

Thanks

Prasanna

0 Kudos
moons520
Visitor
Visitor
2,904 Views
Registered: ‎07-30-2017

I have the same question. Have you an answer for this problem?

Linux(cpu0) send SGI to Baremetal(cpu1).

 

 

Thanks.

 

moons520

0 Kudos
age_sdu
Visitor
Visitor
2,314 Views
Registered: ‎03-10-2016

Hi. Did you ever get it working?

:-)

0 Kudos