GPIOs shifted in the TX2 device tree

We recently added an extra component on our custom carrier board for TX2. This new component is an equivalent of the i2c expender tca9539. As a result, all our GPIO numbers got shifted in the system.

Is there a way we can reallocate those numbers or just ignore the new component for now ? We would like to keep the same GPIO numbers for our different board versions. We tried to modify the device tree but did not find the good location so far.

Previous GPIOs setup:

nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/gpio
GPIOs 240-247, i2c/0-0020, mcp23008, can sleep:
 gpio-240 P0.0 (sysfs       ) out hi   
 gpio-243 P0.3 (sysfs       ) out hi   

GPIOs 248-255, platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-248 (                    |external-connection:) in  lo    
 gpio-253 (                    |spmic_gpio_input_5  ) in  lo    
 gpio-254 (                    |spmic_gpio_input_6  ) in  hi    

GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-272 (                    |temp_alert          ) in  hi    
 gpio-312 (                    |Power               ) in  hi    
 gpio-313 (                    |Volume Up           ) in  hi    
 gpio-314 (                    |Volume Down         ) in  hi    
 gpio-315 (                    |wifi-wake-ap        ) in  lo    
 gpio-316 (                    |bt_host_wake        ) in  lo    

GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
 gpio-332 (                    |sysfs               ) out lo    
 gpio-334 (                    |sysfs               ) out hi    
 gpio-381 (                    |reset_gpio          ) out lo    
 gpio-398 (                    |vdd-fan             ) out lo    
 gpio-412 (                    |vdd-usb0-5v         ) out lo    
 gpio-413 (                    |vdd-usb1-5v         ) out lo    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-421 (                    |eqos_phy_intr       ) in  hi    
 gpio-424 (                    |wlan_pwr            ) out hi    
 gpio-426 (                    |cam1-pwdn           ) out lo    
 gpio-441 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-444 (                    |wp                  ) in  hi    
 gpio-445 (                    |cd                  ) in  hi    
 gpio-446 (                    |en-vdd-sd           ) out lo    
 gpio-456 (                    |cam0-pwdn           ) out lo    
 gpio-457 (                    |cam1-rst            ) out lo    
 gpio-461 (                    |cam0-rst            ) out lo    
 gpio-478 (                    |sysfs               ) out hi    
 gpio-479 (                    |external-connection:) in  lo    
 gpio-484 (                    |bt_ext_wake         ) out hi    
 gpio-486 (                    |sysfs               ) in  hi

New GPIO setup:

nvidia@tegra-ubuntu:~$ cat /sys/kernel/debug/gpio
GPIOs 224-231, i2c/0-0020, mcp23008, can sleep:

GPIOs 232-239, platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-232 (                    |external-connection:) in  lo    
 gpio-237 (                    |spmic_gpio_input_5  ) in  hi    
 gpio-238 (                    |spmic_gpio_input_6  ) in  hi    

GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
 gpio-240 (                    |vdd-usb2-5v         ) out hi    
 gpio-241 (                    |en-vdd-ts-1v8       ) out hi    
 gpio-242 (                    |en-vdd-ts-hv-3v3    ) out hi    
 gpio-243 (                    |en-vdd-disp-3v3     ) out lo    
 gpio-247 (                    |en-mdm-pwr-3v7      ) out lo    
 gpio-249 (                    |en-vdd-disp-1v8     ) out lo    
 gpio-250 (                    |dis-vdd-1v2         ) out hi    
 gpio-252 (                    |vdd-hdmi            ) out hi    
 gpio-253 (                    |en-vdd-cam-hv-2v8   ) out lo    

GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-272 (                    |temp_alert          ) in  hi    
 gpio-312 (                    |Power               ) in  hi    
 gpio-313 (                    |Volume Up           ) in  hi    
 gpio-314 (                    |Volume Down         ) in  hi    
 gpio-315 (                    |wifi-wake-ap        ) in  lo    
 gpio-316 (                    |bt_host_wake        ) in  lo    

GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
 gpio-332 (                    |sysfs               ) out hi    
 gpio-334 (                    |sysfs               ) out hi    
 gpio-381 (                    |reset_gpio          ) out lo    
 gpio-398 (                    |vdd-fan             ) out lo    
 gpio-412 (                    |vdd-usb0-5v         ) out lo    
 gpio-413 (                    |vdd-usb1-5v         ) out lo    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-421 (                    |eqos_phy_intr       ) in  hi    
 gpio-424 (                    |wlan_pwr            ) out hi    
 gpio-426 (                    |cam1-pwdn           ) out lo    
 gpio-441 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-444 (                    |wp                  ) in  hi    
 gpio-445 (                    |cd                  ) in  hi    
 gpio-446 (                    |en-vdd-sd           ) out lo    
 gpio-456 (                    |cam0-pwdn           ) out lo    
 gpio-457 (                    |cam1-rst            ) out lo    
 gpio-461 (                    |cam0-rst            ) out lo    
 gpio-478 (                    |sysfs               ) out hi    
 gpio-479 (                    |external-connection:) in  lo    
 gpio-484 (                    |bt_ext_wake         ) out hi    
 gpio-486 (                    |sysfs               ) in  hi

hello marine_rain,

since you had develop a custom carrier board, please refer to Jetson TX2 Platform Adaptation and Bring-Up Guide for the guidance and details for development,
thanks

@jerryChang Thanks for your answer.

I decided to check the new GPIO allocation when the device is booting as recommended in the doc.

I’m still curious, is there a way to disable this tca9539 expender in the Jetson device tree ?

hello marine_rain,

you could disassembler the dtb file into txt file for checking,
for example,

$ dtc -I dtb -O dts -o output.txt tegra.dtb

you’ll see there are two GPIOs as below shows compatible is TCA9539,
please have a try to exclude them in sensor device tree. thanks

gpio@74 {
                        compatible = "ti,tca9539";
...
                gpio@77 {
                        compatible = "ti,tca9539";

link in #2 is broken

Try here (redirect does not work, so you might need to go here, log in, and click the link again):
https://developer.nvidia.com/embedded/downloads#?search=adaptation
(then filter for “tx2”)

Sorry linuxdev,

Your response did not fix the link.

Please fix the link

What error did you see?

The link works for me. Maybe try this link.

Jetson TX2 Platform Adaptation and Bring-Up Guide

did not see the Bring up guide, Just a download page.

So you are telling me to do two or three things to see one document that you should correct by putting in the correct line in the forum

Great customer support, can I have your managers name so I can give him or her feedback!

Great job TomK, can you teach linuxdev how to add correct links to forum topics

Hi Terryysu50z,

Linuxdev was just trying to help. He is not a paid support person, and is not employed by Nvidia. He is one of the most active and helpful members of this community. We are all very grateful to have him here in the Nvidia Developer forums.

Best,
Tom