Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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

Introduction

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

...

System Requirements

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.

...


$ make

Note -
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.

Output Files


Copy following images in SD-card

View file
nameboot.bin

...

View file
nameuramdisk.image.gz

ZC706 Default Configuration

The default configuration for the ZC706 board is created using this:

$ cat > configs/zc706_defconfig << EOF
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_EABIHF=y
BR2_ARM_ENABLE_NEON=y
BR2_ARM_FPU_VFPV3=y
BR2_KERNEL_HEADERS_4_0=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Xilinx/linux-xlnx"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2015.3"
BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zc706"
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y
BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BOARDNAME="zynq_zc70x"
BR2_TARGET_UBOOT_CUSTOM_GIT=y
BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/Xilinx/u-boot-xlnx"
BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="xilinx-v2015.3"
BR2_TARGET_UBOOT_FORMAT_IMG=y
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="boot.bin"
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

Mandatory Packages


Build tools:

...