Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20693 Discussions

Cyclone V SoC HPS/FPGA pins to Linux /Sys/Class/GPIO GPIO Pin Numbers?

Altera_Forum
Honored Contributor II
2,068 Views

Hi all, 

 

I'm trying to figure out how Linux organizes CPU/HPS pins in numerical order so they can be access from user space with the GPIO method /sys/class/gpio/. 

 

Altera documentation doesn't hand GPIO pin numbers for the HPS/FPGA part, 

but they're using an alphanumeric system instead for the part pin names. 

 

How can I access each GPIO pin from the HPS/FPGA in Linux and be sure I know which GPIO Pin# is which HPS/FPGA Pin? 

 

I tried asking Altera technical support, but it seems they know little about this convention. 

 

THe SoC is a 5CSXFC6D6F31, and the documentation they have supplied is not complete. 

 

The shown examples named each pin as something like HPS_GPIO_3 for example, 

but how would we know what GPIO pin number Linux looks at that pin as being as? 

 

Thanks for your help, I need to create some binary drivers for custom hardware, 

but I don't want to be writing the wrong GPIO pins in the HPS/FPGA if I can't figure  

out what the GPIO pin number is for the HPS AlphaNumeric pin names. 

 

What would the GPIO pin order be starting from SoC pin 00? 

 

Maybe the pins can be access by this method, but I can't find a list of the SoC Pin Order in numerical order. 

 

I'm trying to figure out how Linux looks at the pins as being GPIO. Can it even access all of the SoC pins except for power? 

 

Your help would be appreciated,  

 

Thanks, 

 

Jason
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
1,040 Views

hey Jason, 

 

Im trying to access some of the HPS GPIOs from sysfs, have you figured out the method to access GPIO pins in numerical order? 

 

Thanks in advance. 

 

Rergards, 

Ambika
0 Kudos
Reply