LS1021A GPIO numbering in Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1021A GPIO numbering in Linux

Jump to solution
1,753 Views
Tarek
Senior Contributor I

I'm using a commercial board based on the LS1021A SoC which is running Linux.

I would like to test the GPIO's functionality by configuring it as output and probing the signal.

From userspace Linux I would like to export a gpio port and use the sysfs gpio files to manipulate the port. But to do that I need to know what each gpio<number> represents.

This is the port mapping as provided by debugfs:

~ cat /sys/kernel/debug/gpio
GPIOs 358-359, i2c/0-0060, gpio-pca9532, can sleep:
gpio-358 ( |backlight ) out lo

GPIOs 360-367, platform/stmpe-gpio, stmpe, can sleep:
gpio-360 ((none) ) in lo edge-inactive
gpio-361 ((none) ) in lo edge-inactive
gpio-362 ((none) ) in lo edge-inactive
gpio-363 ((none) ) in lo edge-inactive
gpio-364 ((none) ) in lo edge-inactive
gpio-365 ((none) ) in lo edge-inactive
gpio-366 ((none) ) in lo edge-inactive
gpio-367 ((none) ) in lo edge-inactive

GPIOs 368-375, i2c/0-0021, pca9554, can sleep:

GPIOs 376-383, i2c/0-0020, pca9554, can sleep:

GPIOs 384-415, /soc/gpio@2330000:

GPIOs 416-447, /soc/gpio@2320000:

GPIOs 448-479, /soc/gpio@2310000:

GPIOs 480-511, /soc/gpio@2300000:

According to this mapping GPIO1 is assigned the numbers from 480 to 511.

Is GPIO1_13 == 480 , GPIO1_14 == 481 ....and so on?

Same question for the rest of the ports

GPIO2_4 == 448 , GPIO2_5 == 449

GPIO3_0 == 416, GPIO3_1 == 417

Can you please confirm that this mapping is correct?

Thanks

Labels (1)
0 Kudos
1 Solution
1,273 Views
Pavel
NXP Employee
NXP Employee

The GPIO1_13 is 480+13= 493.

The GPIO2_4 is 448+4=452

The GPIO3_0 == 416, GPIO3_1 == 417

 

Look at the following pages:

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

 

CI20_GPIO_LED_Blink_Tutorial

 

http://falsinsoft.blogspot.ru/2012/11/access-gpio-from-linux-user-space.html

 

https://wiki.openwrt.org/doc/hardware/port.gpio

 

http://linux-sunxi.org/GPIO


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
1,274 Views
Pavel
NXP Employee
NXP Employee

The GPIO1_13 is 480+13= 493.

The GPIO2_4 is 448+4=452

The GPIO3_0 == 416, GPIO3_1 == 417

 

Look at the following pages:

https://www.kernel.org/doc/Documentation/gpio/sysfs.txt

 

CI20_GPIO_LED_Blink_Tutorial

 

http://falsinsoft.blogspot.ru/2012/11/access-gpio-from-linux-user-space.html

 

https://wiki.openwrt.org/doc/hardware/port.gpio

 

http://linux-sunxi.org/GPIO


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos