I have an LS1028ARDB running Yocto-NXP Linux Distribution on v5.15.71, found here.
I want to use the SPI devices available on the Mikrobus headers, J29, and J31. I realize that both of these can not be used at the same time and are configurable using the DIP switch at bootup.
I have looked through the QorIQ LS1028A Reference Manual, Rev. 0, and found the base address for SPI3, which based on the below picture, is the Mikrobus SPI interface. However, I see no SPI device in my dev list, where I might be expecting `/dev/spix`.
Picture of my terminal for reference.
Furthermore, I want to use this SPI device to talk to an evaluation board that will be configured through the SPI bus. How can I make the SPI device appear, or how do I at least write data to the SPI bus? I am not too well versed in manually configuring the Linux kernel.
Solved! Go to Solution.
In Linux Kernel, please configure CONFIG_SPI, CONFIG_SPI_FSL_DSPI and CONFIG_SPI_SPIDEV.
In fsl-ls1028a-rdb.dts, please add the following.
dspi2 {
status = "okay";
spidev0: spi@0 {
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <3000000>;
};
};
To use spidev, please open CONFIG_SPI, CONFIG_SPI_FSL_DSPI and CONFIG_SPI_SPIDEV.
They are have been opened in arm64 defconfig.
Moreover, dts needs to be modifed as below, under dspi node:
spidev0: spi@0 {
reg = <0>;
compatible = "rohm,dh2228fv";
spi-max-frequency = <3000000>;
}
Hi Yiping, thanks for your response.
Could you be a little more descriptive about where the configuration happens? There are a lot of `defconfig` files in the build environment. I grep'd the entire build environment and everything SPI related was set to 'y', and only a few were set to 'm'.
Also, in U-Boot, I was able to probe SPI3 and see the output with an oscilloscope from the Mikrobus, using the command below (sf probe 3:0), even though U-Boot considered the probing a failure.
Also, the driver that seems to be associated with SPI 3 is "fsl-dspi". I was able to see the driver model tree as below:
Attached to this reponse is the device tree source that I am loading the kernel 5.15.71 with. Right now, SPI3 is 'spi@2120000' and compatible with 'fsl,ls1028-dspi'. After loading the kernel, the SPI3 shows in in /sys/devices/platform/soc/2120000.spi, and is binded to the driver fsl-dspi.
I am under the impression that the issue is related to the device tree source. I was not able to successfully modify my DTS that would populate /dev with /dev/spidev3.0 or something similar.
Do you think you could clarify how I should edit my DTS?
Thanks.
P.S. The Device Tree Compiler gives warnings when compiling my DTS. Let me know if it would be helpful to supply those.