Wind River Support Network

HomeDefectsLIN7-5507
Fixed

LIN7-5507 : [WRL7/RCPL8] Zynq: problem when handling external IRQ - Outdated driver

Created: Jan 25, 2016    Updated: Dec 9, 2019
Resolved Date: Feb 20, 2017
Found In Version: 7.0.0.8
Fix Version: 7.0.0.23
Severity: Severe
Applicable for: Wind River Linux 7
Component/s: Kernel

Description

when trying to integrate a NFC device on their Xilinx Zynq SoC. Their board is similar to ZC702.

The system gets stuck when handling the device's interruption. They are trying to connect a NXP PN7120 connected on the i2c bus controller 0, and its IRQ PIN is PS_MIO0.

some useful info:
http://www.nxp.com/documents/application_note/AN11697.pdf
The driver is provided by NXP:
https://github.com/NXPNFCLinux/nxp-pn5xx
and the demo application too:
https://github.com/NXPNFCLinux/linux_libnfc-nci

When they interrupt kernel execution with JTAG probe debugger,they notice thati's always stuck in handle_IRQ(irq=52),
which matches GPIO IRQ:
Program received signal SIGINT, Interrupt.
0x800669b4 in arch_local_irq_restore (flags=<optimized out>) at kernel-source/arch/arm/include/asm/irqflags.h:152
152 asm volatile(
(gdb) bt
#0 0x800669b4 in arch_local_irq_restore (flags=<optimized out>) at kernel-source/arch/arm/include/asm/irqflags.h:152
#1 rcu_irq_exit () at kernel-source/kernel/rcu/tree.c:499
#2 0x80028800 in irq_exit () at kernel-source/kernel/softirq.c:403
#3 0x8000f230 in handle_IRQ (irq=52, regs=<optimized out>) at kernel-source/arch/arm/kernel/irq.c:83
#4 0x80008584 in gic_handle_irq (regs=0x0 <__vectors_start>) at kernel-source/drivers/irqchip/irq-gic.c:299
#5 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#6 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#7 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#8 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#9 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203 

The device tree is :
gpio0: gpio@e000a000 {
compatible = "xlnx,zynq-gpio-1.0";
#gpio-cells = <2>;
clocks = <&clkc 42>;
gpio-controller;
interrupt-parent = <&intc>;
interrupts = <0 20 4>;
reg = <0xe000a000 0x1000>;
emio-gpio-width = <64>;
gpio-mask-high = <0x0>;
gpio-mask-low = <0x5600>;
/* for NFC: */
interrupt-controller;
#interrupt-cells = <2>;
};

i2c0: i2c@e0004000 {
/* compatible = "cdns,i2c-r1p10"; from Xilinx generated source file */
compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; /* from Wind River BSP file */
/* status = "disabled"; from Xilinx generated source file */
clock-frequency = <100000>;
clocks = <&clkc 38>;
interrupt-parent = <&intc>;
interrupts = <0 25 4>;
reg = <0xe0004000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;

pn7120: pn7120@28 {
compatible = "nxp,pn547";
reg = <0x28>;
clock-frequency = <100000>;

interrupt-gpios = <&gpio0 0 0>; /* MIO0 (aka "IRQ_NFC" in schematic), rising edge */
enable-gpios = <&gpio0 85 0>; /* dummy value because pin is hard-corded on our board */
// interrupt-parent = <&gpio0>;
// interrupts = <0 0>; /* MIO0 (aka "IRQ_NFC" in schematic), rising edge */
};
};





Steps to Reproduce

The freeze occurs at demo app startup:
insmod pn5xx_i2c.ko
nfcDemoApp poll

FREEZE EXAMPLE:
root@localhost:~# nfcDemoApp poll
#########################################################################################
## NFC demo ##
###################pn54x_dev_open : 10,58
################################################################pn54x_dev_ioctl, cmd=1074063617, arg=1
######
## Poll mode activated pn544_enable power on
##
#########################################################################################
... press enter to quit ...

pn54x_dev_ioctl, cmd=1074063617, arg=0
pn544_disable power off
pn54x_dev_ioctl, cmd=1074063617, arg=1
pn544_enable power on
pn54x_dev_write : i2c_master_send returned -6
<FREEZE>



Program received signal SIGINT, Interrupt.
0x800669b4 in arch_local_irq_restore (flags=<optimized out>) at kernel-source/arch/arm/include/asm/irqflags.h:152
152 asm volatile(
(gdb) bt
#0 0x800669b4 in arch_local_irq_restore (flags=<optimized out>) at kernel-source/arch/arm/include/asm/irqflags.h:152
#1 rcu_irq_exit () at kernel-source/kernel/rcu/tree.c:499
#2 0x80028800 in irq_exit () at kernel-source/kernel/softirq.c:403
#3 0x8000f230 in handle_IRQ (irq=52, regs=<optimized out>) at kernel-source/arch/arm/kernel/irq.c:83
#4 0x80008584 in gic_handle_irq (regs=0x0 <__vectors_start>) at kernel-source/drivers/irqchip/irq-gic.c:299
#5 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#6 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#7 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#8 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203
#9 0x8056e580 in __irq_svc () at kernel-source/arch/arm/kernel/entry-armv.S:203


The device tree is :
gpio0: gpio@e000a000 {
compatible = "xlnx,zynq-gpio-1.0";
#gpio-cells = <2>;
clocks = <&clkc 42>;
gpio-controller;
interrupt-parent = <&intc>;
interrupts = <0 20 4>;
reg = <0xe000a000 0x1000>;
emio-gpio-width = <64>;
gpio-mask-high = <0x0>;
gpio-mask-low = <0x5600>;
/* for NFC: */
interrupt-controller;
#interrupt-cells = <2>;
};

i2c0: i2c@e0004000 {
/* compatible = "cdns,i2c-r1p10"; from Xilinx generated source file */
compatible = "xlnx,ps7-i2c-1.00.a", "cdns,i2c-r1p10"; /* from Wind River BSP file */
/* status = "disabled"; from Xilinx generated source file */
clock-frequency = <100000>;
clocks = <&clkc 38>;
interrupt-parent = <&intc>;
interrupts = <0 25 4>;
reg = <0xe0004000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;

pn7120: pn7120@28 {
compatible = "nxp,pn547";
reg = <0x28>;
clock-frequency = <100000>;

interrupt-gpios = <&gpio0 0 0>; /* MIO0 (aka "IRQ_NFC" in schematic), rising edge */
enable-gpios = <&gpio0 85 0>; /* dummy value because pin is hard-corded on our board */
// interrupt-parent = <&gpio0>;
// interrupts = <0 0>; /* MIO0 (aka "IRQ_NFC" in schematic), rising edge */
};
};

Other Downloads


Live chat
Online