SPRAD26 April   2022 AM67 , AM67A , AM68 , AM68A , AM69 , AM69A , DRA821U , DRA821U-Q1 , DRA829J , DRA829J-Q1 , DRA829V , DRA829V-Q1 , TDA4AEN-Q1 , TDA4AH-Q1 , TDA4AL-Q1 , TDA4AP-Q1 , TDA4VE-Q1 , TDA4VEN-Q1 , TDA4VH-Q1 , TDA4VL-Q1 , TDA4VM , TDA4VM-Q1 , TDA4VP-Q1

 

  1.   Trademarks
  2. 1SPI: Serial Peripheral Interface
  3. 2J7200/J721e MCSPI Support
    1. 2.1 MCSPI Features
  4. 3SPI: Master Mode Enabling and Validation on Linux
    1. 3.1 Enable SPI Instances of J721e/TDA4VM
    2. 3.2 Enable SPIDEV on TD4VM SDK
    3. 3.3 Exercise SPI From User Space on TI J7/TDA4x Using Standard Linux spidev_test Tool
  5. 4SPI: Slave Mode Enabling and Validation on Linux
    1. 4.1 Enable SPI Instances of J7200
    2. 4.2 Enable DMA for MCSPI4 Slave Node
    3. 4.3 Enable SPIDEV and SPI_SLAVE Configs
    4. 4.4 Test SPI Slave Functionality From User Space on TI J7200 Using Standard Linux spidev_test Tool
    5. 4.5 SPI Slave Testing Using spi-slave-time
    6. 4.6 Linux SPI Slave Challenges
    7. 4.7 Linux SPI Slave Mode General Limitations
    8. 4.8 McSPI SPI Slave Mode Limitations
  6. 5References

Enable SPIDEV on TD4VM SDK

Add a spidev node inside the spi6 node like below in arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts:

+&main_spi6 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spi6_pins_default>;
+ status="okay";
+
+ spidev@0 {
+
+ spi-max-frequency = <24000000>;
+ reg = <0>;
+ compatible = "linux,spidev";
+};
+};

Enable CONFIG_SPI_SPIDEV=y explicitly in arch/arm64/configs/tisdk_j7-evm_defconfig.

Once you boot Linux one should entries like below:

ls -l /sys/class/spi*
/sys/class/spi_master: total 0 lrwxrwxrwx 1 root root 0 Jun 17 14:17 spi6 -> ../../devices/platform/interconnect@100000/2160000.spi/spi_master/spi6
/sys/class/spidev: total 0 lrwxrwxrwx 1 root root 0 Jun 17 14:17 spidev6.0 -> ../../devices/platform/interconnect@100000/2160000.spi/spi_master/spi6/spi6.0/spidev/spidev6.0