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)
- Install Xilinx tools
- Fetch Sources
- Build Device Tree Compiler
- Build U-Boot
- Hardware Project (required for MicroBlaze only)
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:make ARCH=<architecture> <kernel config>
make ARCH=<architecture> (menu|x|n)config
make ARCH=<architecture> UIMAGE_LOADADDR=<kernel load address> <make targets>
Linux for Zynq AP SoC
The kernel is configured based on linux-xlnx/arch/arm/configs/xilinx_zynq_defconfig:make ARCH=arm xilinx_zynq_defconfig make ARCH=arm menuconfig
make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage
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:make ARCH=arm64 xilinx_zynqmp_defconfig make ARCH=arm64 menuconfig
make ARCH=arm64
Linux for MicroBlaze
The kernel is configured based on linux-xlnx/arch/microblaze/configs/mmu_defconfig:make ARCH=microblaze mmu_defconfig
make ARCH=microblaze menuconfig Platform options ---> (<kernel load address>) Physical address where Linux Kernel is (1) USE_MSR_INSTR range (0:1) (1) USE_PCMP_INSTR range (0:1) (<0|1>) USE_BARREL range (0:1) (<0|1>) USE_DIV range (0:1) (<0|1|2>) USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64) (<0|1|2>) USE_FPU values (0=NONE, 1=BASIC, 2=EXTENDED) Processor type and features ---> [*] MMU support [ ] Default bootloader kernel arguments
BEGIN microblaze ... PARAMETER C_USE_BARREL = <0|1> PARAMETER C_USE_FPU = <0|1|2> PARAMETER C_USE_HW_MUL = <0|1|2> PARAMETER C_USE_DIV = <0|1> ... END
BEGIN axi_s6_ddrx ... C_S0_AXI_BASEADDR = <base address of memory> C_S0_AXI_HIGHADDR = <high address of memory> ... END
make ARCH=microblaze UIMAGE_LOADADDR=<kernel load address> linux.bin
Linux for PowerPC
The kernel is configured based on linux-xlnx/arch/powerpc/44x/virtex5_defconfig:make ARCH=powerpc 44x/virtex5_defconfig
make ARCH=powerpc menuconfig
make ARCH=powerpc UIMAGE_LOADADDR=0x8000 uImage
Build Steps
- Fetch Sources
- Build FSBL
- Build Device Tree Compiler (DTC)
- Build PMU Firmware
- Build Arm Trusted Firmware (ATF)
- Build U-Boot
- Build and Modify a Root File System
- Build Device Tree Blob
- (You are here) Build Linux Kernel
- Prepare Boot Image
- Prepare Boot Medium
- Setup a Serial Console
- Additional Information: Build Qt and Qwt Libraries
Related Links
© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy