GPIO name to sysfs file number

Hello,

I would like to use pin 41 named “BR_UART_TXD” and pin 44 named “BR_UART1_RXD”, source: [url]http://elinux.org/Jetson/GPIO[/url]. How do I know which numbers they use in sysfs /sys/class/gpio/gpioNUMBER?

Thanks!

So far as numbering in sysfs goes, see kernel header “arch/arm/mach-tegra/gpio-names.h”. The text designation (e.g., GPIO_PA0) then cross-references to the Technical Reference Manual (TRM). You may need to dig around in the device tree for the controller address found in the TRM for that text label and see what the device tree setup is, and you may find other clues in the schematic (but beware that sometimes the carrier board schematic labels differ slightly from the module naming…module naming is what is used in the TRM).

Were is this file gpio-names.h located for Jetson TX2 L4T v32.1? Or where is its equivalent?

Were is this file gpio-names.h located for Jetson TX2 L4T v32.1? Or where is its equivalent?

Were is this file gpio-names.h located for Jetson TX2 L4T v32.1? Or where is its equivalent?

Were is this file gpio-names.h located for Jetson TX2 L4T v32.1? Or where is its equivalent?

That is located out of tree and accessed via relative paths. If you look at the flash software you will find “Linux_for_Tegra/source_sync.sh”. To download the kernel (including out of tree content) you can do this:

./source_sync.sh -k tegra-l4t-r32.1

This produces a “sources/” subdirectory. Within the “sources/kernel/” subtree, this will find the file:

find . -name 'gpio-names.h'

I don’t know if this file is used the same way in R32.1 as it is in the older releases (it might be, and probably is since each Tegra line inherits from the previous to some degree). Originally this thread is for the 32-bit TK1.