GPIO register access

Hi, I’ve trying to figure out how to access Xavier NX GPIO registers from Linux. I’m aware that there is a way to use libgpiod or similiar file system based approach but it’s slow and jittery. I want to access registers directly without going to kernel coding.

What I’m looking is a way to mmap() the /dev/mem and access directly the GPIO registers like done in this example done for Nano: https://github.com/jwatte/jetson-gpio-example/blob/master/gpiomem.cpp

Unfortunately Jetson NX TRM does not give enough details to adapt this code from Nano to NX. It appears GPIO register details were omitted from the TRM? Is there an another document that would explain the GPIO registers and pin to address mapping?
TRM explains only pinmux registers that are not sufficient to control the actual GPIO pin states.

There have been questions about this before but have not been answered or are for different platform.

We will check the release of this part in document. The information is too much for me to directly share.

Thank you for the reply. Just to clarify, do you mean that you’re planning to release this information in the future? (e.g. as TRM document update).

Yes

2 Make the GPIO, HIGH —need help

Found something works for me (Nvidia orin TRM v1.2p):

background:
I am trying to set gpio01(P1.05) to high and low from register, when the pin is already configured as output

  • base of gpio ctrl address: GPIO_CTL 0x02200000

  • register that contains the output value: GPIO_Q_OUTPUT_VALUE_05_0 Offset: 0x126b0

  • sudo devmem2 0x022126b0
    gives the value stored in gpio01 output register