Sorry, you need to enable JavaScript to visit this website.

spidev not active in 7z020

Zedboard forums is currently read-only while it under goes maintenance.

Unsolved
4 posts / 0 new
ashahsana
Junior(1)
spidev not active in 7z020

Hello
I am working on 7z020 board. I want to use spi device.I am telling the whole detail what i did and where I am stuck.
To activate spidev I recompile the uImage
So I did the following steps and made my u-boot and then uImage
U-boot:
$git clone -b xlnx_v2015.3 git://github.com/Xilinx/u-boot-xlnx.git
$export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
$make zynq_zed_config
$make
I got u-boot

For uImage:
$git clone -b xlnx_v2015.3 git://github.com/Xilinx/linux-xlnx.git
after that to make relation between this u-boot and uImage
$ $export PATH=$PATH:$PWD (pwd=U-boot-xlnx/tools)
$make xilinx_zynq_defconfig
In the xilinx_zynq_defconfig all the spi are active bydefault
"CONFIG_SPI=y
CONFIG_SPI_CADENCE=y
CONFIG_SPI_XILINX=y
CONFIG_SPI_ZYNQ_QSPI=y"
$ make menuconfig
make menuconfig ->device driver ->SPI support -> then enabled xilinx SPI controller common module.
and also add the following lines in zynq_7000.dtsi
spi0: spi@e0006000 {
compatible = "xlnx,zynq-spi-r1p6";
reg = <0xe0006000 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>;
spidev@0{
compatible="spidev";
reg =<0>; //chipselect 0
spi-max-frequency= <50000000>;
};
spidev@1{
compatible="spidev";
reg =<1>; //chipselect 1
spi-max-frequency= <50000000>;
};
};
In last run the following command
$make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

devicetree:

I add following in the zynq_zed.dts (because I read in tutorial/forum "There is no device tree generator yet for Zynq. yet such that hand editing the device tree is the current method."
&spi0 {
status = "okay";
reg = <0xe0006000 0x1000>;
} ;
then $make ARCH=arm zynq_zed.dtb
I am using 14.7-release so I only changed uImage ,u-boot and devicetree.dtb the system runs reached the terminal root#
but no /dev/spidev is visible.

Itried to make my own boot.bin for that i made my design in XpS genrate bit stream
after that I export the hardware to sdk and make fsbl
SDK->New->application project ->
project name->fsbl
hardware platform ->system_hw_platform
processor ->ps7_cortex9_0
OS platform ->standalone
Board support package ->create new
and then selct zynq_fsbl ->result fsbl.elf

I use this fsbl+system.bit+u-boot.elf(recompile by myself)->boot.bin the result is
"reading zImage

** Unable to read "zImage" from mmc 0:1 **
reading devicetree.dtb

9693 bytes read
reading ramdisk32M.image.gz

** Unable to read "ramdisk32M.image.gz" from mmc 0:1 **
## Starting application at 0x00008000 ..."

then I copied zImage and ramdisk32M.image.gz then it stops at the following line
"3871273 bytes read
## Starting application at 0x00008000 ..." (I read from the forum that it could be the devicetree means some problem. I changed my devicetree to the 2015.2-release but the result is same)

I hope you understand my problem and any suggestion are most welcome
Thanks
Sana

hockeyman1972
Junior(11)
Smaller bites

Sana,
  You have multiple problems here, which must be solved one at a time.   If you haven't done this already, start with a working, known good design.   Using an old tool flow and trying to piece together different versions of u-boot and kernel, while simultaneously trying to change the device tree is a difficult way to build a working solution.
The first problem to address is why uboot is unable to load the files you have created on sd.  This indicates that you are using mismatched versions of u-boot and kernel, and u-boot is probably expecting a uImage rather than a zImage.
I would recommend using a PetaLinux BSP for your board, which already has everything packaged correctly in one place in the build environment.  Once you get some experience with this, you can move on to the traditional open source build environment if you need to.
Ron

ashahsana
Junior(1)
thanks RON

thanks RON
I am using 2015.3 version for both u-boot and uImage.
so that means i have to make u-boot and u-Image and no change in devicetree and try??
and the last thing in the SDK when I am making BSP i cannot find any petalinux option. I am using ISE 14.7 version.
thanks

ashahsana
Junior(1)
Hello again

Hello again
There was some mistake in devicetree.dtb . Now it works perfect and i can see spidev in /dev directory.
thanks for your reply