spidev not listed in /dev

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

spidev not listed in /dev

跳至解决方案
18,767 次查看
moose
Contributor IV

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

0 项奖励
回复
1 解答
16,706 次查看
moose
Contributor IV

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

在原帖中查看解决方案

0 项奖励
回复
29 回复数
15,392 次查看
moose
Contributor IV

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!

0 项奖励
回复
15,383 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @moose 

You have mentioned about .dtsi file. Have you checked your board specific DTS file?

Thanks & Regards

Sanket Parekh

0 项奖励
回复
15,375 次查看
moose
Contributor IV

@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?

0 项奖励
回复
15,348 次查看
moose
Contributor IV

@Sanket_Parekh any update on this? Thx!

0 项奖励
回复
15,589 次查看
_angelo_
Contributor III

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. 

0 项奖励
回复
15,643 次查看
_angelo_
Contributor III

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.

0 项奖励
回复
15,804 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Please check if you open the config.You can compare your config and official config.

:~# ls /dev/spidev1.0
/dev/spidev1.0
0 项奖励
回复
15,794 次查看
moose
Contributor IV

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!

0 项奖励
回复
15,776 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Have you checked the kernel log about SPI driver? Maybe the driver does not be loaded correctly.

0 项奖励
回复
15,759 次查看
moose
Contributor IV

Yes, I checked the kernel log, and there are no errors related to SPI.

0 项奖励
回复
15,704 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
15,695 次查看
moose
Contributor IV

Hi @Sanket_Parekh, files have been shared. Thank you.

0 项奖励
回复
15,689 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @moose 

I am sorry, But attachment is missing in your last reply.

Thanks & Regards

Sanket Parekh

0 项奖励
回复
15,681 次查看
moose
Contributor IV
I sent them in a private message. Did you not receive the message?
0 项奖励
回复
15,667 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
15,663 次查看
moose
Contributor IV

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

 

0 项奖励
回复
15,651 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
15,645 次查看
moose
Contributor IV

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! 

0 项奖励
回复
15,640 次查看
Sanket_Parekh
NXP TechSupport
NXP TechSupport

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

0 项奖励
回复
15,638 次查看
moose
Contributor IV

@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:

+ mcu_rdc {
+ compatible = "imx8m,mcu_rdc";
+ /* rdc config when MCU starts
+ * master
+ * SDMA3p --> domain 1
+ * SDMA3b --> domian 1
+ * SDMA3_SPBA2 --> domian 1
+ * peripheral:
+ * SAI3 --> Only Domian 1 can access
+ * UART4 --> Only Domian 1 can access
+ * GPT1 --> Only Domian 1 can access
+ * memory:
+ * no MRC should be configured when GPU3D is disabled.
+ * end.
+ */
+ start-config = <
+ RDC_MDA RDC_MDA_SDMA3p DID1 0x0 0x0
+ RDC_MDA RDC_MDA_SDMA3b DID1 0x0 0x0
+ RDC_MDA RDC_MDA_SDMA3_SPBA2 DID1 0x0 0x0
+ RDC_PDAP RDC_PDAP_SAI3 PDAP_D1_ACCESS 0x0 0x0
+ RDC_PDAP RDC_PDAP_UART4 PDAP_D1_ACCESS 0x0 0x0
+ RDC_PDAP RDC_PDAP_GPT1 PDAP_D1_ACCESS 0x0 0x0
+ 0x0 0x0 0x0 0x0 0x0
+ >;
+ /* rdc config when MCU stops
+ * memory:
+ * no MRC should be configured when GPU3D is disabled.
+ * end.
+ */
+ stop-config = <
+ 0x0 0x0 0x0 0x0 0x0
+ >;
+ };
 
In the machine.conf, we are loading the following firmware in M7:
WKS_FILE_DEPENDS:append = " imx-m7-demos"
IMAGE_BOOT_FILES += " \
imx8mnddr3l_m7_TCM_hello_world.bin \
imx8mnddr3l_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \
imx8mnddr3l_m7_TCM_rpmsg_lite_str_echo_rtos.bin \
imx8mnddr3l_m7_TCM_sai_low_power_audio.bin \
"
 
It doesn't seem to me that the M7 is using SPI.
0 项奖励
回复