cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,732 Views
Registered: ‎10-17-2018

GPIO mapping of Zynq on zedboard

Jump to solution

Hi,

 

From the page:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842398/Linux+GPIO+Driver

> root@xilinx-zc702-2017_2:~# cd /sys/class/gpio/
> root@xilinx-zc702-2017_2:~# ls
  export    gpiochip906    unexport
> root@xilinx-zc702-2017_2:/sys/class/gpio# cat gpiochip906/label
  zynq_gpio
  The above line indicates that gpio 0th pin starts from 906 and ends at 1023 (GPIO has total 118 pins for Zynq)

I got to know that the GPIO start index is 906 for the ZYNQ of my zedboard.

 

But I cannot map the GPIO number(such 906+10=916) to the pin name and number on the chip zynq.

 

is there any doc to guide me about the mapping?

 

Best Regards,

 

Ardeal

 

 

 

 

 

 

 

 

 

0 Kudos
Reply
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
1,581 Views
Registered: ‎07-12-2018

Hi @ardealliang,

 

GPIO906 is the name of the first GPIO of the controller. So if you want to use the driver from the user space the document mentioned by you will help you.

 

"The only question is I don't know which pin on the board is set when I run echo 1 > gpio916/value."--

 

gpio916 is the chip name of the MIO10. If you are exporting this gpio then you can set the direction and write a value to the pin.

 

Let us consider the MIO7 which is LD9( refer the user guide).

 

From the wiki page we can say that the chip name of the MIO7 is gpio913(906+7). So now we will try to set the direction and write a value to the GPIO

 

root@My_proj_en_ktimer:/sys/class/gpio# cd /sys/class/gpio/
root@My_proj_en_ktimer:/sys/class/gpio# ls
export gpio916 gpiochip906 unexport

 

you can see the list of exported as well.

 

Now give the command echo 913 > /sys/class/gpio/export

 

root@My_proj_en_ktimer:/sys/class/gpio# ls
export gpio913 gpio916 gpiochip906 unexport

 

Next - root@My_proj_en_ktimer:/sys/class/gpio# cat /sys/class/gpio/gpio913/direction
   in --> this is the expected output

So if you want to change the direction you can make it out.

root@My_proj_en_ktimer:/sys/class/gpio# echo out > /sys/class/gpio/gpio913/direction

root@My_proj_en_ktimer:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio913/value(This will turn on the LD9 )

root@My_proj_en_ktimer:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio913/value(This will turn off the LD9 )

 

Try this for the MIO7 and you understand what is happening.

 

Refer

http://zedboard.org/sites/default/files/documentations/ZedBoard_HW_UG_v2_2.pdf

https://www.xilinx.com/support/documentation/university/XUP%20Boards/XUPZedBoard/documentation/ZedBoard_RevC.1_Schematic_130129.pdf

 

Best Regards

Abhinay PS

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
---------------------------------------------------------------------------------------------

 

Best Regards
Abhinay PS
------------------------------------------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give kudos to a post which you think is helpful and reply oriented.
-------------------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
8 Replies
Highlighted
Moderator
Moderator
1,705 Views
Registered: ‎06-27-2017

Hi @ardealliang,

 

What is the error you are getting once you export it using echo 916 > /sys/class/gpio/export?

 

 

Regards

Kranthi

 

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.
0 Kudos
Reply
Highlighted
Visitor
Visitor
1,700 Views
Registered: ‎10-17-2018

Hi @gudishak,

 

No error when I run:

 echo 916 > /sys/class/gpio/export?

 

The only question is I don't know which pin on the board is set when I run echo 1 > gpio916/value.

 

 

this is the reason why I want to know the mapping between gpio number and pin name or pin number.

 

Could you please tell me the doc or link about the mapping?

 

 

Best Regards,

Ardeal

0 Kudos
Reply
Highlighted
Visitor
Visitor
1,684 Views
Registered: ‎10-17-2018

Hi @gudishak,

 

I have zedboard, and I would like to control JE pins on the board.

The following picture is captured from zedboard schematic, which is the pins I would like to control:

zedboarJEpin.PNG

 

 

Could you please tell me what GPIO number should be exported on ARM to control those upper pins?

 

 

Best Regards,

 

Ardeal

 

0 Kudos
Reply
Highlighted
Visitor
Visitor
1,641 Views
Registered: ‎10-17-2018

 

 

Is there anyone could help to answer my question?

 

Many thanks!

0 Kudos
Reply
Highlighted
Visitor
Visitor
1,611 Views
Registered: ‎10-17-2018

Hi,

 

Is there anyone could answer my question?

 

Thanks!

 

0 Kudos
Reply
Highlighted
Visitor
Visitor
1,592 Views
Registered: ‎10-17-2018

Hi,

 

Is there anyone could help to answer my question?

 

Thanks!

Ardeal

0 Kudos
Reply
Highlighted
Xilinx Employee
Xilinx Employee
1,582 Views
Registered: ‎07-12-2018

Hi @ardealliang,

 

GPIO906 is the name of the first GPIO of the controller. So if you want to use the driver from the user space the document mentioned by you will help you.

 

"The only question is I don't know which pin on the board is set when I run echo 1 > gpio916/value."--

 

gpio916 is the chip name of the MIO10. If you are exporting this gpio then you can set the direction and write a value to the pin.

 

Let us consider the MIO7 which is LD9( refer the user guide).

 

From the wiki page we can say that the chip name of the MIO7 is gpio913(906+7). So now we will try to set the direction and write a value to the GPIO

 

root@My_proj_en_ktimer:/sys/class/gpio# cd /sys/class/gpio/
root@My_proj_en_ktimer:/sys/class/gpio# ls
export gpio916 gpiochip906 unexport

 

you can see the list of exported as well.

 

Now give the command echo 913 > /sys/class/gpio/export

 

root@My_proj_en_ktimer:/sys/class/gpio# ls
export gpio913 gpio916 gpiochip906 unexport

 

Next - root@My_proj_en_ktimer:/sys/class/gpio# cat /sys/class/gpio/gpio913/direction
   in --> this is the expected output

So if you want to change the direction you can make it out.

root@My_proj_en_ktimer:/sys/class/gpio# echo out > /sys/class/gpio/gpio913/direction

root@My_proj_en_ktimer:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio913/value(This will turn on the LD9 )

root@My_proj_en_ktimer:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio913/value(This will turn off the LD9 )

 

Try this for the MIO7 and you understand what is happening.

 

Refer

http://zedboard.org/sites/default/files/documentations/ZedBoard_HW_UG_v2_2.pdf

https://www.xilinx.com/support/documentation/university/XUP%20Boards/XUPZedBoard/documentation/ZedBoard_RevC.1_Schematic_130129.pdf

 

Best Regards

Abhinay PS

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
---------------------------------------------------------------------------------------------

 

Best Regards
Abhinay PS
------------------------------------------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give kudos to a post which you think is helpful and reply oriented.
-------------------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
Highlighted
Visitor
Visitor
1,574 Views
Registered: ‎10-17-2018

@abhinayp

 

 

Your solution works!
many thanks!

 

 

0 Kudos
Reply