I am trying to add these 2 SPI nodes /dev/spidev0.0 and /dev/spidev1.0 with the Device tree entries below for Xavier-Nx. I was successful in getting the nodes added, but when I run the test program spidev_test.c as a loopback (MOSI <-> MISO), it fails. The output is not the same as the input i.e. the transmitted hexadecimal array that ends with “DEAD BEEF BAAD FOOD”. The output is very often 0s and sometimes random hexadecimal values with the same array length of 38 like the input. I suspect the DT nodes are not correct for Xavier-Nx and was wondering if someone could give this a look and point me in the right direction? Please see my SPI DT nodes below as well as the pinmux cfg values. The Signal names, pin numbers and Ball names for SPI0 are:
SPI0_SCK 91 SPI1_SCK
SPI0_MISO 93 SPI1_MISO
SPI0_MOSI 89 SPI1_MOSI
SPI0_CS0 95 SPI1_CS0
SPI0_CS1 97 SPI1_CS1
spi@3210000{
status = “okay”;
spi@0 {
compatible = “spidev”;
reg = <0x0>;
spi-max-frequency = <33000000>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <7>;
};
};
spi@c260000 {
//status = “disabled”;
status = “okay”;
spi@0 {
compatible = “spidev”;
reg = <0x0>;
spi-max-frequency = <33000000>;
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <6>;
};
};
spi@3300000 {
status = “disabled”;
};
spi@3230000{
status = “okay”;
};
spi@3230000{
status = “okay”;
};
pinmux.0x0243d040 = 0x00000454; # spi1_sck_pz3: spi1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d020 = 0x00000454; # spi1_miso_pz4: spi1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d058 = 0x00000454; # spi1_mosi_pz5: spi1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d010 = 0x00000458; # spi1_cs0_pz6: spi1, pull-up, tristate-enable, input-enable, lpdr-disable
pinmux.0x0243d050 = 0x00000458; # spi1_cs1_pz7: spi1, pull-up, tristate-enable, input-enable, lpdr-disable