Has the GPIO to SFIO command (gpio-to-sfio) been replaced? I’m trying to implement the following under L4T 28.1 http://elinux.org/Jetson/TX1_SPI#Patching_the_New_DTS but I’m having trouble setting the pins for use with SPI. For context I’m building the sources/kernel/device tree on a Host machine, and not on the Target directly.
This causes tegra_gpio /sys/kernel/debug $ cat tegra_gpio to show 0x00 in bank C:0 which initially it was 0x1F as described in http://elinux.org/Jetson/TX1_SPI section Configuring GPIO Pinmux for SPI
The TRM describes this (sorry, it is long reading). Basically:
SFIO: Special Function I/O. Basically a dedicated function within the SoC.
GPIO: General Purpose I/O. Can be used for most anything.
BTW: In my Observation, I’ve figured out that gpio256 (under Linux, signal name: GPIO08) is set as SFIO as default. If I export it and use it as a normal GPIO input PIN. I didn’t have any strange behaviors from it. If it is so, should I still try to configure it as a GPIO pin in such a way like this post describt?
I’m not sure about that other post. Basically though the first step is to set up a pin for GPIO (instead of SFIO) via the PINMUX spreadsheet (if the pin is set as SFIO then it can’t be used as GPIO…there might be ways after boot to turn SFIO into GPIO, but it isn’t guaranteed because the source might be busy…following the instructions related to the PINMUX spreadsheet allows the default pin function type to be what you want after boot without special steps).
After the pin is GPIO the nature of the GPIO (such as if it is for input or output or interrupt…high or low or edge trigger, so on) is set up and the GPIO is used. The nature of the GPIO pin setup is often set after boot…versus whether it is SFIO or GPIO, which is set before or during boot for most uses.
“GPIO” is general purpose I/O, and related pins on the module may have multiple uses depending on configuration. “SFIO” is special function I/O, and is not generally able to handle different functions even if configuration changes.
You’ll find that talking about the PINMUX spreadsheet is usually related to GPIO configuration (or related support of GPIO), and the device tree may be part of this (and in fact the PINMUX may generate a different device tree). The PINMUX spreadsheet is not directly installed on the Jetson, but does create content useful to the flash software. The device tree is actually installed on the Jetson (mostly as a binary partition).