SPI
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: SPI
Well, the SPI bus on the extension connector E2 is connected to the ZYNQ's SPI 1 interface, which in turn is made available to the linux kernel by the following block in the devicetree:
So, you would probably start by writing a module that registers a new class on this spi-bus, then searches the bus for your specific device and register itself as the driver if found.
Code: Select all
ps7_spi_1: ps7-spi@e0007000 {
bus-num = <2>;
compatible = "xlnx,ps7-spi-1.00.a";
interrupt-parent = <&ps7_scugic_0>;
interrupts = < 0 49 4 >;
num-chip-select = <4>;
reg = < 0xe0007000 0x1000 >;
speed-hz = <166666672>;
xlnx,has-ss0 = <0x1>;
xlnx,has-ss1 = <0x0>;
xlnx,has-ss2 = <0x0>;
xlnx,spi-clk-freq-hz = <0x9ef21b0>;
} ;
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: SPI
This code was from the "devicetree.dts" file that's being generated dynamically during the Red Pitaya build process.
The relevant Makefile targets are "devicetree" from RedPitaya/FPGA/release1/fpga/Makefile:
and RedPitaya/FPGA/release1/fpga/vivado/red_pitaya.sdk/SDK/SDK_Export/device-tree_bsp_0/Makefile:
The compiled devicetree is part of the ecosystem, so if you booted your Red Pitaya with the standard ecosystem, linux already knows about the SPI bus on E2.
Loading another FPGA *.bin into /dev/xdevcfg will not change this.
The relevant Makefile targets are "devicetree" from RedPitaya/FPGA/release1/fpga/Makefile:
Code: Select all
devicetree:
make -C $(SDK_DIR)/device-tree_bsp_0/ -k all
Code: Select all
# Makefile generated by Xilinx SDK.
-include libgen.options
LIBRARIES = ${PROCESSOR}/lib/libxil.a
MSS = system.mss
all: libs
@echo 'Finished building libraries'
libs: $(LIBRARIES)
$(LIBRARIES): $(MSS)
libgen -hw ${HWSPEC}\
${REPOSITORIES}\
-pe ${PROCESSOR} \
-log libgen.log \
$(MSS)
clean:
rm -rf ${PROCESSOR}
Loading another FPGA *.bin into /dev/xdevcfg will not change this.
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 5 guests