You should prepare the following components before creating the platform.
|Component||Conventional Path or Filename||Description|
|Boot components||boot/bl31.elfboot/u-boot.elfboot/system.dtb||All components referred in linux.bif should be in this folder|
|Boot components in FAT32 partition of SD Card||sd_dir/boot.scr||U-boot configuration file to store in FAT32 partition of SD card|
|Linux Software Components||sw_comp/Imagesw_comp/rootfs.ext4sw_comp/sysroots||Linux components for application creation and Linux booting. They can be packaged into platform or stay standalone and be linked during application creation process.|
This tutorial uses the Linux software components provided by the Common Images. You can store all the necessary files for Vitis platform creation flow in the
Download and extract the Common Images for AMD Versal™ devices.
Visit the Vitis Embedded Platforms download page.
Download the Versal common image to
step2_sw/build/commonfrom the 2023.2 page.
Extract the downloaded package using the
cd step2_sw/build/common; tar -xzf xilinx-versal-common-v2023.2.tar.gzcommand.
Prepare the boot components.
From the table above, you know that the boot components include the following items:
Follow these steps to copy them to boot directory.
Create directory for boot components
Copy boot components from common image directory.
cp step2_sw/build/common/bl31.elf step2_sw/build/boot cp step2_sw/build/common/u-boot.elf step2_sw/build/boot
Copy device tree.
cp step2_sw/build/vck190_custom_dt/psv_cortexa72_0/device_tree_domain/bsp/system.dtb step2_sw/build/boot
sd_dirdirectory. Contents in this directory will be packaged to FAT32 partition of SD card image by v++ package tool.
boot.scrfrom the common image directory
step2_sw/build/sd_dirdirectory. It is a script for U-Boot initialization. U-boot will read it from FAT32 partition during boot process.
Prepare Linux software components for application creation. Platform packaging can add them or exclude them. Due to the software component size, they are usually kept outside of platforms so that these components can be reused among multiple platforms with the same architecture. On the other side, keeping Linux software components in the platform can prevent mix and match different combinations when delivering the platform from one team to another. Here we keep the Linux software components standalone.
# Create sw_comp directory mkdir step2_sw/build/sw_comp cd sw_comp # Copy Linux kernel image cp <COMMON_IMAGE_PATH>/Image . # Copy EXT4 Root Filesystem cp <COMMON_IMAGE_PATH>/rootfs.ext4 . # Install sysroot to this directory <COMMON_IMAGE_PATH>/sdk.sh -d ./ -y
Finally, your prepared directory structure looks like this.
tree -L 3 --charset ascii . |-- boot | |-- bl31.elf | |-- system.dtb | `-- u-boot.elf |-- sd_dir | `-- boot.scr |-- sw_comp | |-- environment-setup-cortexa72-cortexa53-xilinx-linux | |-- Image | |-- rootfs.ext4 | |-- site-config-cortexa72-cortexa53-xilinx-linux | |-- sysroots | | |-- cortexa72-cortexa53-xilinx-linux | | `-- x86_64-petalinux-linux | `-- version-cortexa72-cortexa53-xilinx-linux
Note: If you run the fast track script, the boot directory only has
linux.biffile because the platform creation script
<petalinux_project>/images/linuxdirectory as boot directory for components of the BIF file. To make the GUI flow easier, copy these components to the boot directory for preparation.