12-26-2014 10:04 AM
Tool: Vivado 2014.4
chip: zc7z020
linux: xlnl-linux tag v2014.4 (3.17)
u-boot: tag v2014.v
Hi,
I have built a simple zynq PS with "spi 0" turned on, working as a SPI master. The slave is trf7970a (a TI NFC chip).
The NFC chip (trf7970a) need an interrupt (IRQ request) line to connect with. So I routed the trf7970a's irq line to a MIO pin (work as a GPIO pin).
At first, I couldn't insmod trf7970a driver (trf7970a.ko), because it failed requesting irq.
I noted that the spi 0's irq number (58) was already registerd. But I don't know what it meant and whether I can use it?
So I modified the device-tree, added a custom attribue named "int-gpio" in "nfc0" node (which in spi0) with value "<&gpio0 48 0>". Then I modified the interrupt register's function in trf7970a's driver, invoked "gpio_to_irq()" to get a valid irq number, and registered the irq. (I also referred to "<KERNEL_PATH>/driver/input/keyboard/gpio_keys.c" ). After that, I succeeded in loading (insmod) driver.
I can see the interrupt registered.
zynq:~# cat /proc/interrupts
CPU0 CPU1
144: 0 0 zynq-gpio 48 trf7970a
When I open nfc application which controls the driver to power on (send a command to trf7970a chip), the linux system will hang.
Sometimes the following messages presented on the console:
INFO: rcu_preempt self_detected stall on CPU { 0} (t=0001 jiffies g=76 c=75 1=527)
Task dump for CPU0:
[<40014764>] (unwind_backtrack) from .....
[....] (show_stack) from ....
[....] (rcu_dump_cpu_stacks) from ....
[....] (rcu_check_callbacks) from ....
[....] (updae_process_times) from ...
[....] (tick_sched_timer) from ...
....
[....] (handle_percpu_devid_irq_) from ...
[....] (generic_handle_irq) from ...
[....] (handle_IRQ) from ...
[....] (gic_handle_irq) from ...
...
Any help will be greatly appreciated.
Regards,
12-26-2014 11:05 AM
well first the interrupt vom dem SPI device has nothing todo with the interrupts from the SPI IP core.
so if your SPI device needs an interrupt you must connect it to some interrupt source, this could be GPIO also configured to generate interrupt.
but all in all the issue has nothing todo with Zynq.. more with linux kernel
12-27-2014 06:48 AM
12-27-2014 10:44 AM
does not matter what zynq, the PS part is the same always
09-28-2018 07:23 PM