Zynq UltraScale+ PS-PCIe Linux Configuration

Zynq UltraScale+ PS-PCIe Linux Configuration

The page is deprecated and is only being retained as a reference. The ZCU112 board mentioned below is not publicly available.

Please refer to the following Answer Records for more info on using PS-PCIe: 

AR72076 : Example design with PL-PCIe Root Port in ZCU106 and PS-PCIe Endpoint in UltraZed

AR71493:  PetaLinux Image Generation and System Example Design with ZCU102 PS-PCIe as Root Complex and ZC706 as Endpoint

 

This page provides an overview of configuring a PCIe host (in this case, a ZCU102 using PS-PCIe in root port mode) for communicating with a Zynq UltraScale+MPSoC PS-PCIe controller configured as a PCIe endpoint.  In the example below, Linux is running on the ZCU102 host, and a pre-built bare-metal application is running on the endpoint. 

Table of Contents

Configure the ZCU102 PetaLinux Project


The following steps describe the process for configuring the kernel to include support for accessing the PS-PCIe Endpoint DMA controller: 

  1. Run settings.sh for PetaLinux Build Environment setup from the installed directory.bash>source <path-to-installed-PetaLinux>/settings.sh

  2. Create new project using sample PetaLinux Project from Latest BSPs for ZU+ MPSoC. bash>petalinux-create -t project -n ps_pcie_dma -s /proj/petalinux/petalinux-v2017.2_bsps_daily_latest/xilinx-zcu102-v2017.2-final.bsp
    This command creates a new PetaLinux project folder from a default template. PetaLinux project is created under folder name ps_pcie_dma.

  3. Change the directory into your newly created PetaLinux project.bash> cd ps_pcie_dma.
    Enter petalinux-config command and select Linux Components Selection.
    bash> petalinux-config
    This launches the top system configuration menu.


In Linux Components Selection select linux-kernel remote. In Remote linux kernel settings give linux kernel git path and commit id as master.

Please observe the following screenshots.






After Configuring Linux Kernel Components selection settings. Save the changes and exit from the menu.
5. Run PetaLinux kernel configuration command to select DMA Engine Support and Xilinx PS PCIe DMA. In Xilinx DMA Engine select test client Enable.
bash> petalinux-config -c kernel
This launches the Linux kernel configuration menu.
Select Device Drivers Component from the kernel configuration window. In Device Driver Component Select DMA Engine support.




In DMA Engine Support. Select Xilinx DMA Engines, and Select Xilinx PS PCIe DMA Support.


In Xilinx DMA Engines, Select Xilinx PS PCIe DMA test client.




After selecting the Xilinx DMA components save the configuration file and then exit from menu.
6. After Configuring the PetaLinux kernel, give PetaLinux build command to build the system image.
bash> petalinux-build
The Linux software images are generated in the images/linux subdirectory of your PetaLinux project.
7. Once PetaLinux build command executed successful. Generate Boot Image BOOT.BIN using PetaLinux package command.
bash> petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --fpga images/linux/download.bit --pmufw images/l inux/pmufw.elf --u-boot images/linux/u-boot.elf

Create the Endpoint DMA Test Application

In order to communicate with the endpoint, we need a host application that will use the PCIe EP driver to move date to/from the endpoint. 

  1. In PetaLinux project directory i.e. in ps_pcie_dma directory create application simple-test, to include this into part of PetaLinux is explained in following steps.
    bash> petalinux-create -t apps --template c --name simple-test –enable

  2. Download source files simple-test.c and header file common_include.h from attachments and copy it into the below path in PetaLinux project directory bash> cp simple-test.c project-spec/meta-user/recipes-apps/simple-test/files/ bash> cp common_include.h project-spec/meta-user/recipes-apps/simple-test/files/

  3. Open Makefile and add target clean to the Makefile showed in below path. Target clean is highlighted in red below. Press <TAB> key before clean command.
    bash> vi project-spec/meta-user/recipes-apps/simple-test/files/Makefile

APP = simple-test

# Add any other object files to this list below

APP_OBJS = simple-test.o

all: build

build: $(APP)

$(APP): $(APP_OBJS)

$(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS)

clean:
<Press TAB key> rm -f $(APP_OBJS) $(APP)

© 2025 Advanced Micro Devices, Inc. Privacy Policy