The aim of this How To is to provide procedure for building the complete Linux system for Zynq-7000 AP SoC using an open source tool called Buildroot.
Table of Contents
|Table of Contents|
Buildroot is a tool that simplifies and automates the process of building a complete Linux system for an embedded system, using cross-compilation. Because of its configurability, it allows you to create a completely customized rootfs, which can then be used with the kernel of your preference. It can create complete embedded Linux system, containing boot loaders, kernel, devicetree and rootfs.
Table of Contents
In order to achieve this, Buildroot is able to generate a cross-compilation toolchain, a root filesystem, a Linux kernel image and a boot loader for your target.
Note: Buildroot is designed to run on Linux system. Steps provided in this tech tip are executed in Ubuntu Linux system. Before going to run the steps, update the below mentioned packages.
Buildroot will build most of the host packages it needs for the compilation. However, certain standard Linux utilities are expected to be already installed on the host system. Find the overview of the mandatory and optional packages (note that package names may vary for different distributions) in Appendix-A.
Configuring and building RootFS for Zynq-7000 AP SoC
This section describes how to configure and build the custom root filesystem for Xilinx Zynq-7000 AP SoC .With the default configuration mentioned below, the tool will create a bootable SD image with the default Buildroot settings and packages. It will create its own toolchain, using the hardfloat ABI, and cross compile the v2015.3 u-boot and kernel from the Xilinx git, using the ZC702 settings and device tree.
If you encounter an error related to DTC, verify if the host machine has DTC and that the PATH is set to right directory. If DTC is missing, refer appendix-A.
It will take some time to download and check required packages. Ensure that network proxy settings are done properly and all the packages required for Buildroot are installed on the host machine.
At this point, the generated rootfs output/images/rootfs.cpio.uboot can be used for your board. When using this rootfs with prebuilt images from the Xilinx wiki, this file should be renamed as uramdisk.image.gz and put on the SD card next to the BOOT.BIN, uImage and devicetree.dtb from the prebuilt images.
Note: Prebuilt images can be found at http://www.wiki.xilinx.com/Zynq+2015.3+Release
$ cp output/images/rootfs.cpio.uboot <SD>/uramdisk.image.gz
Creating bootable images for Zynq ZC702 board using U-boot SPL
The default Buildroot configuration for the ZC702 created above can also build the Linux kernel, u-boot and u-boot SPL. In order to create a bootable image for the ZC702 board, follow these additional steps:
$ mkdir -p output/images/sd
$ cp output/images/boot.bin output/images/sd
$ cp output/images/uImage output/images/sd
$ cp output/images/u-boot.img output/images/sd/u-boot.img
$ cp output/images/zynq-zc702.dtb output/images/sd/devicetree.dtb
$ cp output/images/rootfs.cpio.uboot output/images/sd/uramdisk.image.gz
At this point, the contents of the output/images/sd folder can be copied on an SD card, and used to boot the ZC702 board. After booting the zc702 board with these images, buildroot prompt will be appear. For quick testing, use the ZC702_sd_card_images provided as a part of design files along with this tech tip.
Copy following images in SD-card
ZC706 Default Configuration
The default configuration for the ZC706 board is created using this:
$ cat > configs/zc706_defconfig << EOF
When targeting the ZC706, this configuration can be applied, and the rest of the flow is similar.
For creating bootable images for zc706 board, use the ps7_init files path of zc706 board, and build images.
Appendix A - System Requirements