I'm trying to access the lpspi channels on my i.MX8QXP. From the baseboard schematics, I found where LPSPI0 connects to the Arduino/MikroBus connector. I have this wired to a spi slave device (an STM32H743ZI development board from ST Micro). My question is how to get our (Yocto) Linux to recognize the spi device and enumerate it as /dev/spidev0.0 (or something like that). Once I can actually access the device, I should be able to test with it...
Thanks in advance,
Nolan Z
已解决! 转到解答。
Hi Nolan
one can also look at
https://community.nxp.com/message/1047694?commentID=1047694#comment-1047694
Best regards
igor
Hi Nolan
one can look at dts example on
fsl-imx8qxp-lpddr4-arm2-lpspi.dts\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel
driver
spi-fsl-lpspi.c\spi\drivers - linux-imx - i.MX Linux kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igor,
I've tried what you recommended, using the lpspi dts example you gave. I modified fsl-imx8qxp-mek-ov5640-rpmsg.dts to create spidev0 from lpspi0. When I boot up my imx8, the spidev0.0 still doesn't appear. Looking down through the inherited devicetree files, I found another definition of lpspi0 at fsl-imxdx.dtsi on line 2735. Will this conflict with the lpspi0 that I defined?
(I modified fsl-imx8qxp-mek-ov5640-rpmsg.dts because I also need camera functionality on the board.)
fsl-imx8qxp-mek-ov5640-rpmsg.dts
fsl-imx8dx.dtsi
Thanks,
Nolan Z
Hi Nolan
one can also look at
https://community.nxp.com/message/1047694?commentID=1047694#comment-1047694
Best regards
igor
Thanks for that post, it was helpful. From journalctl, I can now see that the imx8qxp is trying to register the spi device, however it fails with the following:
# journalctl | grep spi Feb 03 11:30:50 imx8qxpmek kernel: fsl_lpspi 5a000000.lpspi: registered master spi0 Feb 03 11:30:50 imx8qxpmek kernel: spi_master spi0: /lpspi@5a000000/spi@0 has no valid 'spi-max-frequency' property (-22) Feb 03 11:30:50 imx8qxpmek kernel: spi_master spi0: Failed to create SPI device for /lpspi@5a000000/spi@0
I will attempt removing this line from fsl-imx8qxp-mek-ov5640-rpmsg.dts and see what happens. Lmk if you have any further suggestions.
EDIT: There was actually a typo. I put in "spi-max-fequency". I also had to change the "compatible" line of spidev0 to "spidev" in fsl-imx8qxp-mek-ov5640-rpmsg.dts.
Thanks,
Nolan Z