How to access SPI port through IOCTL commands in G40M i.MX8M Plus SOM?

The SPI port can be accessed and configured using ioctl commands via the spidev interface.

For this, configure the SPI as SPIDEV in “DTS” file

For example in 8MPlus dts file “ecspi2” is configured as “spidev”.

We are executing the spidev_test user-space tool to perform a loopback test on the SPI interface
Ex: spidev_test -l -v -D /dev/spidev1.0

The spidev_test command uses IOCTL calls to access the SPIDEV, you can find its source in below mentioned path in kernel source,
“tools/spi/spidev_test.c”

For further inquiries, please get in touch with mktg@iwave-global.com

Please find the detailed G40M product information in the below link,