Preparing a device tree blob (DTB)

The device tree blob is required to boot the Zynq with the Linux operating system. It can be created using the Xilinx SDK or Yocto.

Create the DTB using Xilinx SDK

Install the Xilinx device-tree-xlnx repository:

git clone git://github.com/Xilinx/device-tree-xlnx.git

Open the Xilinx SDK. On a Linux system (adjust paths accordingly):

source /opt/xilinx/SDK/2017.4/settings64.sh
xsdk

Add the Xilinx device-tree-xlnx repository to the SDK:

> Xilinx Tools > Repositories
   Global Repositories: > New ...
   add <path to device-tree-xlnx>

Create new device tree files:

> File > New > Board Support Package
   Board Support Package OS: device-tree
> Finish
> OK

The result are a file "system-top.dts" and other files "*.dtsi" in the device_tree_bsp_0 sub-directory.
In order to create a device tree blob you need the device tree compiler "dtc". You can find it e.g. in the linux-xlnx repository or in your Yocto build under <yocto_build_dir>/tmp/sysroots/x86_64-linux/usr/bin/dtc.
You run the dtc on the top-level .dts file like the following:

dtc -I dts -O dtb -o system-top.dtb system-top.dts 

Create the DTB using Yocto

Alternatively to using the Xilinx SDK, you can also let Yocto build the device tree blob. For that you have to tell it where to find the device tree file.
Edit the conf/machine/<machine>.conf file of your meta layer to contain the following lines, replace "XXXX" with the name of your choice and <machine> with your machine name:
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "device-tree"

XXXX_DEVICETREE_PATH = "<path_to_project>/device_tree_bsp_0"

MACHINE_DEVICETREE := " \
                ${XXXX_DEVICETREE_PATH}/zynq-7000.dtsi \
                ${XXXX_DEVICETREE_PATH}/pl.dtsi \
                ${XXXX_DEVICETREE_PATH}/pcw.dtsi \
                ${XXXX_DEVICETREE_PATH}/system-top.dts \
                "
DEPLOY_KERNEL_DTB_<machine> = "1"

When building your image, Yocto will produce the device tree blob in the file <yocto_build_dir>/tmp/deploy/images/<machine>/system-top.dtb.

-- RalfSpiwoks - 2018-05-25

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2018-05-25 - RalfSpiwoks
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    SystemOnChip All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback