yes that is fine.
for spi3.0 in software i am configuring below regsiters
pinmux.0x02430038 = 0x00000401; # gpio_cam4_pn3: spi4, tristate-disable, input-disable
pinmux.0x02430040 = 0x00000455; # gpio_cam5_pn4: spi4, pull-down, tristate-enable, input-enable
pinmux.0x02430048 = 0x00000401; # gpio_cam6_pn5: spi4, tristate-disable, input-disable
pinmux.0x02430050 = 0x00000409; # gpio_cam7_pn6: spi4, pull-up, tristate-disable, input-disable
on board when i read it i got the same value
Bank: 0 Reg: 0x02430038 Val: 0x00000401 → gpio_cam4_pn3
Bank: 0 Reg: 0x02430040 Val: 0x00000455 → gpio_cam5_pn4
Bank: 0 Reg: 0x02430048 Val: 0x00000401 → gpio_cam6_pn5
Bank: 0 Reg: 0x02430050 Val: 0x00000409 → gpio_cam7_pn6
but we have made a loop back for mosi and miso but we are not getting any clock,but data is coming and csi is also going low.
i am checking with
spidev_test -D /dev/spi3.0
can you please suggest why i am not getting any data in loop back only zero is coming,clock is not coming.
Config it as 0x448 and 0x444 as early comment.
which register i need to config as 0x448 and 0x444,this value you didnot said earlier
Bank: 0 Reg: 0x02430038 Val: 0x00000444 → gpio_cam4_pn3
Bank: 0 Reg: 0x02430040 Val: 0x00000448 → gpio_cam5_pn4
Bank: 0 Reg: 0x02430048 Val: 0x00000444 → gpio_cam6_pn5
Bank: 0 Reg: 0x02430050 Val: 0x00000448 → gpio_cam7_pn6
i tried this configuration but still i am not getting any data in loopback only zero is coming.
can you please help me on this
Need take time to check, and how do you get below result.
can you just confirm one more time.
i am using spio0
SPI0_CLK |
E3 |
GPIO_SEN1 |
E24 |
E24 |
unused_GPIO_SEN1 |
|
SPI2_SCK |
SPI0_MISO |
E4 |
GPIO_SEN2 |
D25 |
E26 |
unused_GPIO_SEN2 |
|
SPI2_DIN |
SPI0_MOSI |
F4 |
GPIO_SEN3 |
C27 |
F25 |
unused_GPIO_SEN3 |
|
SPI2_DOUT |
SPI0_CS0# |
F3 |
GPIO_SEN4 |
F24 |
G24 |
unused_GPIO_SEN4 |
|
SPI2_CS0 |
from software this is spi1 and from from hardware it is spi2,right?
also tell me what value i should configure all 4 registers to access this spi0 pin line?
Yes, it’s software SPI1, have try 0x00000445
Bank: 1 Reg: 0x0c302050 Val: 0x00000445 → gpio_sen1_pv1
Bank: 1 Reg: 0x0c302058 Val: 0x00000445 → gpio_sen2_pv2
Bank: 1 Reg: 0x0c302060 Val: 0x00000445 → gpio_sen3_pv3
Bank: 1 Reg: 0x0c302068 Val: 0x00000488 → gpio_sen4_pv4
i am trying this config why clock is not coming .
if we will see the Tx2 device tree
spi-touch-sharp19x12@0 {
status = “okay”;
compatible = “sharp,lr388k7_ts”;
sources/kernel_source/hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-modules/tegra186-display-e3320-1000-a00.dtsi
this display driver is getting probed successfully but not my spi flash,this spi flash is also connected on the same bus.
Could you take time to try SPI3 aka J21 SPI1_xxxx with spidevtest.
i am trying below settings
pinmux.0x02430038 = 0x00000445; # gpio_cam4_pn3: spi4, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430040 = 0x00000445; # gpio_cam5_pn4: spi4, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430048 = 0x00000445; # gpio_cam6_pn5: spi4, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430050 = 0x00000448; # gpio_cam7_pn6: spi4, pull-up, tristate-disable, input-disable, lpdr-disable
i tried with this configuration but clock is mot coming but data and chipselect are working fine
Bank: 0 Reg: 0x02430038 Val: 0x00000401 → gpio_cam4_pn3
Bank: 0 Reg: 0x02430040 Val: 0x00000455 → gpio_cam5_pn4
Bank: 0 Reg: 0x02430048 Val: 0x00000401 → gpio_cam6_pn5
Bank: 0 Reg: 0x02430050 Val: 0x00000409 → gpio_cam7_pn6
This setting also not working.
can you please share how you are calculating value of these register…why clock is not coming
Just have experience for the SPI3 working setting.
https://elinux.org/Jetson/TX2_SPI
i followed this link but it is not working,clock is not coming when i am testing with spidev3.0,for clock you are suggestin exterph3 means cam2,right?
pinmux.0x02430028 = 0x00000401; # gpio_cam2_pn1: extperiph3, tristate-disable, input-disable
This is not required,right?
Right, that is not require.
in my pinmux cfg file default configuration of spi3 pins are below
pinmux.0x02430038 = 0x00000405; # gpio_cam4_pn3: spi4, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430040 = 0x00000455; # gpio_cam5_pn4: spi4, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430048 = 0x00000405; # gpio_cam6_pn5: spi4, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02430050 = 0x00000409; # gpio_cam7_pn6: spi4, pull-up, tristate-disable, input-disable, lpdr-disable
using mw_test i am changing its value to
pinmux.0x02430038 = 0x00000401; # gpio_cam4_pn3: spi4, tristate-disable, input-disable
pinmux.0x02430040 = 0x00000455; # gpio_cam5_pn4: spi4, pull-down, tristate-enable, input-enable
pinmux.0x02430048 = 0x00000401; # gpio_cam6_pn5: spi4, tristate-disable, input-disable
pinmux.0x02430050 = 0x00000409; # gpio_cam7_pn6: spi4, pull-up, tristate-disable, input-disable
only register value changes are required no need to change in pinmux sheet right?
I am trying on Tx2 EVK,why it is not working,it was so easy in TX1 but in Tx2 they made it so complex
for all spi bus prod setting is done,do i need to disable it
pi@3210000 {
prod-settings {
prod_c_cs0 {
prod = <
0x00000004 0x00000fff 0x00000008>;
};
};
};
spi@c260000 {
prod-settings {
prod {
prod = <
0x00000004 0x0000003f 0x00000000>;
};
prod_c_cs0 {
prod = <
0x00000004 0x00000fc0 0x00000000>;
};
};
};
spi@3230000 {
prod-settings {
prod_c_cs0 {
prod = <
0x00000004 0x00000fff 0x00000008>;
it is default there,is it fine or need to change
can you please update on this.
The prod-settings should doesn’t matter with that.
I short the pin19 and pin21 of the J21 pin header and after configure the pinmux by devmem2, I can pass the loopback test. I think the configure from the wiki is working for me.
nvidia@nvidia-desktop:~$ sudo ./spidev_test -D /dev/spidev3.0 -s4000000 -g16 -n10
/dev/spidev3.0: TEST FAILED !!!!! (status:-1)
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430038
/dev/mem opened.
Memory mapped at address 0x7f9ca64000.
Value at address 0x2430038 (0x7f9ca64038): 0x56
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430038 0x445
/dev/mem opened.
Memory mapped at address 0x7fa003a000.
Illegal data type '0'.
nvidia@nvidia-desktop:~$ sudo devmem2 --help
/dev/mem opened.
Memory mapped at address 0x7fa471e000.
Value at address 0x0 (0x7fa471e000): 0xE59FF018
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430038 0x445 -w
/dev/mem opened.
Memory mapped at address 0x7face37000.
Illegal data type '0'.
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430038 32 0x445
/dev/mem opened.
Memory mapped at address 0x7f97193000.
Illegal data type '3'.
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430038 w 0x445
/dev/mem opened.
Memory mapped at address 0x7f841bb000.
Value at address 0x2430038 (0x7f841bb038): 0x56
Written 0x445; readback 0x445
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430040 w 0x445
/dev/mem opened.
Memory mapped at address 0x7f8603a000.
Value at address 0x2430040 (0x7f8603a040): 0x56
Written 0x445; readback 0x445
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430048 w 0x445
/dev/mem opened.
Memory mapped at address 0x7f91b89000.
Value at address 0x2430048 (0x7f91b89048): 0x56
Written 0x445; readback 0x445
nvidia@nvidia-desktop:~$ sudo devmem2 0x02430050 w 0x445
/dev/mem opened.
Memory mapped at address 0x7f7d839000.
Value at address 0x2430050 (0x7f7d839050): 0x58
Written 0x445; readback 0x445
nvidia@nvidia-desktop:~$ sudo ./spidev_test -D /dev/spidev3.0 -s4000000 -g16 -n10
/dev/spidev3.0: TEST PASSED