GPIO Base Address of Jetson TX2


I have a simple question : what is the GPIO Base Address of the TX2 ? And which block size should I use ? I would like to use mmap to have a direct access to the GPIOs via /dev/mem.

Thanks :)

hello belosthomas,

you could found the tutorial in the Tegra Linux Driver Package TX2 Adaptation Guide from the GPIO changes chapter.
this documentation could be downloaded from Development Guide 28.1 Release–>PDF Documents–>Tegra Linux Driver Package TX2 Adaptation Guide.

Thank you. But I can not find the answer to my question in the document (or I do not understand). Here is some of my code :

#define GPIO_ADDR 0x???????? // I do not know what to put here
#define GPIO_BLOCK ??        // and here


this->fd = open("/dev/mem",O_RDWR);
if (this->fd < 0) {
	std::cerr << "Can't open /dev/mem" << std::endl;
gpioAddress = (unsigned long*)mmap(NULL, GPIO_BLOCK, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, GPIO_ADDR);


unsigned long aGpio = whatever you want
unsigned long value = *(gpioAddress + 1);
return (value & (1 < aGpio));

For exemple, on a RPi 3, i need to use GPIO_BASE= 0x20200000 ( BCM2708_PERI_BASE = 0x20000000 and GPIO is located at 0x00200000 ).

There is more than one GPIO controller in the Tegra chips. The Technical Reference Manual (TRM) lists which controller base address goes with which GPIO. This same controller address is used in the device tree during GPIO setup (the “gpio@c2f0000” and similar device tree entries refer to the particular controller being set up).

Thank you @Linuxdev. The controller I’m looking for is the one corresponding to the pin header attached to the jetson. I’ll search in the device tree entries.

Also i found this by typing gpio@c2f0000 on google :

Have you checked the TRM? The software side has more than two controller base addresses…the controllers you are interested in share offsets within a single base address to deal with a bank of GPIO. The document you want is:


In the document, chapter 2, table 2, “System Address Map”, you will find a series of “GPIO_CTL#_GPIO#” entries. This lists the base address of that group of GPIO. The chapter on GPIO talks about registers and offsets…these apply to any of those table 2 addresses.

The puzzle I think you are interested in solving is mapping a physical pin to a controller. Which pin of which header are you interested in? Here are threads regarding that topic:

I’m actually trying to do the same thing as @belosthomas. At the moment, I’m not able to find a reasonable process to map a gpio pin number (for example, 398) to a physical machine address.

Did anyone find a way to solve this problem?

EDIT: Solved, after reading GPIO registers details from here

Thanks anyway!