Kernel

From Sources

  1. Get the sources .. code-block:

    git clone https://github.com/Xilinx/linux-xlnx.git
    cd linux-xlnx
    git checkout xilinx-v2019.2.01
    
  2. Set environment for Cross-Compilation: .. code-block:

    export CROSS_COMPILE=arm-linux-gnueabihf-
    export ARCH=arm
    
  3. Configuration .. code-block:

    $make xilinx_zynq_defconfig
    
  4. Build .. code-block:

    $ make -j<cores>
    $ mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d linux-xlnx/arch/arm/boot/zImage uImage
    

From script

Above steps are automated using Makefile and can be found in spec7 ohwr repo <>

 output=../../output

 export CROSS_COMPILE=arm-linux-gnueabihf-
 export ARCH=arm

 defconfig=xilinx_zynq_defconfig

 kernel := linux-xlnx

 defconfig:
      @$(MAKE) -C $(kernel) $(defconfig)
      @$(MAKE) -C $(kernel)
      mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d linux-xlnx/arch/arm/boot/zImage uImage
      cp uImage $(output)

menuconfig:
      @$(MAKE) -C $(kernel) menuconfig

clean:
      @$(MAKE) -C $(kernel) clean

This will generate Kernel uImage in output directory, which can be stored in flash or loaded over TFTP

Petalinux Flow

  1. Download Petalinux sources from Xilinx official website

  2. In Petalinux directory

  1. To create the Project

$ petalinux-create --type project --template zynq --name spec7_kernel
  1. Copy .xsa generated from Vivado in Project directory and then build

$ petalinux-config --get-hw-description
  1. To config u-boot, and Linux

$ petalinux-config -c u-boot
$ petalinux-config -c kernel
  1. Now to build everything

$ petalinux-build
  1. All the generated output will be availabe in images folder

  2. To create final BOOT.BIN, run this inside

$ petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel