Zynq UltraScale+ MPSoC Power Advantage Tool Linux 2019.1

It is sometimes helpful to have an example of power management. The Power Advantage Tool Linux code has power management API's, as well as other demo configurations. This section describes how to build and run the Power Advantage Tool Linux code from sources.

This example highlights some PL Power Management methods.

Table of Contents

1 Linux Design

1.1 Building the Linux Design

The steps to rebuild the Linux design from sources are as follows:
  • You will need a CentOS (supported version) Linux computer
  • Install Vivado and SDK as described here.

1.1 Preparing the Linux Kernel using PetaLinux 2019.1

This section describes how to build the Linux images for zcu102 target platform using latest release PetaLinux SDK of version 2018.1.

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




1.1.1.1.Install PetaLinux by running the above downloaded installer
. /petalinux-v2019.1-installer.run
(e.g. Petalinux_installation_path = /scratch/Xilinx/PetaLinux)
Note: please refer the Petalinux user guide.

1.1.1.2.After installation is done set the PetaLinux environment by running below command in bash shell
(bash)
source <Petalinux_installation_path>/settings.sh
(e.g. source /scratch/Xilinx/PetaLinux/settings.sh)
Note: Or use source <Petalinux_installation_path>/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 <path to the downloaded zcu102 bsp>
(e.g. petalinux-create -t project –s /home/jerrywo/Downloads/xilinx-zcu102-v2019.1-final.bsp)
Change the directory to the created Petalinux project.
(e.g. cd /scratch/edt/xilinx-zcu102-2019.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-2019.1 from your Windows machine C:\zynqus\pwr\sw\pl_lib_wrapper_hw_platform\system.hdf)
petalinux-config --get-hw-description=<path to folder containing system.hdf file>
(e.g. petalinux-config --get-hw-description=/scratch/edt/xilinx-zcu102-2019.1)

When menu opens, enable FPGA Manager (leave hw path blank)

save and exit

1.1.2 System Configuration

(Nothing is changed by step 1.1.2, this step may be skipped.)
Change directory to <petalinux project>/xilinx-zcu102-2019.1 and enter the following command to configure Linux:
(cd /scratch/edt/xilinx-zcu102-2018.1)
petalinux-config

1.1.3 Kernel Configuration

(Nothing is changed by step 1.1.3, this step may be skipped.)
Change directory to <petalinux project>/xilinx-zcu102-2019.1 and enter the following command to configure the kernel:
(cd /scratch/edt/xilinx-zcu102-2019.1)
petalinux-config –c kernel

1.1.4 Rootfs Configuration

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

1.1.5 Device Tree

(Nothing is changed by step 1.1.5, this step may be skipped.)
Change directory to <petalinux project>/xilinx-zcu102-2019.1/project-spec/meta-user/recipes-bsp/device-tree/files and edit system-user.dtsi:
(cd /scratch/edt/xilinx-zcu102-2019.1/project-spec/meta-user/recipes-bsp/device-tree/files)

1.1.6 Building the apps, kernel and device tree blob

petalinux-create -t apps -n pl-power --enable
Replace project-spec/meta-user/recipes-apps/pl-power with <zip_dir>/software/recipes-apps/pl-power
Change directory to <petalinux project>/xilinx-zcu102-2019.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-2019.1)
(Note: The GPIOs get assigned dynamically, so you may need to edit pl-power.c)
petalinux-build -c pl-power
petalinux-build -c rootfs
petalinux-build
(Note: Ignore the warning "PMU firmware is not built...")

Now I have to automatically run the fpgautil to download the full bitstream

petalinux-create -t apps --name startup --enableReplace project-spec/meta-user/recipes-apps/startup
with <zip_dir>/software/recipes-apps/startup
petalinux-build
cd <petalinux project>/xilinx-zcu102-2019.1/images/linux
(cd /scratch/edt/xilinx-zcu102-2019.1/images/linux)
petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot --force
(Note: Ignore the warning "Unable to access the TFTPBOOT folder...")
cd <zip_dir>/hw/scripts
Edit copy_pr_bits_bins.sh to change the paths per your installation
source copy_pr_bits_bins.sh

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 C:\zynqus\pwr\sd\Terminals\*.bit.bin to the SD card. They contain the partial bitstreams (Vivado files).
  • Also copy C:\zynqus\pwr\sd\Terminals\pl-power-init.sh to the SD card.
  • 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.

Related Links

Home Previous Next