Hello, we cannot see our spidev device under the "dev" directory. We can see it under "devices" in the "sys/bus/spi" directory as well as spidev driver. Please see below console output for reference. The devicetree node description is listed.
root@board:~# ls /dev/spidev*
ls: cannot access '/dev/spidev*': No such file or directory
root@board:~# ls /sys/bus/spi/devices/
spi1.0
root@board:~# ls /sys/bus/spi/drivers/spidev*
bind uevent unbind
------------------------------------------------
#include "freescale/imx8mn.dtsi"
&ecspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
spidev@0{
compatible = "spidev";
reg = <0>;
spi-max-frequency = <4000000>;
};
};
Solved! Go to Solution.
In my case, none of the comments provided by @Sanket_Parekh were related to the issue, including the M7 comment.
I solved the problem by simply changing the compatible property in my spidev node from "spidev" to "rohm,dh2228fv". Apparently, there was some kernel code change related to this.
spidev@0{
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <4000000>;
};
Hello @Sanket_Parekh, as I mentioned before, we didn't see any reference to M7 in the linux-imx dts files.
I already shared our board dts file with you in a private message a while back. This file reference one dtsi file, which is copied here. We don't see references to M7. Please let me know how we should proceed.
And yes, we use yocto build platform. Thx!
Hi @moose
You have mentioned about .dtsi file. Have you checked your board specific DTS file?
Thanks & Regards
Sanket Parekh
@Sanket_Parekh, there is no reference to the M7 all board dts files, including the board dts file and the include dtsi file. I already shared the dtsi file in the previous post, and I am going to share the board dts file with you again in a private message. How should we proceed?
@Sanket_Parekh any update on this? Thx!
So as i said in my intial post. When there is no sign of probe, generally the resource is allocated (partitioned) to the other M core.
What cpu are you using ? Sometimes spi is not visible at all, and not probed at all, since resource is allocated to m4 or scmfw.
Please check if you open the config.You can compare your config and official config.
:~# ls /dev/spidev1.0
/dev/spidev1.0
I checked the config file, and I see all related config statements to be enabled, including CONFG_SPI, CONFIG_SPI_MASTER, CONFIG_SPI_IMX and CONFIG_SPI_SPIDEV. I attached the config file for your reference.
If there are specific configuration parameters that I am missing, could you please list them? Thank you!
Have you checked the kernel log about SPI driver? Maybe the driver does not be loaded correctly.
Yes, I checked the kernel log, and there are no errors related to SPI.
Hi @moose
I hope you are doing well.
Can you please share the board DTS file?
Can you please share the log files?
Thanks & Regards
Sanket Parekh
Hi @Sanket_Parekh, files have been shared. Thank you.
Hi @moose
I got the attachments.
I found that few properties are missing from your board DTS file. Please add "fsl,spi-num-chipselects" and "cs-gpios" in ecspi node as per your board design. For more details please refer Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt.
Thanks & Regards
Sanket Parekh
Hi @Sanket_Parekh, I did add "fsl,spi-num-chipselects" and "cs-gpios" proprties and I was hoping this would be it but I still don't see spidev under "/dev". I do see the following new message in the kernel log:
spidev@0 enforce active low on chipselect handle
Below is the ecspi node definition. How should we proceed? Thx!
&ecspi2 {pinctrl-names = "default";pinctrl-0 = <&pinctrl_ecspi2>;status = "okay";fsl,spi-num-chipselects = <1>;cs-gpios = <&gpio5 13 0>;spidev@0{compatible = "spidev";reg = <0>;spi-max-frequency = <4000000>;};};
Hi @moose
I went through the kernel configuration file and found that lots of other options related to SPI are enabled in kernel configuration file. Please disable all the options and enable only the below mentioned options and check the same.
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_BITBANG=y
CONFIG_SPI_IMX=y
CONFIG_SPI_SPIDEV=y
Thanks & Regards
Sanket Parekh
Hi @Sanket_Parekh,
I removed the SPI configs as instructed, but I still can't see spidev. I attached the fragmentation file that removes the unnecessary SPI configs you mentioned as well as the final config file. If you see anything that I am supposed to remove, please let me know. Otherwise, please let me know how we should proceed. Thanks!
Hi @moose
Configuration changes looks good.
Can you please check the M4 core configuration like is M4 core using the SPI device or not? Because in this case it is possible to not create the SPIDEV at A53 core.
Thanks & Regards
Sanket Parekh
@Sanket_Parekh I am using imx8mn with builtin M7. I personally do not use the M7 for now, but my bsp is based on the imx8mn DDR3 EVK bsp. I am not as familiar with using the M7, but it seems that EVK code is assigning SAI3, GPT1, and UART4 to M7. I see this in the imx-boot code: