1.1 Preparing the Linux Kernel using PetaLinux 2018.1

Zynq UltraScale plus MPSoC Power Management

Release Date
2023-04-24

1.1.1 Download the PetaLinux petalinux-v2018.1-final-installer.run and ZCU102 BSP for corresponding board.

Petalinux user guide. /settings.sh (e.g. source /scratch/Xilinx/PetaLinux/settings.sh) Note: Or use source /settings.csh command for c shell. Cross check that the PETALINUX environment variable is set to the above installation path echo $PETALINUX 1.1.1.3.Create the PetaLinux project in a working directory with the below command (cd /scratch/edt) petalinux-create -t project –s (e.g. petalinux-create -t project –s /home/jerrywo/Downloads/xilinx-zcu102-v2018.1-final.bsp) Change the directory to the created Petalinux project. (e.g. cd /scratch/edt/xilinx-zcu102-2018.1) 1.1.1.4.Initially configure the PetaLinux project with the corresponding hardware file. (The file may be copied to /scratch/edt/xilinx-zcu102-2018.1 from your Windows machine C:\zynqus\pwr\sw\pl_lib_wrapper_hw_platform\system.hdf) petalinux-config --get-hw-description= (e.g. petalinux-config --get-hw-description=/scratch/edt/xilinx-zcu102-2018.1)

1.1.2 System Configuration

(Nothing is changed by step 1.1.2, this step may be skipped.) Change directory to /xilinx-zcu102-2018.1 and enter the following command to configure Linux: (cd /scratch/edt/xilinx-zcu102-2018.1) petalinux-config We configure the Memory Location and Serial Port. 1.1.2.1 ‘Subsystem AUTO Hardware Settings->Memory Settings->0x0 System memory base Address’ and 1.1.2.2.‘0x80000000 System memory size' 1.1.2.3 ‘Subsystem AUTO Hardware Settings->Serial Settings->Primary stdin/stdout (psu_uart_0)’

1.1.3 Kernel Configuration

Change directory to /xilinx-zcu102-2018.1 and enter the following command to configure the kernel: (cd /scratch/edt/xilinx-zcu102-2018.1) petalinux-config –c kernel 1.1.3.1 ‘Power Management Options > [*] User space wakeup sources interface' 1.1.3.2 ‘Firmware Drivers > Zynq MPSoC Firmware Drivers > [*] Enable Xilinx Zynq MPSoC firmware debug APIs'

1.1.4 Rootfs Configuration

(Nothing is changed by step 1.1.4, this step may be skipped.) Change directory to /xilinx-zcu102-2018.1 and enter the following command to configure the rootfs: (cd /scratch/edt/xilinx-zcu102-2018.1) petalinux-config –c rootfs

1.1.5 Device Tree

Change directory to /xilinx-zcu102-2018.1/project-spec/meta-user/recipes-bsp/device-tree/files and edit system-user.dtsi: (cd /scratch/edt/xilinx-zcu102-2018.1/project-spec/meta-user/recipes-bsp/device-tree/files) We modify the Device Tree to free up UART1 for RPU use (otherwise RPU can hang waiting for UART). 1.1.5.1 Append the following uart1 configuration: &uart1 { status = "disabled"; }; 1.1.6 Building the kernel and device tree blob Change directory to /xilinx-zcu102-2018.1 and enter the following command to build the image.ub and BOOT.BIN under the images/linux/ folder. These two files are the ones that will be copied to the BOOT partition of the SD card. (cd /scratch/edt/xilinx-zcu102-2018.1) petalinux-build (Note: Ignore the warning "PMU firmware is not built...") cd /xilinx-zcu102-2018.1/images/linux (cd /scratch/edt/xilinx-zcu102-2018.1/images/linux) petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot --force (Note: Ignore the warning "Unable to access the TFTPBOOT folder...")

1.2 Running the Linux Design from SD Image

The steps to run the Linux design from SD Image are as follows:
  • After Building the Linux Design in 1.1, Copy image.ub and BOOT.bin to a blank (FAT32 format) SD card.
  • Also copy the folder C:\zynqus\pwr\linux\apps to the SD card. It contains Linux demo files.
  • Insert the SD card into the SD Card slot on the ZCU102, set Mode SW6 to Off-Off-Off-On, and power cycle the ZCU102.