您尚未登录。

楼主 # 2022-01-26 16:27:10

droptop
会员
注册时间: 2022-01-26
已发帖子: 17
积分: 20

No Spidev device

Hi everyone,

I recently just built flashed the r3 with a nand image, using the sources from this repo.

cat /lib/modules/5.4.99/modules.builtin | grep spi 

  confirms the presence of the spidev module. However there isn't any

/dev/spi*

file.  Looking at the contents of the file 'board/widora/mangopi/r3/devicetree/linux/devicetree.dts' I only find the device node for the first SPI controller (spi0) with child nodes spi-nor & spi-nand and none for the second SPI controller (spi1 ?). Do I need add another SPI device node to these file?? or is there something I'm missing??

Any help would be much appreciated

离线

#1 2022-01-26 16:33:47

孤星泪
会员
注册时间: 2020-03-18
已发帖子: 235
积分: 231

Re: No Spidev device

please check CONFIG_SPI_SPIDEV=y

离线

楼主 #2 2022-01-27 16:00:37

droptop
会员
注册时间: 2022-01-26
已发帖子: 17
积分: 20

Re: No Spidev device

Thank you @Lone Star Tears, for the quick response and sorry I'm only getting back now.

This is the section where CONFIG_SPI_SPIDEV is already set.

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=y
# CONFIG_SPI_LOOPBACK_TEST is not set
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPI_SLAVE is not set
# CONFIG_SPMI is not set
# CONFIG_HSI is not set
...

Do I need to set CONFIG_SPI_SLAVE??. And also what make target do I use to avoid recompiling everything.

离线

#3 2022-01-27 16:13:48

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 389
积分: 338

Re: No Spidev device

check the device tree compatible property, try "rohm,dh2228fv"

离线

楼主 #4 2022-01-27 17:56:39

droptop
会员
注册时间: 2022-01-26
已发帖子: 17
积分: 20

Re: No Spidev device

Hi shaoxi2010,,

Checked board/allwinner/suniv-f1c100s/devicetree/linux/suniv-f1c100s.dtsi and board/widora/mangopi/r3/devicetree/linux/devicetree.dts. Got nothing

离线

#5 2022-01-27 18:31:21

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 389
积分: 338

Re: No Spidev device

the spidev need a device tree node, such as this.

&spi0 {
    spidev@0 {
        compatible = "rohm,dh2228fv";
        reg = <0>;
        spi-max-frequency = <24000000>;
    };
};

离线

楼主 #6 2022-01-27 19:06:03

droptop
会员
注册时间: 2022-01-26
已发帖子: 17
积分: 20

Re: No Spidev device

Yup I added it. Looking at the source (board/widora/mangopi/r3/devicetree/linux/devicetree.dts) there is no configuration for the second SPI controller (spi1), so I added one. Also the compatible string I use is 'linux,spidev'. I now get the device in /dev but it seems the a test program shows the SPI port isn't working. I'll keep trying..

最近编辑记录 droptop (2022-01-27 19:17:30)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn