Note: enable xlnk module.
source /media/embedded/d/lsq/petalinux/settings.sh
petalinux-create --force --type project --template zynqMP --source /media/embedded/d/lsq/bsp/xilinx-zcu104-v2018.2-final.bsp --name proj1
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.
vim project-spec/meta-user/conf/petalinuxbsp.conf
Add the following line:
IMAGE_INSTALL_remove = "gstreamer-vcu-examples"
petalinux-build -c bootloader -x distclean
petalinux-config -c kernel
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)
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";
};
};
petalinux-build
petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --u-boot images/linux/u-boot.elf --fpga images/linux/system.bit
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