Build kernel


This how-to describes the process of building the Linux kernel.  This is a part of the Xilinx design flow described in Xilinx Open Source Linux.

Table of Contents

Task Dependencies (Pre-requisites)


Tools Required

  • Cross-compilation toolchain (installed with Xilinx SDK)
  • system.mhs (from the hardware project) *required for MicroBlaze only

Environment Variables Required

  • "CROSS_COMPILE" for gcc cross platform compile settings
  • "PATH" for the make procedure being able to find the cross platform compiler tools
  • The settings of these environment variables can be found in Install Xilinx tools page

Input Files Required

  • Linux kernel source directory

Output Files Produced

  • Linux kernel images

Task Description

All commands need to be executed in the Linux kernel source directory.

Generic instructions for building the kernel

First, configure the Linux kernel:
Optionally, additional kernel options may be configured:
Build the Linux kernel (requires that the environment is set up for cross compilation):
This will create the Linux images used for boot in linux-xlnx/arch/<architecture>/boot/, as well as linux-xlnx/vmlinux.

Linux for Zynq AP SoC

The kernel is configured based on linux-xlnx/arch/arm/configs/xilinx_zynq_defconfig:
To produce the kernel image:
In the process, linux-xlnx/arch/arm/boot/Image and linux-xlnx/arch/arm/boot/zImage are created. The Image file is the uncompressed kernel image and the zImage file is a compressed kernel image which will uncompress itself when it starts.
If the mkimage utility is available in the build environment, linux-xlnx/arch/arm/boot/uImage will be created by wrapping zImage with a U-Boot header.

Linux for Zynq UltraScale+ MPSoC

The kernel is configured based on linux-xlnx/arch/arm64/configs/xilinx_zynqmp_defconfig:
To produce the kernel image:
In the process, linux-xlnx/arch/arm64/boot/Image is created. The Image file is the uncompressed kernel image.

Linux for MicroBlaze

The kernel is configured based on linux-xlnx/arch/microblaze/configs/mmu_defconfig:
The kernel configuration needs to be modified to match the MicroBlaze settings as specified in <hardware project>/implementation/system.mhs:
The corresponding MicroBlaze entries in the system.mhs project file are:
<kernel load address> needs to be assigned to a valid address in memory as determined by the system.mhs project file. e.g.:
To produce the arch/microblaze/boot/linux.bin kernel image:
If the mkimage utility is available in the build environment, arch/microblaze/boot/linux.bin.ub will also be created. The *.ub suffix indicates that this file is linux.bin wrapped with the header required to boot Linux from U-Boot.

Linux for PowerPC

The kernel is configured based on linux-xlnx/arch/powerpc/44x/virtex5_defconfig:
To produce the kernel image:
If the mkimage utility is available in the build environment, linux-xlnx/arch/microblaze/boot/uImage which is a U-Boot header.

Build Steps