UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer kmbm
Observer
3,540 Views
Registered: ‎01-11-2016

Petalinux no spidev in /dev

Hi, 

I'm writing here because I have a problem with my spi. I'm working on Zybo board. I'd like to use SPI1 on my PMOD JF (MIO10...15). Unfortunatelly I don't have spidev enable in /dev. Here is my device tree structure for spi.

 

&spi1 {
	is-decoded-cs = <0>;
	num-cs = <1>;
	status = "okay";
        spidev@0x0{
                 compatible = "spidev";
                 spi-max-frequency = <20000000>;
                 reg = <0>;
        };
};

 What can be wrong? 

0 Kudos
7 Replies
Moderator
Moderator
3,525 Views
Registered: ‎12-04-2016

Re: Petalinux no spidev in /dev

Hi

 

 

First off, Are you able to see spidev entry in sysfs? something like this:

root@linspace:~# cat /sys/bus/spi/devices/spi1.0/

 

 

You should make changes to the dts files:

 

In zynq-7000.dtsi, made status as  “okay” of spi1. I think its done in your case looks like.

 

NowiIn system-conf.dtsi, add spi1 under aliases as shown in the very last image below:

 

In system-top.dtsi, add similar to users spi devices

 

After making the above changes in dts files rebuilt the kernel images and booted it.

zynq7000.dtsi.png
system-conf.dtsi.png
systemtop.dtsi.png
0 Kudos
Highlighted
Observer kmbm
Observer
3,502 Views
Registered: ‎01-11-2016

Re: Petalinux no spidev in /dev

Thanks for your reply. In cat /sys/bus/spi/devices I have both spi 0 and 1. I do everything what you wrote but it still doesn't work. The only difference which I have is that I put alias into the system-top.dts. System-conf.dts is automatically generated file and i 've never edit it before and always aliases included in system-top.dts worked.

0 Kudos
Moderator
Moderator
3,496 Views
Registered: ‎12-04-2016

Re: Petalinux no spidev in /dev

Hi

 

Please check whether CONFIG_SPIDEV in linux kernel has been enabled?

 

 

Best Regards

Shabbir

0 Kudos
Observer kmbm
Observer
3,493 Views
Registered: ‎01-11-2016

Re: Petalinux no spidev in /dev

That was a hint. Thanks a lot. I had enabled CONFG_SPI but not CONFiG_SPIDEV. 

 

I have one more question. I havo also 3 gpio pins. I can't find theirs indexes in sys/class/gpio when I want to export it. Is there any quick way to find the first index of gpio? I remember that what i do sth similar in the past I had the same problem and the idxs starts from probably 180 which was a bit strange

0 Kudos
Adventurer
Adventurer
1,481 Views
Registered: ‎07-05-2017

Re: Petalinux no spidev in /dev

Which directory and file did you find "CONFiG_SPIDEV" I'm using Petalinux 2017.3?

0 Kudos
Adventurer
Adventurer
1,478 Views
Registered: ‎07-05-2017

Re: Petalinux no spidev in /dev

Which directory and file is "CONFiG_SPIDEV", I'm using petalinux 2017.3?

0 Kudos
Contributor
Contributor
160 Views
Registered: ‎10-29-2018

Re: Petalinux no spidev in /dev

Hallo aynilian,

you can find it using command

petalinux-config -c kernel  and go to Device Drivers > SPI support>User mode SPI device driver support 

active it by typing 'y'

i hope this will answer your question.

 

0 Kudos