Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems
533 Discussions

how to check the GPIO's which are available in *.dts file in linux.

Ragul
Beginner
741 Views

 

Hello,

I am using terasic DE10-nano.For this i downloaded the linux BSP micro SDcard image

from this site:https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=165&No=1046&PartNo=4#contents  . to boot my system.

 

That image file has a hardware design which has GPIO's and so on. In the dts file we able to see those GPIO's .

now we want to access these GPIO in linux . we wanted to identify them in linux so that we can set the direction as input and output.

 

we have checked in /sys/class/gpio folder , we could not see all these GPIOs.

 

we want to access all the GPIO in my c Code. Please help us to identify how shall we access these GPIO and how do i see them in Linux

 

The below attached image provides the GPIO informations.which are in the *.dts file*.dts*.dts

Your help is highly appreciated

 

With regards,

Ragul V.

 

 

Labels (1)
0 Kudos
2 Replies
Jeet14
Employee
703 Views

Hi,


You may need to boot your board once with the linux binaries/images.

From the log you can identify the gpiochip_id, the base address of gpio and the number bits configured in the gpio controller w.r.t your device tree *.dts file.


example from the boot log-

gpiochip_find_base: found new base at 480

gpio gpiochip0: (/soc/gpio@0xf9000270): added GPIO chardev (254:0)

gpio gpiochip0: registered GPIOs 480 to 511 on /soc/gpio@0xf9000270


*.dts file is having the node--> gpio@0xf9000270 with 32 bit.


Same you can verify from your boot log and the device tree. Later on export the gpio and set the direction. Reference-https://www.ics.com/blog/gpio-programming-using-sysfs-interface


Regards

Tiwari


0 Kudos
Jeet14
Employee
675 Views

Hi,


I believe your inquiry has been answered. With that now, I transition this thread to community support. 

Thank you.


Best regards,

Tiwari


p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.


0 Kudos
Reply