SPI0 For ROM-5722

Could somebody explain to me how i use the SPI bus on the ROM-5722? My knowledge of Linux is very basic and I would really appreciate some help. I only want to do a very basic read and write.

I’ve run ls \dev\ to view the devices available but I can’t see any SPI devices. If i look in the /sys/bus/ directory i can see mtd0 but i think this is for the QPSI NOR flash on the SoM.

I can see the spidev driver available but i don’t know how to assign it the SPI bus, which bus i need to assign it to or why this isn’t part of the provided image.

Any help would be hugely appreciated.

Thanks in advance

Hi~

Please check there is a document in the kernel source about SPI, ROM5722 dts and the spidevtool that you can reference first.

The steps to enable SPI:

  1. config in kernel configuration:
  2. config in device tree:
  3. rebuild kernel dtb file
  4. Run the test

Config kernel:
The Linux kernel has enabled SPI_IMX and SPI_SPIDEV
SPI_IMX:


SPIDEV:

Config devicetree:
linux-imx/Documentation/devicetree/bindings/spi/spi-controller.yaml at adv_5.4.70_2.3.0 · ADVANTECH-Corp/linux-imx
linux-imx/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt at adv_5.4.70_2.3.0 · ADVANTECH-Corp/linux-imx

ROM-5722 dts: there is some description in the dts file for the SPI.
linux-imx/arch/arm64/boot/dts/freescale/recovery-imx8mp-rom5722-a1.dts at adv_5.4.70_2.3.0 · ADVANTECH-Corp/linux-imx

SPIDEVTOOL:
linux-imx/tools/spi at adv_5.4.70_2.3.0 · ADVANTECH-Corp/linux-imx

Rebuild kernel and dtb file:
Yocto 3.0 (version A) BSP user guide:
Yocto Linux BSP Ver.A User Guide for iMX8 series -Yocto 3.0 - ESS-WIKI
Setting up SDK:
Yocto Linux BSP Ver.A User Guide for iMX8 series -Yocto 3.0 - ESS-WIKI
Config and build kernel and deb:
Yocto Linux BSP Ver.A User Guide for iMX8 series -Yocto 3.0 - ESS-WIKI

I appreciate your help, but i wasn’t able to understand this, or get the SPI bus working. I’m not really sure how to check the configuration in the device tree or what I’d be looking for. I though it would be simpler to just enable the SPI bus.