How can config the SPI port is real set to SPI MODE at TX1 R28.2?
Please see as below,I can find the "1f"at below under row C.
nvidia@tegra-ubuntu:~/spi$ ls /dev/spi*
/dev/spidev0.0 /dev/spidev0.1
nvidia@tegra-ubuntu:~/spi$ sudo cat /sys/kernel/debug/tegra_gpio
0:0 24 00 00 04 00 00 000000
0:1 0f 00 00 00 00 00 000000
0:2 <b>1f</b> 00 00 1f 00 00 000000
0:3 00 00 00 00 00 00 000000
1:0 70 00 00 00 00 00 000000
1:1 00 00 00 00 00 00 000000
1:2 00 00 00 00 00 00 000000
1:3 ff 1b 0b 40 00 24 002024
2:0 0f 0d 05 02 00 00 000000
2:1 00 00 00 00 00 00 000000
2:2 f0 20 00 d0 00 80 008000
2:3 02 00 00 02 00 02 000000
3:0 00 00 00 00 00 00 000000
3:1 00 00 00 00 00 00 000000
3:2 00 00 00 00 00 00 000000
3:3 00 00 00 00 00 00 000000
4:0 00 00 00 00 00 00 000000
4:1 00 00 00 00 00 00 000000
4:2 f0 f0 00 00 00 00 000000
4:3 03 03 00 00 00 00 000000
5:0 0c 00 00 00 00 00 000000
5:1 6e 66 00 00 00 00 000000
5:2 00 00 00 00 00 00 000000
5:3 ff 00 00 f6 00 70 606000
6:0 03 00 00 03 00 01 010100
6:1 1f 08 00 17 00 07 030300
6:2 00 00 00 00 00 00 000000
6:3 0d 04 00 09 00 00 000000
7:0 32 10 00 20 00 02 020200
7:1 00 00 00 00 00 00 000000
7:2 00 00 00 00 00 00 000000
7:3 00 00 00 00 00 00 000000
Below is how to config gpio as function pin.
https://devtalk.nvidia.com/default/topic/1021992/jetson-tx1/how-to-enable-spi-port-on-the-jetson-tx1-with-r28-1-/post/5200950/#5200950
gpio_default: default{
gpio-hog;
function;
gpios = <TEGRA_GPIO(C, 0) 0 TEGRA_GPIO(C, 1) 0 TEGRA_GPIO(C, 2) 0 TEGRA_GPIO(C, 3) TEGRA_GPIO(C,
4) 0>;
};
Please see my dtsi file.
gpio@6000d000 {
gpio_default: default {
gpio-input = <170 174 185>; // Set PV2, PV6, and PX1 to inputs
gpio-hog;
function;
gpios = <TEGRA_GPIO(C, 0) 0 TEGRA_GPIO(C, 1) 0 TEGRA_GPIO(C, 2) 0 TEGRA_GPIO(C, 3) TEGRA_GPIO(C,4) 0>;
};
};
but I also can find the "1f"at below under row C.
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_gpio
[sudo] password for nvidia:
0:0 24 00 00 24 00 00 000000
0:1 0f 00 00 00 00 00 000000
0:2 1f 00 00 18 00 00 000000
0:3 00 00 00 00 00 00 000000
1:0 70 00 00 00 00 00 000000
1:1 00 00 00 00 00 00 000000
1:2 00 00 00 00 00 00 000000
1:3 ff 1b 0b 40 00 24 002024
2:0 0f 0d 05 02 00 00 000000
2:1 00 00 00 00 00 00 000000
2:2 f0 20 00 d0 00 80 008000
2:3 02 00 00 02 00 02 000000
3:0 00 00 00 00 00 00 000000
3:1 00 00 00 00 00 00 000000
3:2 00 00 00 00 00 00 000000
3:3 00 00 00 00 00 00 000000
4:0 00 00 00 00 00 00 000000
4:1 00 00 00 00 00 00 000000
4:2 f0 f0 00 00 00 00 000000
4:3 03 03 00 00 00 00 000000
5:0 0c 00 00 00 00 00 000000
5:1 6e 66 00 00 00 00 000000
5:2 00 00 00 00 00 00 000000
5:3 ff 00 00 f6 00 70 606000
6:0 03 00 00 03 00 01 010100
6:1 1f 08 00 16 00 07 030300
6:2 00 00 00 00 00 00 000000
6:3 0d 04 00 09 00 00 000000
7:0 32 10 00 20 00 02 020200
7:1 00 00 00 00 00 00 000000
7:2 00 00 00 00 00 00 000000
7:3 00 00 00 00 00 00 000000
nvidia@tegra-ubuntu:~$ ls /dev/spi*
/dev/spidev0.0 /dev/spidev0.1
How can I fix this?
Check you DT in /proc/device-tree/gpio@6000d000 to make sure you DT is apply by kernel.
How can I check the DT?
nvidia@tegra-ubuntu:/proc/device-tree/gpio@6000d000$ ls
camera-control-output-high default #gpio-cells gpio-ranges interrupt-controller linux,phandle phandle status wlan-default-output-high
compatible e2614-rt5658-audio gpio-controller #interrupt-cells interrupts name reg wlan-default-input
nvidia@tegra-ubuntu:/proc/device-tree/gpio@6000d000$
Does this is OK now?
nvidia@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/tegra_gpio
0:0 04 00 00 04 00 00 000000
0:1 00 00 00 00 00 00 000000
0:2 <b>00</b> 00 00 00 00 00 000000
0:3 00 00 00 00 00 00 000000
1:0 00 00 00 00 00 00 000000
1:1 00 00 00 00 00 00 000000
1:2 00 00 00 00 00 00 000000
1:3 3f 1b 0b 00 00 24 002024
2:0 0f 0d 05 02 00 00 000000
2:1 00 00 00 00 00 00 000000
2:2 80 00 00 80 00 80 008000
2:3 02 00 00 00 00 00 000000
3:0 00 00 00 00 00 00 000000
3:1 00 00 00 00 00 00 000000
3:2 00 00 00 00 00 00 000000
3:3 00 00 00 00 00 00 000000
4:0 00 00 00 00 00 00 000000
4:1 00 00 00 00 00 00 000000
4:2 10 10 00 00 00 00 000000
4:3 00 00 00 00 00 00 000000
5:0 00 00 00 00 00 00 000000
5:1 02 02 00 00 00 00 000000
5:2 00 00 00 00 00 00 000000
5:3 70 00 00 70 00 70 606000
6:0 01 00 00 01 00 01 010100
6:1 1f 08 00 16 00 07 030300
6:2 00 00 00 00 00 00 000000
6:3 04 04 00 00 00 00 000000
7:0 32 10 00 20 00 02 020200
7:1 00 00 00 00 00 00 000000
7:2 00 00 00 00 00 00 000000
7:3 00 00 00 00 00 00 000000
Remove below to others group to try. Also try my dtb, remove the .txt
gpio-input = <170 174 185>; // Set PV2, PV6, and PX1 to inputs
tegra210-jetson-tx1-p2597-2180-a01-devkit.dtsi.txt (667 KB)
Should be correct value from tegra_gpio dump.