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

Error while building a new Device Tree

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

Unsolved
8 posts / 0 new
sticken
Junior(0)
Error while building a new Device Tree

Hello everybody!

I found a perfectly working ZedBoard configuration here (bottom of the page): http://digilentinc.com/Products/Detail.cfm?NavPath=2,400,1028&Prod=ZEDBOARD

With that configuration I'm able to generate bitstream, exporting to XPS and I can write C programs (Linux and Bare Metal). I added a custom peripheral following Zynq Geek's useful tutorial and now I want to add this component to a new device tree. I'm trying to do this because I think it's necessary when a custom peripheral has to send an interrupt request to the PS (I'm working on this). When I try to generate a new device-tree, following http://xilinx.wikidot.com/device-tree-generator, I get this error:

ERROR:EDK - device-tree () - can't read "vdma_device_id": no such variable
ERROR:EDK:3416 - Error(s) while running TCL procedure generate().
make: *** [ps7_cortexa9_0/lib/libxil.a] Error 2
make: Target `all' not remade because of errors.

How can I solve this problem? Where can I set "vdma_device_id" variable such that it contains a valid value?

Thanks for your answers,

sticken

m.russell
Junior(0)
Hi

Hi

I think I remember reading that the device tree generator is not supported for the Zynq. Try following this tutorial to learn more about the device tree:

http://xillybus.com/tutorials/device-tree-zynq-1

You can get the Digilent kernel used in the zedboard by cloning the link below. After that you can decompile the device tree, make your changes and compile it.

https://github.com/Digilent/linux-digilent.git

Matthew

sticken
Junior(0)
ok, but..

Hello Matthew and thank you for your useful hints. I downloaded the Digilent kernel and read the tutorial, but I still don't understand something. Do I have to compile the kernel? Typing "make ARCH=arm digilent_zed_defconfig" from "linux-digilent" folder produced this:

"make[1]: *** No rule to make target `digilent_zed_config'. Stop.
make: *** [digilent_zed_config] Error 2"

I guess I have to compile the kernel, because when I type "make ARCH=arm scripts", I get:

"make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target `include/config/auto.conf', needed by `scripts'. Stop.
"
Maybe this can be useful: my CROSS_COMPILE variable contains "arm-xilinx-linux-gnueabi-"

Thank you,

sticken

m.russell
Junior(0)
Compiling the Kernel

Sorry, that's my fault. The guide I linked you to is Xillinux specific (but it is the best guide out there). As mentioned in the guide you can get the dtc separately which may be advisable. These instructions may be a bit out of date, but to compile the kernel:

1. After cloning the source, create a new branch at the v3.3.0-digilent-12.07-zed-beta commit:
git checkout -b zedboard_oob v3.3.0-digilent-12.07-zed-beta

2. Make sure your environment variables are set as described in this link:
http://wiki.xilinx.com/zynq-tools

3. Copy the .config from the OOB design (linux/.config) to the kernel directory:
http://www.zedboard.org/node/241
[NOTE: The OOB design README is where I got these instructions from]

4. Build using:
make ARCH=arm

Once that's done, the devicetree can be decompiled, edited, and recompiled as explained before. Hope that clears things up.

Matthew

sticken
Junior(0)
Perfect

Hi Matthew,

I followed your instructions and I managed to compile the kernel and the .dts file: thank you again! Do I have to copy the new zImage to the SD, such that Linux can "see" the new devices listed in my dts/dtb? Or this happens because the kernel loads the dtb itself?

Thank you

sticken

m.russell
Junior(0)
Provided you haven't changed

Provided you haven't changed anything in the kernel the zImage should be the same as the one that came with the Zedboard (but you can copy it if you want). The kernel loads the device tree at boot time to determine what hardware it is running on, and which drivers it needs to load. Just copy your edited devicetree_ramdisk.dtb and BOOT.bin files to the SD Card and it should boot with your custom hardware.

Matthew

jays_zedb
Junior(0)
the vdma_device_id is not setup in the tcl

On ubuntu 12.10 workstation using the early zynq device tree builder per
xilinx.wikidot.com/device-tree-generator
as
git.xilinx.com/device-tree.git bsp/device-tree_v0_00_x
after figuring out the right top directory to point the SDK repository too etc. to get the build setup and running..

ERROR:EDK - device-tree () - can't read "vdma_device_id": no such variable
ERROR:EDK - Error(s) while running TCL procedure generate().
make: *** [ps7_cortexa9_0/lib/libxil.a] Error 2
make: Target `all' not remade because of errors.

It appears that the vdma_device_id variable has not been set to a default value and some fuction call causes a error.

gedit device-tree_v2_1_0.tcl

then find
variable vdma_device_id

change it to
variable vdma_device_id 0

save and now run in SDK
now I get a final output

I had to hand edit the compatible and model
strings and setup the proper chosen in the SDK produced default ps7_cortexa9_0/libsrc/device-tree_v0_00_x/xilinx.dts devicetree before starting things.
This is for a zc702 board using the base AD7511, which is not supported under the current Xilinx linux kernel build; whereas the new Digilent linux and older Analog Devices linux builds do have the proper support for the basic AD7511 HDMI and zcomms fmc card.
At this point it only boots the kernel up to the point I get “turn off boot console earlycon0” on my terminal screen.
Whereas the older default zync zc702 dts built from Digilent linux path fully boots to a give terminal prompt.
I suspect one of the name changes or serial alias in the newer style SDK generated dts still has issues with my kernel build or the uramdisk image I am using.

A lot has changed in how the zync boards are structured in u-boot, the device tree, and kernel defconfigs files in the past year. Depended on the u-boot configuration the kernel and rootfs loaded differently, the Digilent u-boot has hooks to keep using the older zImage and ramdisk8M using the go command instead of bootm for a ZED board build where as the xc702 does not unless you edit things.
I am trying to use the newer bootm format with a uImage built under Digilent linux, all the fun. Just that all the changes and board differences will leave one swinging from a tree branch.