Looking for basic GPIO info in embedded Linux

I’m kind of a noob so please forgive me:

How can I tell what GPIO pins are available for use as just regular gpio (write a 1 or a 0) on the J21 header?
What is “cat /sys/kernel/debug/gpio” telling me? And how do tell what is already set up as a gpio?

Please don’t point me to this: http://elinux.org/Jetson/Tutorials/GPIO as it hasn’t been very helpful for me. The output for the “cat /sys/kernel/debug/gpio” command isn’t shown in that tutorial so I have no clue what to look for. Also, I don’t know how to find out the gpio number used in software and how that links to the external header pin.

All I want is to turn on an external LED or two and sense button input on a button or two in a polling fashion. Hopefully I can stay in user space for all of this.

Like I said, I’m new to embedded Linux so, if possible, be as detailed as possible.

Hi, I just got my Tk1 last night, looking t do the same thing, also I am brand new to embedded Linux. Finding bits of info here and there; This is something anyway:

http://elinux.org/GPIO

Also, have you downloaded the Tegra TK1 data sheet?

There’s a huge table in there with pin names, I think these must be what the cat command is showing us.

Also, check out this instructional video: I know its BeagleBone, but the driver stuff should be similar:

see 3.7 Pin Descriptions

Table 14 Multi-Purpose I/O

in the tegra data sheet.

Section 3.0 in the Tegra data sheet has most of the info we need for GPIO mux’ing.

The Technical Reference Manual explains how to configure GPIO, in the pinmux register format.

I’m specifically looking for information about the TX1. If you are using the TK1 then this should get you started:

http://elinux.org/Jetson/Tutorials/GPIO

Are you talking about the TK1 datasheet? I couldn’t find the table you reference in the TX1 datasheet. Also, in Table 14 in the TK1 datasheet, I don’t understand how the pins listed map to actual code.

Looks like GPIO is more like Arduino/Raspberry Pi rather than the TK1 board. Kangalow posted a tutorial on his JetsonHacks blog: http://jetsonhacks.com/2015/12/08/gpioi2c-on-jetson-tx1-lidar-lite-v2-installation/