- NVIDIA ORIN GPIO 说明
1.Identifying the GPIO Number
If you designed your own carrier board, to translate from SOM connector pins to actual GPIO numbers, you must understand the following GPIO mapping formula. The translated GPIO numbers can be controlled by the driver.
Because the Jetson module dynamically registers GPIOs, search the kernel messages to check the GPIO allocation ranges for each GPIO group. The command and resulting output are similar to the following:
root@jetson:/home/ubuntu# **dmesg** | **grep gpiochip**
[ 5.726492] gpiochip0: registered GPIOs 348 to 511 on **tegra234-gpio**
[ 5.732478] gpiochip1: registered GPIOs 316 to 347 on **tegra234-gpio-aon**
As shown in the output above, there are two Jetson GPIO ports with different base indices:
- tegra234-gpio, at base index 348
- tegra234-gpio-aon, at base index 316
You can check the GPIO number in one of the following ways:
- Using a calculation.
Before you get started, you need to know how you plan to configure the offset at each available port.
Here is the list of the tegra234 GPIO ports and offset mapping:
-
Search for the pin details from the Orin pinmux table (see Pinmux Changes).
For example SOC_GPIO08, which is GPIO3_PB.00.
-
Identify the port as B and the Pin_offset as 0.
-
Calculate the pin number with the following formula:
base + port_offset + pin_offset -
Verify the following values:
-
The base is 348.
This value comes from the kernel boot log, it is already noted tegra234-gpio, at base index 348. -
port_offset of port B = 8
This value comes from the tegra234 GPIO port and the offset mapping above. -
pin_offset = 0
-
Pin number = 348 + 8 + 0 = 356
-
-
Using Kernel debugfs.
-
Search for the gpio pin in the Jetson AGX Orin pinmux table (see Pinmux Changes).
For example, SOC_GPIO08, which is GPIO3_PB.00. -
Follow the gpio debugfs look up that use the port and offset.
cat /sys/kernel/debug/gpio | grep PB.00 -
The gpio number is mentioned in the first col as gpio-356.
root@jetson:/home/ubuntu# cat /sys/kernel/debug/gpio | grep PB.00 gpio-356 (PB.00)
-
Note:
To use a pin as GPIO, make sure that E_IO_HV field is disabled in corresponding pinmux register of the GPIO pin. You can disable the field 3.3V Tolerance Enable in pinmux spreadsheet and reflash the board with the updated pinmux file.
例如:
Jetson_AGX_Orin_Series_Pinmux_Config_Template_1.8
- 设置H60 the field 3.3V Tolerance Disable
生成的pinmux文件: - nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
refer to
https://docs.nvidia.com/jetson/archives/r35.1/DeveloperGuide/text/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html#pinmux-changes