stevers Posted December 19, 2022 Share Posted December 19, 2022 Working with a zybo-z7 (XC7Z010-1CLG400C) trying to register a uio driver over the button 4 (mio50) gpio connected to the PS. The design already included a gpio module as: / { amba: axi { gpio0: gpio@e000a000 { compatible = "xlnx,zynq-gpio-1.0"; #gpio-cells = <2>; clocks = <&clkc 42>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; interrupt-parent = <&intc>; interrupts = <0 20 4>; reg = <0xe000a000 0x1000>; }; }; }; I have added the following btn_4 dts node in system-user.dtsi: / { chosen { bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio"; }; ... btn_4 { compatible ="generic-uio"; interrupt-parent = <&gpio0>; // mio 50, rising edge interrupts = <50 1>; }; }; There kernel config includes: CONFIG_UIO=y CONFIG_UIO_PDRV_GENIRQ=y On booting the device with the new uio node, I see the btn_4 registered in the interrupt table: root@Petalinux-2022:~# cat /proc/interrupts CPU0 CPU1 ... 66: 0 0 zynq-gpio 50 Edge btn_4 ... But after pressing the button I don't see the interrupt count increase in /proc/interrupts CPU0 CPU1 ... 66: 0 0 zynq-gpio 50 Edge btn_4 ... Is there something incorrect about how the uio interrupt is configured for the new btn_4 node? Link to comment Share on other sites More sharing options...
0 Ionel Posted December 19, 2022 Share Posted December 19, 2022 Try using it as gpio. Export it, set as input direction and check it's value when pressed to see if it actualy works before using with generic-uio Link to comment Share on other sites More sharing options...
0 stevers Posted December 19, 2022 Author Share Posted December 19, 2022 (edited) Good suggestion lonel. To test the PS side mio I successfully toggled the LED4 at mio 7. I exported the gpio at 905+7 = 912 as an output as below: echo 912 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio912/direction echo 1 > /sys/class/gpio/gpio912/value echo 0 > /sys/class/gpio/gpio912/value Not seeing an input chage at BTN4, and BTN5 mio mappings: echo 955 > /sys/class/gpio/export echo 956 > /sys/class/gpio/export echo in > /sys/class/gpio/gpio955/direction echo in > /sys/class/gpio/gpio956/direction The following always return the same value when pressing the btn4 and btn5 cat /sys/class/gpio/gpio955/val cat /sys/class/gpio/gpio956/val Thanks Edited December 19, 2022 by stevers Link to comment Share on other sites More sharing options...
Question
stevers
Working with a zybo-z7 (XC7Z010-1CLG400C) trying to register a uio driver over the button 4 (mio50) gpio connected to the PS.
The design already included a gpio module as:
/ { amba: axi { gpio0: gpio@e000a000 { compatible = "xlnx,zynq-gpio-1.0"; #gpio-cells = <2>; clocks = <&clkc 42>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; interrupt-parent = <&intc>; interrupts = <0 20 4>; reg = <0xe000a000 0x1000>; }; }; };
I have added the following btn_4 dts node in system-user.dtsi:
/ { chosen { bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio"; }; ... btn_4 { compatible ="generic-uio"; interrupt-parent = <&gpio0>; // mio 50, rising edge interrupts = <50 1>; }; };
There kernel config includes:
CONFIG_UIO=y CONFIG_UIO_PDRV_GENIRQ=y
On booting the device with the new uio node, I see the btn_4 registered in the interrupt table:
root@Petalinux-2022:~# cat /proc/interrupts CPU0 CPU1 ... 66: 0 0 zynq-gpio 50 Edge btn_4 ... But after pressing the button I don't see the interrupt count increase in /proc/interrupts CPU0 CPU1 ... 66: 0 0 zynq-gpio 50 Edge btn_4 ...
Is there something incorrect about how the uio interrupt is configured for the new btn_4 node?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now