About using spi on Jetson NANO

No need to add the pin label.

1 Like

Hello,

Iā€™m in a bit of a hurry, can you watch with me for a moment?

tegra210-porg-pinmux-p3448-0002-b00.dtsi (38.1 KB)
I changed everything as instructed and applied dtb as FDT in extlinux.conf.

Thank you.

Hello, @ShaneCCC

Help me. please.
I am using the kernel source equivalent to jp4.6.1

Thank you.

Any problem after apply your modification?

1 Like

Hello, @ShaneCCC

Any problem after apply your modification?
=> YES

dtb built from the kernel source corresponding to jp4.6.1 does not work properly even if applied through FDT.

When dtb built from the kernel source corresponding to jp4.6 is applied through FDT, you can see that the pin address has changed as follows.

manager@manager-desktop:~/repos/spi_adc/spi_adc$ !221
sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi
[sudo] password for manager:
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: 0x00006044 ā†’ spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006044 ā†’ spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006044 ā†’ spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x00006044 ā†’ spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x00006044 ā†’ 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: 0x00002015 ā†’ qspi_sck_pee0
Bank: 1 Reg: 0x7000308c Val: 0x00002015 ā†’ qspi_cs_n_pee1
Bank: 1 Reg: 0x70003090 Val: 0x00002015 ā†’ qspi_io0_pee2
Bank: 1 Reg: 0x70003094 Val: 0x00002015 ā†’ qspi_io1_pee3
Bank: 1 Reg: 0x70003098 Val: 0x00002015 ā†’ qspi_io2_pee4
Bank: 1 Reg: 0x7000309c Val: 0x00002015 ā†’ 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

May I ask you to check nvidia internally?

Thank you.

I have verify it without problem before.
Do you confirm system apply your dtb by dmesg | grep -i kernel?

Attached my dtb for reference.
nano-spi.dtb (233.6 KB)

1 Like

Hello, @ShaneCCC

dmesg | grep -i kernel

dmesg | grep -i kernel
[    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@0x92cb4000 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 sdhci_tegra.en_boot_part_access=1 quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 
[    0.000000] Memory: 3560284K/4159488K available (15358K kernel code, 2956K rwdata, 6696K rodata, 8640K init, 612K bss, 124068K reserved, 475136K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.001768] kmemleak: Kernel memory leak detector disabled
[    0.212561] DTS File Name: /media/jetsonhostpc/841a9ca5-d24b-49de-8e73-d245a962e433/home/nanohostpc/coding/spi_jetson2/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0002-p3449-0000-b00.dts
[    0.325382] alternatives: patching kernel code
[    0.420645] DTS File Name: /media/jetsonhostpc/841a9ca5-d24b-49de-8e73-d245a962e433/home/nanohostpc/coding/spi_jetson2/Linux_for_Tegra/source/public/kernel/kernel-4.9/arch/arm64/boot/dts/../../../../../../hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0002-p3449-0000-b00.dts
[    0.566716] eventlib_kernel: keventlib is initialized, test id: 0
[    1.199487] sysfs: cannot create duplicate filename '/kernel/rt8168_power'
[    1.199565] WARNING: CPU: 0 PID: 1 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x88
[    1.199886] [<ffffff8009610d20>] kernel_init_freeable+0x1a0/0x244
[    1.199899] [<ffffff8008f658a0>] kernel_init+0x18/0x108
[    1.212628] unable to create rt8168_power_saver kernel object!
[    1.527687] KERNEL: PMC reset status reg: 0x0
[    1.574253] Freeing unused kernel memory: 8640K

Thank you.

Hello, @ShaneCCC

Can I designate nano-spi.dtb that you attached as FDT in extlinux.conf?

like below.
FDT /boot/nano-spi.dtb

Thank you.

Yes, you can.
Also check the dmesg | grep -i kernel to make sure applied correct dtb.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.