Dear moderaters:
I met such a problem when I enabling SPI.
I am using a jetson nano 4GB with jetpack 4.6.3.
And got a solution for jetson-io bug, and enabled the spi in th jetson-io table.
After doing that, the registers dump is like below by sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi:
Bank: 1 Reg: 0x70003050 Val: 0x0000e044 → spi1_mosi_pc0
Bank: 1 Reg: 0x70003054 Val: 0x0000e044 → spi1_miso_pc1
Bank: 1 Reg: 0x70003058 Val: 0x0000e044 → spi1_sck_pc2
Bank: 1 Reg: 0x7000305c Val: 0x0000e048 → spi1_cs0_pc3
Bank: 1 Reg: 0x70003060 Val: 0x0000e048 → spi1_cs1_pc4
Bank: 1 Reg: 0x70003064 Val: 0x00006046 → spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006046 → spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006046 → spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x00006046 → spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x00006045 → spi2_cs1_pdd0
Bank: 1 Reg: 0x70003078 Val: 0x0000e015 → spi4_mosi_pc7
Bank: 1 Reg: 0x7000307c Val: 0x0000e015 → spi4_miso_pd0
Bank: 1 Reg: 0x70003080 Val: 0x0000e015 → spi4_sck_pc5
Bank: 1 Reg: 0x70003084 Val: 0x0000e015 → spi4_cs0_pc6
Bank: 1 Reg: 0x70003088 Val: 0x00002040 → qspi_sck_pee0
Bank: 1 Reg: 0x7000308c Val: 0x00002000 → qspi_cs_n_pee1
Bank: 1 Reg: 0x70003090 Val: 0x00002040 → qspi_io0_pee2
Bank: 1 Reg: 0x70003094 Val: 0x00002040 → qspi_io1_pee3
Bank: 1 Reg: 0x70003098 Val: 0x00002040 → qspi_io2_pee4
Bank: 1 Reg: 0x7000309c Val: 0x00002040 → qspi_io3_pee5
Bank: 0 Reg: 0x70000b70 Val: 0x00000001 → drive_qspi_comp_control
Bank: 0 Reg: 0x70000b78 Val: 0x00000001 → drive_qspi_lpbk_control
Bank: 0 Reg: 0x70000a78 Val: 0x00808000 → drive_qspi_comp
But using spi_test, there are no any result.
And try to find the problems,
Found that the pin set by sudo cat /sys/kernel/debug/tegra_gpio and the result appeard below:
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
A: 0:0 64 40 40 04 00 00 000000
B: 0:1 f0 00 00 00 00 00 000000
C: 0:2 1f 00 00 18 00 00 000000
D: 0:3 00 00 00 00 00 00 000000
E: 1:0 40 00 00 00 00 00 000000
F: 1:1 00 00 00 00 00 00 000000
G: 1:2 0c 00 00 00 00 00 000000
H: 1:3 fd 99 00 60 00 00 000000
I: 2:0 07 07 03 02 00 00 000000
J: 2:1 f0 00 00 00 00 00 000000
K: 2:2 00 00 00 00 00 00 000000
L: 2:3 00 00 00 00 00 00 000000
M: 3:0 00 00 00 00 00 00 000000
N: 3:1 00 00 00 00 00 00 000000
O: 3:2 00 00 00 00 00 00 000000
P: 3:3 00 00 00 00 00 00 000000
Q: 4:0 00 00 00 00 00 00 000000
R: 4:1 00 00 00 00 00 00 000000
S: 4:2 a0 80 00 00 00 00 000000
T: 4:3 01 01 00 00 00 00 000000
U: 5:0 00 00 00 00 00 00 000000
V: 5:1 01 00 00 00 00 00 000000
W: 5:2 00 00 00 00 00 00 000000
X: 5:3 78 08 08 70 00 60 606000
Y: 6:0 06 00 00 02 00 00 000000
Z: 6:1 0f 08 08 04 00 06 020600
AA: 6:2 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000
CC: 7:0 92 80 80 10 00 12 121200
DD: 7:1 01 00 00 00 00 00 000000
EE: 7:2 00 00 00 00 00 00 000000
FF: 7:3 00 00 00 00 00 00 000000
It was told that the GPIOB is working and is recovering the SPI function.
try to solve the problem by modifying the device tree, But I didn’t know how to modify. Viewed by dmesg | grep -i kernel(the result is below), it seems the device is using tegra210-p3448-0000-p3449-0000-b00.dts.
[ 0.349695] alternatives: patching kernel code
[ 0.448752] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
[ 0.000000] Kernel command line: tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,4 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 gpt tegra_fbmem=0x800000@0x92ca9000 is_hdmi_initialised=1 earlycon=uart8250,mmio32,0x70006000 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 nv-auto-config
[ 0.000000] Memory: 3562212K/4159488K available (15230K kernel code, 2926K rwdata, 6620K rodata, 8576K init, 609K bss, 122140K reserved, 475136K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.022518] kmemleak: Kernel memory leak detector disabled
[ 0.236623] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
[ 0.349695] alternatives: patching kernel code
[ 0.448752] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts
[ 0.591556] eventlib_kernel: keventlib is initialized, test id: 0
[ 4.345874] KERNEL: PMC reset status reg: 0x0
[ 5.733868] Freeing unused kernel memory: 8576K
And the gpioB is like:
gpio@6000d000 {
compatible = “nvidia,tegra210-gpio”, “nvidia,tegra124-gpio”, “nvidia,tegra30-gpio”;
reg = <0x0 0x6000d000 0x0 0x1000>;
interrupts = <0x0 0x20 0x4 0x0 0x21 0x4 0x0 0x22 0x4 0x0 0x23 0x4 0x0 0x37 0x4 0x0 0x57 0x4 0x0 0x59 0x4 0x0 0x7d 0x4>;
#gpio-cells = <0x2>;
gpio-controller;
#interrupt-cells = <0x2>;
interrupt-controller;
gpio-ranges = <0x40 0x0 0x0 0xf6>;
status = “okay”;
gpio-init-names = “default”;
gpio-init-0 = <0x41>;
gpio-line-names = [00 00 00 00 00 00 00 00 00 00 00 00 53 50 49 31 5f 4d 4f 53 49 00 53 50 49 31 5f 4d 49 53 4f 00 53 50 49 31 5f 53 43 4b 00 53 50 49 31 5f 43 53 30 00 53 50 49 30 5f 4d 4f 53 49 00 53 50 49 30 5f 4d 49 53 4f 00 53 50 49 30 5f 53 43 4b 00 53 50 49 30 5f 43 53 30 00 53 50 49 30 5f 43 53 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 31 33 00 00 00 00 00 00 00 00 00 00 00 00 55 41 52 54 31 5f 52 54 53 00 55 41 52 54 31 5f 43 54 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 32 53 30 5f 46 53 00 49 32 53 30 5f 44 49 4e 00 49 32 53 30 5f 44 4f 55 54 00 49 32 53 30 5f 53 43 4c 4b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 31 32 00 00 00 00 00 00 47 50 49 4f 31 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 50 49 4f 30 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 50 49 31 5f 43 53 31 00 00 00 00 00 00 00 00];
linux,phandle = <0x5b>;
phandle = <0x5b>;
e2614-rt5658-audio {
gpio-hog;
function;
gpios = <0x4c 0x0 0x4d 0x0 0x4e 0x0 0x4f 0x0 0xd8 0x0 0x95 0x0>;
label = "I2S4_LRCLK", "I2S4_SDIN", "I2S4_SDOUT", "I2S4_CLK", "AUDIO_MCLK", "AUD_RST";
status = "disabled";
linux,phandle = <0xc4>;
phandle = <0xc4>;
};
system-suspend-gpio {
status = "okay";
gpio-hog;
output-high;
gpio-suspend;
suspend-output-low;
gpios = <0x6 0x0>;
linux,phandle = <0xb4>;
phandle = <0xb4>;
};
camera-control-output-low {
gpio-hog;
output-low;
gpios = <0x97 0x0 0x98 0x0>;
label = "cam1-pwdn", "cam2-pwdn";
};
default {
gpio-input = <0x5 0xbc 0xbd 0xbe 0xc1 0xa9 0xca 0x3a 0x3d 0x3e 0x41 0xe4>;
gpio-output-low = <0x97 0x98 0xcb 0x38 0x3b 0x3c 0x3f 0x40 0x42>;
gpio-output-high = <0x6 0xbb 0xe7>;
linux,phandle = <0x41>;
phandle = <0x41>;
};
};
I couldn’t find the same circumstance on all the Internet. Could any body solve this problem?
And by the way, I meet a problem when I flash the dtb by sudo ./flash.sh -k kernel-dtb jetson-nano-devkit mmcblk0p1.
The bug was look like:
[ 4.6025 ] Writing partition kernel-dtb with /home/xcf/nvidia/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/bootloader/signed/kernel_tegra210-p3448-0000-p3449-0000-b00.dtb.encrypt
[ 4.6035 ] 00000004: Partition not found
[ 4.6546 ]
Error: Return value 4
Command tegradevflash --write kernel-dtb /home/xcf/nvidia/nvidia_sdk/JetPack_4.6.3_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/bootloader/signed/kernel_tegra210-p3448-0000-p3449-0000-b00.dtb.encrypt
Failed to flash/read t210ref.
Please help me! Thank you so much!