Dear ShaneCCC,
I managed to get the spi@3210000 working with the spidev0.0 driver using the steps given in Jetson/TX2 SPI (Jetson/TX2 SPI - eLinux.org). I was having trouble before, since I missed a pullup resistor that was supposed to be pulled down in our custom carrier board.
However, as soon as I make the dtb changes, 3 of the GPIOs stops working. These are:
B25 (GPIO6_TOUCH_INT) GPIO3_PAA.07 303
F2 (GPIO19_AUD_RST) GPIO3_PJ.06 398
F7 (GPIO1_CAM1_PWR) GPIO3_PN.02 426
I am not able to export them using sysfs (gives me ‘resource busy’) error. Additionally, while I can export the GPIO 298 (G14 (GPIO9_MOTION_INT, GPIO3_PAA.02), a write to the direction file crashes the entire system.
I am able to reproduce this using a Jetson board. Steps as follows:
-
Build the latest kernel and make dtb changes to enable spidev as explained here: Jetson/TX2 SPI - eLinux.org
-
Try exporting the following GPIOs - 303, 398, 426 as shown below:
ubuntu@tegra:~$sudo -s
root@tegra:~# echo 303 > /sys/class/gpio/export
bash: echo: write error: Device or resource busy
root@tegra:~# echo 398 > /sys/class/gpio/export
bash: echo: write error: Device or resource busy
root@tegra:~# echo 426 > /sys/class/gpio/export
bash: echo: write error: Device or resource busy
- Confirm they are not held by other drivers
root@tegra:~# cat /sys/kernel/debug/gpio
GPIOs 216-223, platform/max77620-gpio, max77620-gpio, can sleep:
gpio-216 ( |external-connection:) in hi
gpio-221 ( |spmic_gpio_input_5 ) in lo
gpio-222 ( |spmic_gpio_input_6 ) in hi
GPIOs 224-239, i2c/0-0077, tca9539, can sleep:
gpio-227 ( |en-vdd-sys ) out lo
gpio-228 ( |lcd-bias-en-rail ) out hi
gpio-233 ( |en-vdd-cam ) out lo
gpio-234 ( |en-vdd-cam-1v2 ) out lo
GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
gpio-240 ( |vdd-usb2-5v ) out lo
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-244 ( |vdd-fan ) out hi
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-447, platform/2200000.gpio, tegra-gpio:
gpio-317 ( |reset_gpio ) out lo
gpio-348 ( |vdd-usb0-5v ) out lo
gpio-349 ( |vdd-usb1-5v ) out lo
gpio-356 ( |eqos_phy_reset ) out hi
gpio-357 ( |eqos_phy_intr ) in hi
gpio-360 ( |wlan_pwr ) out lo
gpio-362 ( |cam1-pwdn ) out lo
gpio-377 ( |hdmi2.0_hpd ) in hi
gpio-380 ( |wp ) in hi
gpio-381 ( |cd ) in lo
gpio-382 ( |en-vdd-sd ) out lo
gpio-392 ( |cam_pwdn_gpio ) out lo
gpio-393 ( |cam1-rst ) out lo
gpio-397 ( |cam_reset_gpio ) out lo
gpio-415 ( |external-connection:) in lo
gpio-420 ( |bt_ext_wake ) out hi
GPIOs 448-511, platform/c2f0000.gpio, tegra-gpio-aon:
gpio-464 ( |temp_alert ) in hi
gpio-504 ( |Power ) in hi
gpio-505 ( |Volume Up ) in hi
gpio-506 ( |Volume Down ) in hi
gpio-507 ( |wifi-wake-ap ) in hi
gpio-508 ( |bt_host_wake ) in hi
root@tx2-1:~#
- Export GPIO 298
root@tegra:~# echo 298 > /sys/class/gpio/export
root@tegra:~# echo out > /sys/class/gpio/gpio298/direction [This will crash the system]
I am using latest JetPack 3.3
ubuntu@tegra:~$cat /etc/nv_tegra_release
# R28 (release), REVISION: 2.1, GCID: 11272647, BOARD: t186ref, EABI: aarch64, DATE: Thu May 17 07:29:06 UTC 2018
...
ubuntu@tegra:~$uname -a
Linux tx2-1 4.4.38 #2 SMP PREEMPT Tue Jan 15 11:17:32 +08 2019 aarch64 aarch64 aarch64 GNU/Linux
Can you please try these steps and let me know:
a. Whether you can reproduce
b. If so, how to fix it
We have used these GPIOs in the carrier board for certain functions and with the SPI modification, we are unable to use them. Without the SPI modifications, I am able to use the GPIOs without any issues.
Thanks in advance.