cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
4,782 Views
Registered: ‎10-14-2015

OpenAMP - CPU0 with LInux and CPU 1 with baremetal - Interrupt not triggered

Hello everyone,

I have an issue with interrupts with openamp configuration:
 
I have a Zynq-7000 processor. The first core runs linux (Petalinux 2017.2) and the second core
runs a bare-metal application.

I use a Triple Timer Counter (ttc 1 with intterupt id 69) to generate interupts periodically.
When running the baremetal without linux and without the OpenAMP configration in the bsp, it works. Interrupt are triggered.
When running the full system (OpenAMP enable in bsp, -DUSE_AMP=1 and Proxy=false, app launch from linux master), interrupts do not trigger.

I know that using the flag -DUSE_AMP=1 affects the interrupt behavior, as it is the master that initialize the interrupts device.
It seems like I don't know how to have the master initialize correctly the interrupts for the timer.

I tried disabling the clock and adding the clk_ignore_unused to boot arguments like specified here: http://www.wiki.xilinx.com/Device+Tree+Tips#Clocks
I used ttc0 and ttc1, none of them works.
Weird: RPMsg, which use IPI, works.

The content of zynq-7000.dtsi for ttc timers
ttc0: timer@f8001000 {
        interrupt-parent = <&intc>;
        interrupts = <0 10 4>, <0 11 4>, <0 12 4>;
        compatible = "cdns,ttc";
        clocks = <&clkc 6>;
        reg = <0xF8001000 0x1000>;
};

ttc1: timer@f8002000 {
        interrupt-parent = <&intc>;
        interrupts = <0 37 4>, <0 38 4>, <0 39 4>;
        compatible = "cdns,ttc";
        clocks = <&clkc 6>;
        reg = <0xF8002000 0x1000>;
};


Any ideas or direction I should look at?

0 Kudos
5 Replies
Highlighted
Contributor
Contributor
4,370 Views
Registered: ‎01-18-2018

Hi Eric,

just found your issue here. I am using the following configuration (very similar to yours):

- Linux on CPU0

- Baremetal APP on CPU1 with -DUSE_AMP=1

 

APP works as expected when launched alone in CPU0 or CPU1 without -DUSE_AMP=1 setup. When using Linux, the system completely freezes. I tryed the following setups:

- Linux CPU0 and APP on CPU1 with -DUSE_AMP=1. When APP is launched using

                                                                                                                     
user@user:~$ sudo ./devmem 0xfffffff0 w 0x30000000                                                                                                                            
/dev/mem opened.                                                                                                                                                                
Memory mapped at address 0xb6f8b000.                                                                                                                                            
Value at address 0xFFFFFFF0 (0xb6f8bff0): 0xFFFFFF2C                                                                                                                            
Written 0x30000000; readback 0x30000000       

Linux got trapped by the interrupt launched from APP and hangs on the following kernel message:

 

unexpected IRQ trap at vector 00                                                                                                                                                

Did you get any chance to find the correct configuration?

 

Thanks,

Luca

 

0 Kudos
Contributor
Contributor
4,361 Views
Registered: ‎01-18-2018

Hi,

 

solved for me. The solution was indeed in a copy of this thread

 

https://forums.xilinx.com/t5/OpenAMP/CPU0-with-PetaLinux-2017-2-and-CPU1-Baremetal-Interrupt-not/m-p/795635

 

where the user can select which CPU is triggered for a specific interrupt source.

 

 

XScuGic_InterruptMaptoCpu(&InterruptController, CPU_ID, INTERRUPT_ID);

 

 

PLEASE NOTE. In 2016.3 there is an issue with the XScuGic_InterruptMaptoCpu implementation in xscugic.c

The source code has to be changed due to an erroneous OR's operation and misleading CPU_ID reference. The following code works for my side (custom XScuGic_myInterruptMaptoCpu call)

 

void XScuGic_myInterruptMaptoCpu(XScuGic *InstancePtr, u8 Cpu_Id, u32 Int_Id)
{
	u32 RegValue, Offset;
	RegValue = XScuGic_DistReadReg(InstancePtr,
			XSCUGIC_SPI_TARGET_OFFSET_CALC(Int_Id));

	Offset =  (Int_Id & 0x3U);

	RegValue = (RegValue & (~(0xFFU << (Offset*8U))) );
	RegValue |= ((Cpu_Id+1) << (Offset*8U));

	XScuGic_DistWriteReg(InstancePtr,
						 XSCUGIC_SPI_TARGET_OFFSET_CALC(Int_Id),
						 RegValue);
}

Where OR's operation is replaced by an AND's and Cpu_Id+1 is added.

 

Reference: https://forums.xilinx.com/t5/OpenAMP/Routing-all-interrupts-from-PL-to-PS1-linux-on-PS0/td-p/699244

 

Best,

 

L

0 Kudos
Highlighted
Contributor
Contributor
4,312 Views
Registered: ‎01-18-2018

As a reference, the

XScuGic_InterruptMaptoCpu(&InterruptController, CPU_ID, INTERRUPT_ID);

function has been patched on the 2017.4 release (xscugic.c version 3.5)

 

link: https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/scugic/src/xscugic.c

 

Best,

Luca

Highlighted
1,335 Views
Registered: ‎01-09-2019

Have you solves this issue. I am also facing same issue where in CPU 1  baremetal interrupts are not triggered by CPU0 Linux Master.
Can you share your device tree if possible

Thanks in advance.

0 Kudos
Highlighted
Contributor
Contributor
363 Views
Registered: ‎06-08-2017

Hi, 

Does anyone solve this issue?

unexpected IRQ trap at vector 00    

This happend also in the 2019.2 toolchain.

 

Best Regards

 

0 Kudos