kumquat-buildroot/board/zynq
Luca Ceresoli 6465e4d34a boards/zynq: rename the DTB to be loaded by U-Boot
We are about to introduce genimage support for the Zynq boards. For
all of them U-Boot loads the DTB from a file named "devicetree.dtb" so
we need to rename it on the SD card image.

We could use genimage itself to rename files while creating the
image. But this would require a different genimage.cfg for each board,
leading to duplicate code.

Instead let's create a "devicetree.dtb" symlink pointing to the dtb
listed in the configuration. Currently all the Zynq-based boards have
only one DTS configured, but if one had two or more of them, the
symlink would point to the first one.

[Peter: only create symlink if dtb option is available]
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-12-11 22:35:12 +01:00
..
post-image.sh boards/zynq: rename the DTB to be loaded by U-Boot 2017-12-11 22:35:12 +01:00
readme.txt zynq: document how to use custom ps7_init files 2016-10-09 22:45:58 +02:00

This is the Buildroot support for Zynq boards.  Zynq boards are available from
Xilinx and some third party vendors, but the build procedure is very similar.

Currently, three boards are natively supported by Buildroot:
 - Xilinx ZC706 board (zynq_zc706_defconfig)
 - Avnet ZedBoard (zynq_zed_defconfig)
 - Avnet MicroZed (zynq_microzed_defconfig)

Steps to create a working system for a Zynq board:

1) Configuration (do one of the following)
    make zynq_zc706_defconfig     (ZC706)
    make zynq_zed_defconfig       (Zedboard)
    make zynq_microzed_defconfig  (MicroZed)
2) make
3) All needed files will be available in the output/images directory.
   Create a FAT32 partition at the beginning of your SD Card and copy files:
     - boot.bin
     - u-boot.img
     - uImage
     - uramdisk.image.gz (should be renamed from rootfs.cpio.uboot)
     - devicetree.dtb (should be renamed from zynq-***.dtb)
   into your SD card
4) boot your board

You can alter the booting procedure by creating a file uEnv.txt
in the root of the SD card. It is a plain text file in format
<key>=<value> one per line:

kernel_image=myimage
modeboot=myboot
myboot=...

Note:
The DTB for MicroZed is the same as the one for the Zedboard (zynq-zed.dtb),
and this is the recommended solution, see
https://forums.xilinx.com/t5/Embedded-Linux/Microzed-default-device-tree-dts/td-p/432856.

References:
 - ZC706 information including schematics, reference designs, and manuals are
   available from
   http://www.xilinx.com/products/boards-and-kits/ek-z7-zc706-g.html.

 - Zedboard/Microzed information including schematics, reference designs, and
   manuals are available from http://www.zedboard.org .

Support for other boards:

If you want to build a system for other boards based on the same SoC
(for ex. Digilent Zybo board), and the board is already supported by
the upstream kernel and U-Boot, you simply need to change the
following Buildroot options:

 - Kernel Device Tree file name (BR2_LINUX_KERNEL_INTREE_DTS_NAME)
 - U-Boot board defconfig (BR2_TARGET_UBOOT_BOARD_DEFCONFIG)

Custom ps7_init_gpl.c/h support:

To generate a working boot.bin image, ps7_init_gpl.c/h are required in
the U-Boot source tree. Without those files, boot.bin will be built
successfully but it will not be functional at all. Those files are
output from the Xilinx tools, but for convenience, U-Boot includes the
default ps7_init_gpl.c/h of popular boards. Those files may need to be
updated for any programmable logic customizations which impact
ps7_init (clock/pin setup & mapping/AXI bridge setup/etc). See
board/xilinx/zynq/ directory of U-Boot for natively supported ps7_init
files. If the ps7_init files for your board are not found in U-Boot,
you need to add them by yourself.

1) Start with a defconfig supported by Buildroot (e.g. Zedboard)
    make zynq_zed_defconfig

2) make uboot-menuconfig
    Visit the following menu and enable CONFIG_ZYNQ_CUSTOM_INIT.

    ARM architecture  --->
       [*] Use custom ps7_init provided by Xilinx tool

3) Copy ps7_init_gpl.c/h generated by the Xilinx tools into
   output/build/uboot-xilinx-<pkg version>/board/xilinx/zynq/custom_hw_platform/

4) make

Note: The files in step 3 will need to be re-copied after cleaning the
output directory and at this time, there is no way to save them as
part of the buildroot configuration, except as a U-Boot patch.