ZynqMP Petalinux Boot Generation
Note: enable xlnk module.
Prerequisite
source /media/embedded/d/lsq/petalinux/settings.sh
Create the Petalinux Project
petalinux-create --force --type project --template zynqMP --source /media/embedded/d/lsq/bsp/xilinx-zcu104-v2018.2-final.bsp --name proj1
Configure the Petalinux Project
cd proj1
petalinux-config --get-hw-description=path to your Vivado project sdk folder
This will bring up a configuration menu. Make the following changes.
* Under "Image Packaging Configuration" ->
"Root filesystem type" ->
Select "SD Card"
* Under "DTG Settings" ->
"Kernel Bootargs" ->
Un-select "generate boot args automatically" ->
Enter "user set kernel bootargs" -> Paste in the following line
earlycon clk_ignore_unused earlyprintk root=/dev/mmcblk0p2 rw rootwait cma=1024M
* Save and exit the configuration menu. Wait for configuration to complete.
Note: “cma=1024M” means that the size of Contiguous Memory Allocator(CMA) is set to 1024M.
Patch a Bug
vim project-spec/meta-user/conf/petalinuxbsp.conf
Add the following line:
IMAGE_INSTALL_remove = "gstreamer-vcu-examples"
Build the Bootloader
petalinux-build -c bootloader -x distclean
Configure the Kernel
petalinux-config -c kernel
Enable xlnk module
-
Enable staging drivers:
Device Drivers → Staging drivers (ON)
-
Enable APF management driver:
Device Drivers → Staging drivers → Xilinx APF Accelerator driver (ON)
-
Enable APF DMA driver:
Device Drivers → Staging drivers → Xilinx APF Accelerator driver → Xilinx APF DMA engines support (ON)
Turn off CPU Idle and Frequency Scaling
- CPU Power Management->CPU idle->CPU idle PM support (OFF)
- CPU Power Management->CPU Frequency scaling->CPU Frequency scaling (OFF)
Modify the Device Tree for APF Driver
gedit project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
Add the following entry at the bottom:
/{
xlnk {
compatible = "xlnx,xlnk-1.0";
};
};
Build the Project
petalinux-build
Create the Boot Files
petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --u-boot images/linux/u-boot.elf --fpga images/linux/system.bit
Copy to SD Card
cp images/linux/BOOT.BIN /path to you boot partitation/
cp images/linux/image.ub /path to you boot partitation/
Note: BOOT.BIN contains the ATF, PMUFW, FSBL, U-Boot.
image.ub contains the device tree and Linux kernel.
Reference:
https://www.xilinx.com/html_docs/xilinx2018_2/sdsoc_doc/linux-boot-files-bks1504034371884.html