How to Enable SPI3 on LS1028ARDB?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Enable SPI3 on LS1028ARDB?

Jump to solution
1,288 Views
Koffeekake
Contributor II

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.

Koffeekake_1-1679331929581.png

 

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`.  

Koffeekake_0-1679331589246.png

Koffeekake_2-1679332113085.png

 

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.

0 Kudos
1 Solution
1,148 Views
yipingwang
NXP TechSupport
NXP TechSupport

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>;

};

};

View solution in original post

Tags (1)
3 Replies
1,222 Views
yipingwang
NXP TechSupport
NXP TechSupport

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>;

}

 
 
1,211 Views
Koffeekake
Contributor II

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.

Koffeekake_0-1679590425053.png

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:

Koffeekake_1-1679590547676.png

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.  

Koffeekake_2-1679590749621.png

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.

 

0 Kudos
1,149 Views
yipingwang
NXP TechSupport
NXP TechSupport

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>;

};

};

Tags (1)