cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
deepak
Observer
Observer
163 Views
Registered: ‎02-04-2021

Install SPI module in Zynq

Hello,

I am trying to interface my Zynq board with external device using SPI. I selected SPI0 and SPI1 in Zynq PS in Vivado Hardware design and exported the design to petalinux. I enabled the SPI kernel modules in Petalinux by the command

petalinux-config -c kernel

under Device Drivers -> SPI Support and enabling the Xilinx SPI controller common moduleXilinx Zynq QSPI controller and User mode SPI device driver support.

I have mentioned the contents of the device tree below. 

Could you please guide me in how to get the spi drivers installed and make it available in Linux.

Currently /dev/spi* does not show any outputs.

zynq-7000.dtsi:

spi0: spi@e0006000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0006000 0x1000>;
status = "disabled";
interrupt-parent = <&intc>;
interrupts = <0 26 4>;
clocks = <&clkc 25>, <&clkc 34>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
};

spi1: spi@e0007000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0007000 0x1000>;
status = "disabled";
interrupt-parent = <&intc>;
interrupts = <0 49 4>;
clocks = <&clkc 26>, <&clkc 35>;
clock-names = "ref_clk", "pclk";
#address-cells = <1>;
#size-cells = <0>;
};

pcw.dtsi file:

&spi1 {
is-decoded-cs = <0>;
num-cs = <3>;
status = "okay";
};

system-top.dts file:

/dts-v1/;
#include "zynq-7000.dtsi"
#include "pl.dtsi"
#include "pcw.dtsi"
/ {
chosen {
bootargs = "earlycon";
stdout-path = "serial0:115200n8";
};
aliases {
i2c0 = &i2c0;
i2c1 = &i2c1;
serial0 = &uart1;
spi0 = &qspi;
spi1 = &spi0;
spi2 = &spi1;
};
memory {
device_type = "memory";
reg = <0x0 0x20000000>;
};
};
#include "system-user.dtsi"

Tags (2)
0 Kudos
0 Replies