cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jasoncc
Visitor
Visitor
5,927 Views
Registered: ‎12-26-2014

Issues with PS-SPI in linux

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,

 

 

Tags (3)
0 Kudos
Reply
4 Replies
trenz-al
Scholar
Scholar
5,917 Views
Registered: ‎11-09-2013

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

0 Kudos
Reply
jasoncc
Visitor
Visitor
5,893 Views
Registered: ‎12-26-2014

Thank you for the timely reply! I also note that there is a known issue about PS-SPI, the #AR47511. I want to know whether it applies itself to "XC7Z020 1CLG400". (I have a SPI IP core working as a master, and a SPI slave device, trf7970a chip, connected to its SS0). Thanks!
0 Kudos
Reply
trenz-al
Scholar
Scholar
5,884 Views
Registered: ‎11-09-2013

does not matter what zynq, the PS part is the same always

0 Kudos
Reply
lizhanqiang
Newbie
Newbie
610 Views
Registered: ‎09-28-2018

hello,i want to know how to find the nfc application, and how to use the driver to power on (send a command to trf7970a chip), so that i can test whethre the nfc chip work or not. Any help will be greatly appreciated.
0 Kudos
Reply