Deprecated Pinmux Spreadsheet for GPIO Pins and difference between &gpio, &tegra_main_gpio and &tegra_ano_gpio

I am now using Jetpack R36 (release) Revision 4.3 on Jetson AGX Orin Dev Kit.
I want to enable PPS signal input via GPIO port. I have verified that the PPS is supported in the kernel. Therefore I assume that I don’t need to build the kernel by myself.

zcat /proc/config.gz | grep -i PPS
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
# PPS clients support
CONFIG_PPS_CLIENT_KTIMER=y
CONFIG_PPS_CLIENT_LDISC=y
CONFIG_PPS_CLIENT_GPIO=y
# PPS generators support

Question 1: Maybe incorrect PIN name/numbering according to Pinmux Spreadsheet?

Basically I refered this post PPS input to GPIO on Jetpack 6.1 and the official ducumentation of Creating Device Tree Overlay. I planned to use PIN16 as well which is named GPIO08 according to Developer Guide. However, when refering to the Pinmux Spreadsheet, I found that PIN16 is named GPIO3_PBB.01, not PC.00 as claimed in the post PPS input to GPIO on Jetpack 6.1. Furthermore, PBB.01 can also be verified in the Jetson AGX Orin Developer Kit Carrier Board Specification

Screenshot from Developer Kit Carrier Board Specification

Screenshot from Pinmux Spreadsheet

For anyone wondering how 16 comes from Pin 16 on the 40 pin header, it took a bit of digging. Pin 16 is called GPIO8 , but is actually gpio-357 or PC.00 on the pinmux sheet.

I am wondering whether I got something wrong or I used the incorrect version of Pinmux spreadsheet. Since this guy said in his post it works for him.

Question 2: How to create the gpio mapping for GPIO3_PBB.01?

Based on the post PPS input to GPIO on Jetpack 6.1, I guess I need to create a device tree overlay file named pps-overlay.dts as follows.

/dts-v1/;
/plugin/;

/ {
    compatible = "nvidia,p3737-0000+p3701-0005", "nvidia,p3701-0005","nvidia,tegra234";
    overlay-name = "PPS Overlay"; 
    jetson-header-name = "Jetson 40pin Header"; 

    fragment@0 {
        target-path = "/";
        __overlay__ {
            pps: pps-gpio {
                status = "okay";
                compatible = "pps-gpio";
                gpios = <#1?? #2?? 0>;
                assert-arising-edge;
            };
        };
    };
};

And then the following commands should be executed.

dtc -O dtb -o pps-overlay.dtbo -@ pps-overlay.dts
sudo cp pps-overlay.dtbo /boot
sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "PPS Overlay"

But after reading ALMOST ALL relevant posts in the forum, I still don’t know how to set them. I don’t want to cite all of them. From my understanding:

  • For #1?? It could be &gpio, &tegra_main_gpio, &tegra_ano_gpio. Since after exectuing sudo cat /sys/kernel/debug/gpio | grep PBB.01, I got gpio-325 (PBB.01 ) which implies this gpio pin lies on tegra234-gpio-aon.
  • For #2?? After reading the source code, I have found something like:
#define TEGRA_GPIO_PORT_BB 27
#define TEGRA_GPIO_PORT_CC 28
#define TEGRA_GPIO_PORT_DD 29
#define TEGRA_GPIO_PORT_EE 30
#define TEGRA_GPIO_PORT_FF 31

#define TEGRA_GPIO(port, offset) \
	((TEGRA_GPIO_PORT_##port * 8) + offset)

I guess I should use gpios = <&tegra_ano_gpio 325 0> or gpios = <&gpio 217 0>. 217 = 27(BB) * 8 + 1. Both didn’t work after trying.

  • Question 2.1: Please clarify when to use &gpio, &tegra_main_gpio, &tegra_ano_gpio and how can I calculate/get the number for it.

I guess for &gpio the number is calculated as the formula and for tegra_ano_gpio the number should be the one outputed by the command sudo cat /sys/kernel/debug/gpio | grep PBB.01)

IMPORTANT: Please quit pointing me to another very long forum topic. The documentation should really be fixed, it is really annoying. DEVELOPER DON’T NEED TO READ THE SOURCE CODE TO IMPLEMENT A SMALL FUNCTIONALITY. IT SHOULD BE WELL AND NICE DOCUMENTED.

1 Like

Sorry for the late response.
Is this still an issue to support? Any result can be shared?

Yes, of course it is still an open issue. Could you answer the above questions?

Hi Snv,

In NVIDIA Jetson AGX Orin Developer Kit Carrier Board specification:
image
In pinmux spreadsheet:
image
PIN16 of 40-pins expansion header(J30) should be known as GPIO08(or GP25 or PBB.01).

They are matched, I don’t know where you got gpio-357 and PCC.00.

For Jetpack 6.2(r36.4.3), please configure gpios = <&gpio_aon TEGRA234_AON_GPIO(BB, 1) 0> for PBB.01 since PBB.01 is from Always-ON GPIO controller.

Please refer to the definitions in tegra234-gpio.h for details.
For JP5.x: &tegra_main_gpio for main gpio controller, &tegra_aon_gpio for AON GPIO controller
For JP6.x: &gpio for main gpio controller, &gpio_aon for AON GPIO controller

The configuration in device tree here is not relating to the gpio number you got from /sys/kernel/debug/gpio.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.