I can see
SPI_MISO_LVS , SPI_MOSI_LVS ,SPI_CS0_LVS ,SPI_CS0_LVS ,SPI_CS1_LVS
is SPI1 bus
So can I connect directly to a custom SPI device for testing ?
Register as a spidev device to read and write directly ?
I can see
SPI_MISO_LVS , SPI_MOSI_LVS ,SPI_CS0_LVS ,SPI_CS0_LVS ,SPI_CS1_LVS
is SPI1 bus
So can I connect directly to a custom SPI device for testing ?
Register as a spidev device to read and write directly ?
Please refer to Jetson/TX2 SPI - eLinux.org, concept is similar.
Is there any PINMUX documentation for ORIN??
pinmux configuration files not bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-*.cfg.
seems to be modified to tegra234-mb1-bct-pinmux-p3701-0000.dtsi
ORIN SPI3 in 40 pin conn
So I modify tegra234-mb1-bct-pinmux-p3701-0000.dtsi
spi3_sck_py0 {
nvidia,pins = “spi3_sck_py0”;
nvidia,function = “spi3”;
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi3_miso_py1 {
nvidia,pins = "spi3_miso_py1";
nvidia,function = "spi3";
//nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
//nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi3_mosi_py2 {
nvidia,pins = "spi3_mosi_py2";
nvidia,function = "spi3";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi3_cs0_py3 {
nvidia,pins = "spi3_cs0_py3";
nvidia,function = "spi3";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi3_cs1_py4 {
nvidia,pins = "spi3_cs1_py4";
nvidia,function = "spi3";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
And short circuit these two pins
but still not working
root@user-desktop:/home/user# ./spidev_test -v -D /dev/spidev2.1
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…@…|
RX | 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 |…|
root@user-desktop:/home/user# ./spidev_test -v -D /dev/spidev2.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…@…|
RX | 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 |…|
root@user-desktop:/home/user#
How to confirm that PINMUX is set successfully ???
Change the setting to spi1, still no response
spi1_sck_pz3 {
nvidia,pins = "spi1_sck_pz3";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
//pinmux.0x0243d020 = 0x00000458;
spi1_miso_pz4 {
nvidia,pins = "spi1_miso_pz4";
nvidia,function = "spi1"; //1:0
nvidia,pull = <TEGRA_PIN_PULL_UP>; //3:2
nvidia,tristate = <TEGRA_PIN_ENABLE>; //4
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;//5
nvidia,enable-input = <TEGRA_PIN_ENABLE>; //6
nvidia,lpdr = <TEGRA_PIN_DISABLE>; //7
};
spi1_mosi_pz5 {
nvidia,pins = "spi1_mosi_pz5";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
//pinmux.0x0243d010 = 0x00000400;
spi1_cs0_pz6 {
nvidia,pins = "spi1_cs0_pz6";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_cs1_pz7 {
nvidia,pins = "spi1_cs1_pz7";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_NONE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
root@user-desktop:/home/user# ./spidev_test -v -D /dev/spidev0.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…@…|
RX | 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 |…|
How to update only pinmux config ?
How to confirm whether pinmux has been updated successfully?
You can directly read the register after you boot up.
root@user-desktop:/home/user# cat /sys/kernel/debug/tegra_pinctrl_reg
cat: /sys/kernel/debug/tegra_pinctrl_reg: No such file or directory
Why no tegra_pinctrl_reg ??
I mean you can directly read the register which you just posted in above comment by using devmem.
I set it directly and it seems to work
But why can’t I modify Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000.dtsi to take effect
root@user-desktop:/home/user# busybox devmem 0x0243d008 32 0x400
ox devmem 0x0243d018 32 0x458
root@user-desktop:/home/user# busybox devmem 0x0243d018 32 0x458
root@user-desktop:/home/user# busybox devmem 0x0243d028 32 0x400
root@user-desktop:/home/user# busybox devmem 0x0243d038 32 0x400
root@user-desktop:/home/user# busybox devmem 0x0243d040 32 0x400
root@user-desktop:/home/user# busybox devmem 0x0243d008 32
0x00000400
root@user-desktop:/home/user# busybox devmem 0x0243d018 32
0x00000458
root@user-desktop:/home/user# busybox devmem 0x0243d028 32
0x00000400
root@user-desktop:/home/user# busybox devmem 0x0243d038 32
0x00000400
root@user-desktop:/home/user# busybox devmem 0x0243d040 32
0x00000400
root@user-desktop:/home/user#
root@user-desktop:/home/user#
root@user-desktop:/home/user# ./spidev_test -v -D /dev/spidev0.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 kHz)
TX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…@…|
RX | FF FF FF FF FF FF 40 00 00 00 00 95 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F0 0D |…@…|
Could you share which file got modified and how you flash?
./flash.sh -k A_kernel jetson-agx-orin-devkit mmcblk0p1
20220630_flash.log (54.5 KB)
I can see
copying pinmux_config(/home/share/HD2/NVDIA_DATA/Tegra186_git_3410_org/tegra186/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000.dtsi)… done.
tegra234-mb1-bct-pinmux-p3701-0000.dtsi (68.4 KB)
Hi,
That dtsi is not in in use in the kernel partition. Please full flash again
./flash.sh jetson-agx-orin-devkit mmcblk0p1
20220630_flash_all.log (66.9 KB)
root@user-desktop:/home/user# busybox devmem 0x0243d008 32
0x00000000
root@user-desktop:/home/user# busybox devmem 0x0243d018 32
0x00000058
root@user-desktop:/home/user# busybox devmem 0x0243d028 32
0x00001000
root@user-desktop:/home/user# busybox devmem 0x0243d038 32
0x00000000
root@user-desktop:/home/user# busybox devmem 0x0243d040 32
0x00000000
still not working …
Then please check if any device tree node is using this pin.
I tried many times
Still can’t update pinmux
tegra234-p3701-0000-p3737-0000_o.dts (387.0 KB)
tegra234-mb1-bct-pinmux-p3701-0000.dtsi (66.7 KB)
202207011700_flash.log (66.8 KB)
root@user-desktop:/home/user# busybox devmem 0x0243d008 32
0x00000000
root@user-desktop:/home/user# busybox devmem 0x0243d018 32
0x00000058
root@user-desktop:/home/user# busybox devmem 0x0243d028 32
0x00001000
root@user-desktop:/home/user# busybox devmem 0x0243d038 32
0x00000000
root@user-desktop:/home/user# busybox devmem 0x0243d040 32
0x00000000
root@user-desktop:/home/user#
Hi,
Just want to confirm. What is current status?
You can make SPI work if you directly modify the pinmux register directly?
I directly modify the pinmux register
busybox devmem 0x0243d008 32 0x400
busybox devmem 0x0243d018 32 0x458
busybox devmem 0x0243d028 32 0x400
busybox devmem 0x0243d038 32 0x400
busybox devmem 0x0243d040 32 0x400
The actual mount reads the nor-flash id,
miso no data read, all are 0
root@user-desktop:/home/user# insmod /lib/modules/5.10.65-tegra/kernel/drivers/mtd/spi-nor/spi-nor.ko
[ 2098.758864] spi-nor spi0.1: unrecognized JEDEC id bytes: 00 00 00 00 00 00
How to confirm pinmux update ??
Regarding the pinmux update, how can I confirm it?
Are you trying to configure SPI1 as master ? Can you specify the ask here ? I will try to provide you the pinmux settings