How to know the port number the board and system device name

test.c (8.7 KB)

Screen Shot 2022-08-22 at 14.20.09

the GPIO port name is linked to NX directly

hello hulugaga1111,

you may also download pinmux spreadsheets to review the mappings for ball name and its GPIO.
the GPIO number calculation formula is valid if you’re using k-4.9, (before Jetpack-5.x)

#define TEGRA194_AON_GPIO(port, offset) \
  	((TEGRA194_AON_GPIO_PORT_##port * 8) + offset)

you should also consider allocation range, it’s shown here… gpiochip1: GPIOs 248-287, parent: platform/c2f0000.gpio, tegra-gpio-aon:
for example, GPIO04 is GPIO3_PCC.01, the GPIO number is… ((2*8) + 1) + 248 = 265, you should toggle gpio265 to control GPIO04.

if you’re based-on JetPack-5.x, the above GPIO calculation is not valid anymore for K5.10.
instead, please refer to developer guide, [To check a GPIO number]. please follow the GPIO debugfs for looking up the port and offset.
for example,
454 is the GPIO number of PQ.06

$ sudo cat /sys/kernel/debug/gpio | grep PQ.06
gpio-454 (PQ.06 )

I follow the guide, 6 of 8 ports can be set to output to high or low value, but GPIO04 and GPIO06 cann’t be controlled, I set 265 as GPIO04 ( GPIO3_PCC.01) and 267 (GPIO03_PCC.03) as GPIO06 , the two ports are always high value, I cann’t change it.

hello hulugaga1111,

may I know which JetPack release you’re working on?
please check $ cat /etc/nv_tegra_release for the L4T release version on the target.


hello hulugaga1111,

please refer to pinmux spreadsheets,
GPIO04 is by default configured as Baseboard Power LED Control
GPIO06 is by default configured as Baseboard CAM MUX Select.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.