04-02-2017 04:43 AM
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?
04-02-2017 05:48 AM
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.
04-02-2017 10:14 AM
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.
04-02-2017 10:18 AM
Hi
Please check whether CONFIG_SPIDEV in linux kernel has been enabled?
Best Regards
Shabbir
04-02-2017 10:50 AM
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
05-15-2018 01:12 PM
Which directory and file did you find "CONFiG_SPIDEV" I'm using Petalinux 2017.3?
05-15-2018 01:13 PM
Which directory and file is "CONFiG_SPIDEV", I'm using petalinux 2017.3?
03-08-2019 06:32 AM
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.