Kernel
From Sources
Get the sources .. code-block:
git clone https://github.com/Xilinx/linux-xlnx.git cd linux-xlnx git checkout xilinx-v2019.2.01
Set environment for Cross-Compilation: .. code-block:
export CROSS_COMPILE=arm-linux-gnueabihf- export ARCH=arm
Configuration .. code-block:
$make xilinx_zynq_defconfig
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
Download Petalinux sources from Xilinx official website
In Petalinux directory
To create the Project
$ petalinux-create --type project --template zynq --name spec7_kernel
Copy .xsa generated from Vivado in Project directory and then build
$ petalinux-config --get-hw-description
To config u-boot, and Linux
$ petalinux-config -c u-boot
$ petalinux-config -c kernel
Now to build everything
$ petalinux-build
All the generated output will be availabe in
images
folderTo create final BOOT.BIN, run this inside
$ petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --kernel