SPI Driver in Xillinux

Questions and discussions about the Xillybus IP core and drivers

SPI Driver in Xillinux

Postby gibinchacko90 » Wed Jul 05, 2017 1:48 pm

I am trying to communicate to high-speed ADC through FMC connector in Zedboard, the control parameters are sent via SPI protocol. I have implemented SPI0 in PS and successfully ran tests on SDK. Now I want to port to Xillinux, is there any SPI driver to install and functions available to send data via SPI. I have edited the devicetree as following:
spi0: spi@e0006000 {
compatible = "xlnx,ps7-spi-1.00.a";
reg = <0xE0006000 0x1000>;
interrupts = <0 26 4>;
interrupt-parent =<&ps7_scugic_0>;
speed-hz = <50000000>;
bus-num = <0>;
num-chip-select = <4>;
#address-cells = <1>;
#size-cells = <0>;
spidev: spidev@0 {
compatible = "linux,spidev";
spi-max-frequency = <100000>;
reg = <0>;
};
spidev@1 {
compatible = "linux,spidev";
spi-max-frequency = <100000>;
reg = <1>;
};
spidev@2 {
compatible = "linux,spidev";
spi-max-frequency = <100000>;
reg = <2>;
};

Booting is successful and terminal command (ls -l /dev/spi*) shows SPI devices as following:
:# ls -l /dev/spi*
crw------- 1 root root 153, 0 Jan 1 00:00 /dev/spidev32766.0
crw------- 1 root root 153, 1 Jan 1 00:00 /dev/spidev32766.1
crw------- 1 root root 153, 2 Jan 1 00:00 /dev/spidev32766.2

How to go forward to write an application to send data through SPI protocol? Please Help.
gibinchacko90
 
Posts: 1
Joined: Wed Sep 07, 2016 1:26 pm

Re: SPI Driver in Xillinux

Postby support » Wed Jul 05, 2017 1:58 pm

Hello,

You may want to look on these two threads regarding integration of SPI in Xillinux:

viewtopic.php?f=4&t=455
viewtopic.php?f=4&t=456

Other than that, using SPI under Xillinux (and spidev in particular) is exactly like any Linux system.

Note the kernel's own documentation, in the kernel source tree: Documentation/spi/spidev
and an example user-space program: Documentation/spi/spidev_test.c

Regards,
Eli
support
 
Posts: 482
Joined: Tue Apr 24, 2012 3:46 pm


Return to Xillybus

cron