BCM2835: SPI on Linux 5.10

Deniz Uğur deniz343 at gmail.com
Thu Apr 29 13:10:10 BST 2021


Hi Stefan,

> so you actual problem is that there is no /dev/spidevX.X?

Yes, that’s correct.

> the upstream DTS doesn't contain the spidev.

Just to be sure, the following line is present in my kernel tree as you pointed out. Inside spidev.c
{ .compatible = "spidev,loopback” }

I still can’t seem to bring up the /dev/spidevX.X. The linux tree I use is located here [1] (It should be parallel to the mainline if you opt out of Dovetail interface). According to the maintainers the SPI was working on RPi 2/3/4 [2] so I think there is a problem on my end. 

If I’m not asking too much, could you try boot 5.10 on RPi 3B or 4B and tell me if SPI is present? I’m not sure what I miss during this procedure.

Thanks.

[1] - https://git.evlproject.org/linux-evl.git/tree/drivers/spi?h=evl%2Fv5.10
[2] - https://git.evlproject.org/libevl.git/tree/tidbits/oob-spi.c

> On 29 Apr 2021, at 14:12, Stefan Wahren <stefan.wahren at i2se.com> wrote:
> 
> Hi Deniz,
> 
> Am 28.04.21 um 22:51 schrieb Deniz Uğur:
>> Hi Stefan,
>> 
>> Thanks for the reply.
>> 
>>> Could you please name the SPI device?
>> I can’t say I’m quite sure what you mean. I’m going to use Broadcom 
>> AS38-H39E Encoder but just accessing the /dev/spidev0.0 should be enough.
> 
> so you actual problem is that there is no /dev/spidevX.X?
> 
> I hope it's okay, if i just point you in the right direction [1]. The
> "problem" is that the upstream DTS doesn't contain the spidev.
> 
> Best regards
> 
> [1] - https://yurovsky.github.io/2016/10/07/spidev-linux-devices.html
> 
>> 
>>> How do you want to access it? Via SPI device (userspace) or directly
>>> with a SPI protocol driver (kernelspace)?
>> User space would be my preferance. But at this point I can be flexible.
>> 
>> Be well.
>> Deniz.
>> 
>>> On 28 Apr 2021, at 23:43, Stefan Wahren <stefan.wahren at i2se.com> wrote:
>>> 
>>> Hi Deniz,
>>> 
>>> regarding to the mainline kernel especially for SPI, you are a bit out
>>> of the comfort zone. config.txt or raspi-config wont help you here.
>>> 
>>> Could you please name the SPI device?
>>> 
>>> How do you want to access it? Via SPI device (userspace) or directly
>>> with a SPI protocol driver (kernelspace)?
>>> 
>>> Regards
>>> Stefan
>>> 
>>> Am 28.04.21 um 19:53 schrieb Deniz Uğur:
>>>> Hi all,
>>>> 
>>>> I wanted to ask for some guidance on enabling SPI with Linux 5.10 mainline kernel. I’m trying to use EVL RTOS [1] but even without using the Dovetail interface, the vanilla Linux fails to bring up SPI device. There is no error log on /var/log/syslog so I’m not sure what other form of log I can provide.
>>>> 
>>>> I simply configure the kernel with multi_v7_defconfig and compile it using the armhf cross-compiler. After the build, I install the modules, copy the image and appropriate DTB file. On config.txt, I add device_tree and kernel parameters and nothing else. The base image is RaspianOS Lite, so I’ve enabled the SPI interface via raspi-config too. I have also tried it on Debian’s and Ubuntu’s RPi image but none of them changed anything. I think there is a configuration problem or SPI isn’t supported on Linux 5.10 (which I highly doubt). I haven’t touched the defconfig because SPI was already enabled in the config.
>>>> 
>>>> I’ve tested this on RPi 3B and I’m going to test it on 4B this evening.
>>>> 
>>>> I’m highly interested in the comments you guys have on this subject and any possible solution to bring up the SPI device.
>>>> 
>>>> Thanks in advance.
>>>> Deniz.
>>>> 
>>>> [1]: https://evlproject.org/
>>>> _______________________________________________
>>>> linux-rpi-kernel mailing list
>>>> linux-rpi-kernel at lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel




More information about the linux-rpi-kernel mailing list