SPI on M4 IMX8QM

Hello,
I’m currently developing a program that runs freeRTOS on the M4 and Torizon on the A core. Both communicate through RPMSG. I use CAN on the M4 side and for that I needed to disable it on the device tree, otherwise it didn’t work.
Now I need to do the same but with SPI. I’ve been reading the lpspi examples from the MCUXpresso SDK and in all of them the following sentences appeared:

Please note this application can’t support running with Linux BSP!

This example aims to show the basic usage of the IP’s function, some of the used Pads/Resources are also used by Cortex-A core.

So I’m assuming that I need to disable SPI on the device tree. In that case, I want to use SPI1 (pins 225, 223, 227 and 221 according to Apalist IMX8 datasheet).
Last time with CAN ports I was able to disable them with an overlay. Is it possible to do the same with SPI? Could you show me what are the lines I need to modify on the DT files to get it working?

My setup is:
Apalis iMX8QM V1.0B
Apalis Eva Board V1.1A
TorizonCore 5.3.0+build.7

Thanks!!!

Juan

Hi @juanigevo !

Exploring the device tree used on TorizonCore 5.3.0 for Apalis iMX8QM on evalboard (and all files recursively/indirectly included by it):

https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm64/boot/dts/freescale/imx8qm-apalis-eval.dts?h=toradex_5.4-2.3.x-imx

You will see that:

  1. SPI1 is created (with name spi@5a000000) on line 22 of imx8-ss-dma.dtsi (with phandle lpspi0)
  2. its pins are defined on line 1279 of the file imx8-apalis-v1.1.dtsi, targeting the pinctrl_lpspi0
  3. the pinctrl_lpspi0, defined on line 901 of the same imx8-apalis-v1.1.dtsi, contains all the pins that you cited (225, 223, 227, and 221), that are also cited by Apalis IMX8 datasheet

So, if you give a status = disabled; to the lpspi0 phandle, it should make the SPI1 free for M4 to make use of it.


Extra: I created two open-source tools to search and find stuff across a device tree. Maybe they can help with device tree tasks:

Thank you @henrique.tx for the answer and these tools. Will definitely check them.
Kind regards,
Juan