How can I catch a SGI in Linux in an AMP system?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I catch a SGI in Linux in an AMP system?

2,666 Views
christoph8446
Contributor II

Hello,

I have a dual core system. On Core 0 I use Linux and on Core 1 I use a Bare Metal System. I send a software generated interrupt from my Bare Metal System to Linux but I cannot catch the interrupt in Linux. How can I register a SGI interrupt in Linux? Request_irq() returns an error for SGI’s..

Thanks!

Labels (5)
8 Replies

2,114 Views
wangzhimin
Contributor II

Did you solved this problem, I also encountered this problem

0 Kudos

2,114 Views
christoph8446
Contributor II

Yes, I got it. In the directory /arch/arm/kernel/smp.c you can find the function handle_IPI. There is a SWITCH CASE inside the function where you can add a new case for your IPI. The case number is equal to IPI number!

 

Regards

Chris

2,114 Views
wangzhimin
Contributor II

If I need to use SGI to capture an interrupt in both cores in AMP mode, do I need to register the interrupt function in both cores separately, will this interfere?

Thanks.

0 Kudos

2,114 Views
christoph8446
Contributor II

I use the IPI only in one direction from bare-metal to linux. Maybe you can search for something like send IPI in linux sources...

In my opinion you must register the interrupt function in both cores separately.

0 Kudos

2,114 Views
mihaitaivascu
Contributor III

Hi Chris,

    How did you registered the irq handler on Linux side? You have an example?

    Is it correct to use SMP handle_IPI in AMP scheme?

    I have the same requirements as the ones described in this topic.

    request_irq does not work for me I get -22 error and I have the SGI defined in intc node in device tree.

    I need to catch it in some device driver.

Best regards,

         Mihaita

0 Kudos

2,114 Views
wangzhimin
Contributor II

Thank you for your answer, and I would like to ask another question. What API to use in a linux system to interrupt a bare-metal system.
Thanks again.

0 Kudos

2,114 Views
igorpadykov
NXP Employee
NXP Employee

Hi Chris

seems this is not supported in bsp, one can look at suggestions on

Inter processor Interrrupts in ARM cortex A9 ( How To write an handler for Software generated Interr... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,114 Views
christoph8446
Contributor II

Hi Igor,

Thanks for your reply. I have looked at your link and I think the solution in the link was that they used the function set_ipi_handlers instead of request_irq. The function set_ipi_handlers is from XILINX BSP and not available in freescale's /smp.c. There should be a way to register an ISR for interrupt 0..15 (SGI).

Regards

Chris

0 Kudos