TX2 GPIO not working after UART device tree edit

Hi,

I followed the instructions given in the following link to enable UART.

https://devtalk.nvidia.com/default/topic/1001264/jetson-tx2/tx2-uarts/post/5125115/#5125115


sudo -s
cd /tmp
dtc -I dtb -o dts extracted.dts /boot/tegra186-quill-p3310-1000-c03-00-base.dtb

Search for “serial@c280000” where it is a block of code and not just a single line…

Change status = “disabled” to status = “okay”;

Build a modified version:

dtc -I dts -o dtb /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dtb extracted.dts
cd /boot/extlinux

edit extlinux.conf…add this line between MENU LABEL line and LINUX line:

FDT /boot/modified_tegra186-quill-p3310-1000-c03-00-base.dtb


Now the ttyTHS2 shows up. But after the device tree modification my GPIO pins doesn’t work anymore. Before the modification the GPIO pins on J21 (pin 18,29,31,33,37) worked.

The only modification done to the device tree was


Search for “serial@c280000” where it is a block of code and not just a single line…

Change status = “disabled” to status = “okay”;


Any help on this is much appreciated.

hello NipunaVega,

please share more details about GPIO pins on J21 don’t work.
are you able to control them via sys node?

for example, try to control GPIO19_AUD_RST pin following below.

Location of the GPIOs
 /sys/class/gpio
Generate gpio398 name
 echo 398 > export
Enable the gpio
 echo out > direction && echo 1 > value

Yes, I was able to control them via sys node before the device tree build. After the build, the pins do not display a voltage when high but value in sys node is given as 1.

I meet the same problems,during enable SPI.

I use “dmesg | grep gpiochip_add_data” command check the port num (provide by https://devtalk.nvidia.com/default/topic/1024806/jetson-tx2/how-to-enable-spi-spidev-on-28-1-on-target-/post/5237920/)

after flash the new dtb file, I got these info:
[ 0.271204] gpiochip_add_data: registered GPIOs 448 to 511 on device: tegra-gpio-aon
[ 0.316698] gpiochip_add_data: registered GPIOs 256 to 447 on device: tegra-gpio
[ 0.350599] gpiochip_add_data: registered GPIOs 240 to 255 on device: tca9539
[ 0.352499] gpiochip_add_data: registered GPIOs 224 to 239 on device: tca9539
[ 0.373340] gpiochip_add_data: registered GPIOs 216 to 223 on device: max77620-gpio

but before the flashing, the gpio pin number info is :

[ 0.271204] gpiochip_add_data: registered GPIOs 320 to 511 on device: tegra-gpio
[ 0.316698] gpiochip_add_data: registered GPIOs 256 to 319 on device: tegra-gpio-aon
[ 0.350599] gpiochip_add_data: registered GPIOs 240 to 255 on device: tca9539
[ 0.352499] gpiochip_add_data: registered GPIOs 224 to 239 on device: tca9539
[ 0.373340] gpiochip_add_data: registered GPIOs 216 to 223 on device: max77620-gpio

hello NipunaVega,

there’s GPIO offset value changed with the modification.
please check the related topic in comment #4 for more details.
thanks