dtc -I fs -O dts /proc/device-tree > /tmp/dt.log
dt.log (404.3 KB)
关键设备树
&spi1 {
status = "okay";
num-cs = <2>;
cs-gpios = <0>,
<&gpio_main TEGRA264_MAIN_GPIO(Y, 1)>;
spi@0 {
/* chip select 0 */
compatible = "tegra-spidev";
reg = <0x0>;
spi-max-frequency = <50000000>;
};
spi@1 {
/* chip select 0 */
compatible = "tegra-spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
};
};
我使用以下指令分别测试cs0与cs1,cs0管脚控制正常,cs1没有任何作用。
./spidev_test -D /dev/spidev1.0 -s 1000000 -p "\xaa\x55"
./spidev_test -D /dev/spidev1.1 -s 1000000 -p "\xaa\x55"
Hi hansguo,
Are you using the devkit or custom board for T4000?
What’s the Jetpack version in use?
What’s the exact SPI interface are you using? c6c0000.spi?
If so, there should be only one hardware-based CS available to be used on this bus.
Are you using the devkit or custom board for T4000?
I’m using the custom board for T4000.
What’s the Jetpack version in use?
root@thor:~# cat /etc/nv_tegra_release
R38 (release), REVISION: 4.0, GCID: 43443517, BOARD: generic, EABI: aarch64, DATE: Wed Dec 31 00:15:19 UTC 2025
KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia
INSTALL_TYPE=openrm
What’s the exact SPI interface are you using? c6c0000.spi?
spi@c6c0000
If so, there should be only one hardware-based CS available to be used on this bus.
Can I use the GPIO as a second CS pin?
You can use software-based CS by specifying cs-gpios properties in device tree.
Please refer to following thread for the example:
Enable more CS pins for SPI - Cannot find /Linux-for-Tegras directory - #51 by Ppovoa
You need to configure it as GPIO/Output/Drive 1 in pinmux spreadsheet before use.
Thanks!It works!
- Configure it as GPIO/Output/Drive 1 in pinmux spreadsheet
- set cs-gpios in dtsi
&spi1 {
status = "okay";
num-cs = <2>;
cs-gpios = <0>,
<&gpio_main TEGRA264_MAIN_GPIO(Y, 1) GPIO_ACTIVE_LOW>;
...
};