Quantcast
Channel: Xilinx Wiki : Xilinx Wiki - all changes
Viewing all 11776 articles
Browse latest View live

PetaLinux Yocto Tips

$
0
0
...
Hello World (from a shared library!)
Patching the Linux Kernel of a PetaLinux Project
...
project file project-spec/meta-user/recipes-kernel/linux/linux-xlnx<plnx-proj-root>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx directory.
2.
...
project file project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend<plnx-proj-root>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend to use
...
line with SRC_URI_append += "file://<patch file name>".
SRC_URI_append = " file://0001-linux-driver-fix.patch"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

3. Make
...
project file project-spec/meta-user/conf/layer.conf<plnx-proj-root>/project-spec/meta-user/conf/layer.conf .
How to modify inittab or getty in v2016.4 PetaLinux Project
1. Create a sysvinit directory in meta-user layer as

space.template.test3

$
0
0
{under.jpg}
1 Revision History
This wiki page complements the 2016.4 version of the Base TRD. For other versions, refer to the Zynq UltraScale+ MPSoC Base TRD overview page.
Change Log:
Update all projects, IP and tools versions to 2016.3, except Petalinux
Add support for ZCU102 rev 1.0 board with ES2 silicon
Split reference design into 9 design modules with dedicated tutorials
Remove support for HDMI input via FMC-HDMI-CAM
Add USB webcam support for video capture (USB2 only!)
Add virtual video device (vivid) support for video capture
Use X11 Qt and Mali backend instead of fbdev
2 Overview
The Zynq UltraScale+ MPSoC Base Targeted Reference Design (TRD) is an embedded video processing application running on a combination of APU (SMP Linux), RPU (bare-metal) and PL.
The design consists of the following video data paths:
Video capture pipelines capturing video from:
a virtual video device (vivid) implemented purely in software
a USB webcam connected to the PS (optional)
a test pattern generator (TPG) implemented inside the PL
A memory-to-memory processing pipeline implementing a 2D-convolution filter with programmable coefficients.
A display pipeline with two layers, one used for video and the other for a graphical user interface (GUI) rendered by the GPU.
The TRD demonstrates the value of offloading computation intensive tasks like the 2D-convolution filter from the PS onto PL, thereby freeing APU resources. The APU load is plotted on the GUI to compare a pure software vs hardware accelerated implementation. The RPU is used to monitor the live memory throughput of the design by reading the built-in AXI performance monitors (APM) inside the PS. The data is sent to the APU via the OpenAMP communication framework and plotted on the GUI.
This wiki contains information about:
How to setup the ZCU102 evaluation board and run the reference design.
How to build all the TRD components based on the provided source files via detailed step-by-step tutorials.
Additional material that is not hosted on the wiki:
User Guide containing information about system, software and hardware architecture.
Reference Design Zip File for ZCU102 rev 1.0 / ES2 silicon including all source code and project files.
Reference Design Zip File for ZCU102 rev D / ES1 silicon including all source code and project files.
Third Party Library Sources for separately licensed material that is not included in the reference design.
Note: Certain material in this reference design is separately licensed by third parties and may be subject to the GNU General Public License version 2, the GNU Lesser General License version 2.1, or other licenses.
3 Software Tools and System Requirements
3.1 Hardware
Required:
ZCU102 evaluation board / power cable
Monitor with DisplayPort input supporting one of the following resolutions:
3840x2160 or
1920x1080 or
1280x720
Display Port cable (DP certified)
USB hub with mouse and keyboard
SD card
Optional:
USB webcam
3.2 Software Tools
Required:
Linux host machine for all tool flow tutorials (see here for detailed OS requirements)
SDSoC Development Environment version 2016.4
Xilinx Software Development Kit (XSDK) version 2016.4
PetaLinux Tools version 2016.3
Git distributed version control system
GNU make utility version 3.81 or higher
Optional:
Silicon Labs quad CP210x USB-to-UART bridge driver
Serial terminal emulator e.g. teraterm
3.3 Licensing
The video Test Pattern Generator IP inside the Vivado project requires a license which can be obtained from here.
Steps to generate the license:
Click on the link mentioned above.
Fill in the login details and proceed.
Click on “Generate Node-Locked License" icon as shown in the picture:
{TPG_lic.jpg}
Under system information, give the host details.
Proceed until you get the license agreement and accept it.
The License (.lic file) will be sent to the email-id mentioned in the login details.
Copy the license file locally and give the same path in the SDSOC license manager.
3.4 Compatibility
The reference design has been tested successfully with the following user-supplied components.
DisplayPort Monitor:
Make/Model
Native Resolution
Viewsonic VP2780-4K
3840x2160 (30Hz)
LG 27MU67-B
3840x2160 (30Hz)
Acer S277HK
3840x2160 (30Hz)
Dell U2414H
1920x1080 (60Hz)
GeChic On-Lap1303H
1920x1080 (60Hz)
DisplayPort Cable:
Cable Matters DisplayPort Cable-E342987
Monster Advanced DisplayPort Cable-E194698
USB Webcam:
Make/Model
Supported Resolutions
Supported Formats
Logitech HD Pro Webcam C920
1920x1080 (5fps), 1280x720 (10fps)
YUYV
Logitech HD Webcam C525
1920x1080 (5fps), 1280x720 (10fps)
YUYV
4 Design Files
The top-level directory structure is shown in the figure below.
{base-trd-2016-3-dir-structure.png}
4.1 Design Modules
The reference design is split into 9 design modules DM1 to DM9:
DM1 – APU SMP Linux
DM2 – RPU0 FreeRTOS Application
DM3 – RPU1 Bare-metal Application
DM4 – APU/RPU1 Inter Process Communication
DM5 – APU Qt Application
DM6 – PL Video Capture
DM7 – OpenCV-based Image Processing
DM8 – PL-accelerated Image Processing
DM9 – Full-fledged Base TRD
Each module is described in more detail in UG1221 and on the respective tutorial page.
The following table shows the dependency matrix between different modules. For example: DM6 (row) depends on or builds on top of modules DM1 and DM5 (columns).
DM1
DM2
DM3
DM4
DM5
DM6
DM7
DM8
DM1
DM2
DM3
DM4
+
+
DM5
+
DM6
+
+
DM7
+
+
+
DM8
+
+
+
+
DM9
+
+
+
+
+
+
+
+
4.2 Design Components
The below figure shows the relevant design components for DM9 as well as inter-dependencies and generated output products.
{base-trd-2016-3-dm9-dc-dependencies.png}
The below table shows which design components are used in which design modules. A graphical view for each design module is provided on the respective design module tutorial page.
Design Component
Design Module
DM1
DM2
DM3
DM4
DM5
DM6
DM7
DM8
DM9
apu/perfapm-client/perfapm-client
Y
Y
apu/perfapm-client/perfapm-client-test
Y
apu/petalinux_bsp
Y
Y
Y
Y
Y
Y
Y
apu/videao_app/video_lib
Y
Y
Y
Y
Y
apu/videao_app/video_qt2
Y
Y
Y
Y
Y
apu/zcu102_base_trd/samples/filter2d
Y
Y
Y
pl/zcu102_base_trd
Y
pl/zcu102_dp_only
Y
pmu/pmu_fw
Y
Y
Y
Y
Y
Y
Y
Y
Y
rpu0/heartbeat
Y
Y
rpu1/perfapm-server/perfapm
Y
Y
Y
rpu1/perfapm-server/perfapm-ctl
Y
rpu1/perfapm-server/perfapm-server
Y
Y
5 Tutorials
5.1 Board Setupboard_setup
Required:
Connect power supply to J52.
Connect USB mouse and keyboard using a USB hub to J83.
Connect DisplayPort cable to P11; connect other end to monitor.
Insert SD card (FAT formatted) with binaries copied from $TRD_HOME/images/dm9 directory.
Connect micro-USB cable to J83 USB UART connector; use the following settings for your terminal emulator:
Baud Rate: 115200
Data: 8 bit
Parity: None
Stop: 1 bit
Flow Control: None
Optional:
Connect USB webcam to a USB hub to J83.
Jumpers & Switches:
Set boot mode according to your board and silicon revision
For rev D with ES1 silicon: SW6[4:1] - on,off,on,off
For rev 1.0 with ES2 silicon: SW6[4:1] - on,off,off,off
Configure USB 2.0 jumpers for host mode
J110: 2-3
J109: 1-2
J112: 2-3
J7: 1-2
J113: 1-2
{base-trd-2016-3-board-setup.png}
To run the prebuilt SD card image for design module 9, follow the instructions here .
5.2 Build and Run Flow
The following tutorials assume that the $TRD_HOME environment variable has been set as below.
For rev 1.0 / ES2:
% export TRD_HOME=</path/to/downloaded/zip-file>/rdf0421-zcu102-base-trd-2016-4
For rev D / ES1:
% export TRD_HOME=</path/to/downloaded/zip-file>/zcu102-base-trd-2016-4
For some modules, the $PETALINUX environment variables needs to be set as well. This is done automatically when you source the PetaLinux settings.sh script (see PetaLinux installation guide).
For the individual tutorials, follow the links below:
DM1 Tutorial – APU SMP Linux
DM2 Tutorial – RPU0 FreeRTOS Application
DM3 Tutorial – RPU1 Bare-metal Application
DM4 Tutorial – APU/RPU1 Inter Process Communication
DM5 Tutorial – APU Qt Application
DM6 Tutorial – PL Video Capture
DM7 Tutorial – OpenCV-based Image Processing
DM8 Tutorial – PL-accelerated Image Processing
DM9 Tutorial – Full-fledged Base TRD
6 Other Information
6.1 Known Issues
The board doesn't boot and the INIT_B LED stays red.
Frequency: Rare
Workaround: Power cycle the board
SDSoC accelerator code runs very slow in pure software implementation when Debug configuration is used
Frequency: Always
Workaround: Set project build configurations to Release which sets sdsoc compiler to optimize most (-O3)
Linux 'reboot' command not working
Frequency: Always
Workaround: Power cycle the board
At 1080p and 720p resolutions, the mouse cursor disappears when moved too far to the right and/or bottom of the screen
Frequency: Always
Workaround: Move mouse toward left and/or top until the cursor reappers on the screen
PetaLinux prints the following warning message: WARNING: Failed to pack PMUFW, pre-built PMUFW doesnt exist. See help to load custom pmufw
Frequency: Always
Workaround: Message can be ignored
Video capture cannot be started in GUI for native display of 1280x720 or 1920x1080 in auto-detection mode
Frequency: Always
Workaround: Edit the file autostart.sh and modify the arguments for the desired target resolution, e.g. for 1920x1080 change line
video_qt2_wrap.sh &
to
video_qt2_wrap.sh -r 1920x1080 &
or close the application and restart with command
run_video.sh -r 1920x1080
6.2 Limitations
The application only supports the following display resolutions: 3840x2160p30, 1920x1080p60, and 1280x720p60.
The application does not support audio.
Only USB2.0 webcams are supported at this point.
Make sure the DisplayPort cable is plugged in when you power on the board, otherwise the framebuffer console will default to 1024x768 resolution and the application will not start.
DP-to-HDMI adapters are not supported, see AR 67462
7 Support
To obtain technical support for this reference design, go to the:
Xilinx Answers Database to locate answers to known issues
Xilinx Community Forums to ask questions or discuss technical details and issues. Please make sure to browse the existing topics first before filing a new topic. If you do file a new topic, make sure it is filed in the sub-forum that best describes your issue or question e.g. Embedded Linux for any Linux related questions. Please include "ZCU102 Base TRD" and the release version in the topic name along with a brief summary of the issue.

space.template.TRD Template

$
0
0
...
Sub-Heading 1
Sub-Heading 2
Hi there
Insert Code: Use Widget-> Insert Code
Insert your code here.

reVISION Getting Started Guide

$
0
0

zynq xyz

$
0
0
This how-to describes the construction of the Ilidium Q38 Explosive Space Demodulator which is required to annihilate the moon.
Task Dependencies (Pre-requisites)
Hardware design completed in XPS
Design-specific Device tree file generated by SDK
Tools Required
Xilinx SDK
Input Files Required
Xarguments.h
Output Files Produced
Boot.bin
Task Description
Step 1:
Step 2:
Step 3:
Step 4:
Related Links
Title 1 & Link 1
Title 1 & Link 1

zynq xyz

$
0
0
...
Task Description
Step 1:
find moon
Step 2:
Step 3:

zynq xyz

$
0
0
...
find moon
Step 2:
blow it up
Step 3:
Step 4:

zynq xyz

$
0
0
...
blow it up
Step 3:
watch the tides
Step 4:
Related Links

my trd

$
0
0
Important! Tag the page with: trd
Important! Include a link to this page from: http://www.wiki.xilinx.com/Targeted+Reference+Designs
All External Links should open in a new tab/window; all Internal Links to Xilinx wiki pages, should open in the same tab/window.
my trd intro inf
Section 1
Sub-Heading 1
Sub-Heading 2
Hi there
Insert Code: Use Widget-> Insert Code
Insert your code here.
Related Links
Title 1 & Link 1
Title 1 & Link 1

my trd

$
0
0
...
my trd intro inf
Section 1
i am here
Sub-Heading 1
Sub-Heading 2

Zynq UltraScale MPSoC Base TRD 2017.1

$
0
0
...
adapter shipped with ZCU102 rev 1.0 + production silicon
adapter needs to be purchased separately for ZCU102 rev 1.0 + ES2 silicon
3.2 Software
Required:
Linux host machine for all tool flow tutorials (see UG1144 for detailed OS requirements)
SDSoC Development Environment version 2017.1 (see UG1238 for installation instructions) TODO: update link
PetaLinux Tools version 2017.1 (see UG1144 for installation instructions)
Git distributed version control system
Silicon Labs quad CP210x USB-to-UART bridge driver
Serial terminal emulator e.g. teraterm
Reference Design Zip File
ZCU102 rev 1.0 / ES2 silicon including all source code and project files. TODO: update link
ZCU102 rev 1.0 / production silicon including all source code and project files. TODO: update link
3.3 Licensing
Important: Certain material in this reference design is separately licensed by third parties and may be subject to the GNU General Public License version 2, the GNU Lesser General License version 2.1, or other licenses.
The Third Party Library Sources zip file provides a copy of separately licensed material that is not included in the reference design. TODO: update link
You will need only the SDSoC license to build the design which includes all the required IP licenses. You can evaluate for 60-days or purchase it here.
Steps to generate the license:
Log in here with your work E-mail address (If you do not yet have an account, follow the steps under Create Account)
Generate a license from “Create New Licenses” by checking "SDSoC Environment, 60 Day Evaluation License"
{license.png}
Under system information, give the host details.
Proceed until you get the license agreement and accept it.
The License (.lic file) will be sent to the email-id mentioned in the login details.
Copy the license file locally and give the same path in the SDSoC license manager.
3.4
Compatibility
The reference design has been tested successfully with the following user-supplied components.
DisplayPort Monitor:
...
Crucial BX200 2.5in SATA SSD 240GB
San Disk UltraFit USB3.0 Flash Drive 16 GB
3.3 Software
Required:
Linux host machine for all tool flow tutorials (see UG1144 for detailed OS requirements)
SDSoC Development Environment version 2017.1 (see UG1238 for installation instructions) TODO: update link
PetaLinux Tools version 2017.1 (see UG1144 for installation instructions)
Git distributed version control system
Silicon Labs quad CP210x USB-to-UART bridge driver
Serial terminal emulator e.g. teraterm
Reference Design Zip File
ZCU102 rev 1.0 / ES2 silicon including all source code and project files. TODO: update link
ZCU102 rev 1.0 / production silicon including all source code and project files. TODO: update link
3.4 Licensing
Important: Certain material in this reference design is separately licensed by third parties and may be subject to the GNU General Public License version 2, the GNU Lesser General License version 2.1, or other licenses.
The Third Party Library Sources zip file provides a copy of separately licensed material that is not included in the reference design. TODO: update link
You will need only the SDSoC license to build the design which includes all the required IP licenses. You can evaluate for 60-days or purchase it here.
Steps to generate the license:
Log in here with your work E-mail address (If you do not yet have an account, follow the steps under Create Account)
Generate a license from “Create New Licenses” by checking "SDSoC Environment, 60 Day Evaluation License"
{license.png}
Under system information, give the host details.
Proceed until you get the license agreement and accept it.
The License (.lic file) will be sent to the email-id mentioned in the login details.
Copy the license file locally and give the same path in the SDSoC license manager.

4 Design Files
4.1 Design Modules

PMU Firmware

$
0
0
...
{http://confluence.xilinx.com/download/attachments/55119784/snap-17.PNG?version=1&modificationDate=1493724095503&api=v2}
Place the break points to control the flow and rerun for debugging.
Loading PMU Firmware in JTAG boot mode
From 2017.1, PM operations depend on the configuration object loaded by FSBL. So it is mandatory to load PMU FW before loading FSBL. This is taken care in device boot modes, but in JTAG boot mode, user need to specifically ensure this.
Following are the steps for JTAG boot mode:
For Silicon v3.0 and above, PMU Microblaze is not visible in xsdb. Hence disable security gates to view PMU Microblaze
Load PMU FW and run
Load FSBL and run
Continue with U-Boot/Linux/user specific application
Following is the complete TCL script:
#Disable Security gates to view PMU MB target
targets -set -filter {name =~ "PSU"}
mwr 0xffca0038 0x1ff
after 500
#Load and run PMU FW
targets -set -filter {name =~ "MicroBlaze PMU"}
dow xpfw.elf
con
after 500
#Reset A53, load and run FSBL
targets -set -filter {name =~ "Cortex-A53 #0"}
rst -processor
dow fsbl_a53.elf
con
#Give FSBL time to run
after 5000
stop
#Other SW...
dow u-boot.elf
dow bl31.elf
con

Loading PMU Firmware in SD boot mode
Note: When PMUFW is loaded in a non-JTAG Boot mode on a 1.0 Silicon, an error message "Error: Unhandled IPI received" may be logged by PMUFW at startup, which can be safely ignored. This is due to the IPI0 ISR not being cleared by PMU ROM which is fixed in 2.0 and later versions of Silicon.

Baremetal Drivers and Libraries

$
0
0

home

$
0
0
...
Targeted Reference Designs (TRD)
Other MicroBlaze Resources
fff
Join the Community: Access our Git servers & Submit Patches
We encourage our customers to share their code; see Create and Submit a Patch to contibute your code. We are working on sending all of the code we develop upstream.You can access the code we develop by visiting our Git server:https://github.com/xilinx which is managed by Git (http://git-scm.com/).

Macb Driver

$
0
0
...
Users can send hundred or more packets per second using -f option. It prints a ‘.’ when a packet is sent, and a backspace is printed when a packet is received
ping -f localhost
PTP
1588 synchronization can be tested on ZynqMP using open source linuxptp application.
http://linuxptp.sourceforge.net/
The setup requires a master with precise clock and timstamping capabilities, typically a NIC or another 1588 capable device.
How to run
master:
#ptp4l -i <interface name> -m
slave:
#ptp4l -i <interface name> -s -m

Change log
2016.3

Zynq UltraScale+ MPSoC Ubuntu part 2 - Building and Running the Ubuntu Desktop From Sources

$
0
0

Note:This page is under construction , changes are expected !!!!

Zynq UltraScale+ MPSoC Ubuntu part 2 - Building and Running the Ubuntu Desktop From Sources
1. Document History

ZU+ Example - Deep Sleep

$
0
0
...
Note: Peripherals which are enabled but not assigned to specific masters, by default all master will be given permission for those slaves.
When above configurations are done, click on "OK" button to save them. Run Block Automation when designer assistant is available.
Refer Isolation Configuration Consideration for more information on isolation configuration.
Generate Hardware Description File(HDF)
Generate HDL wrapper

ZU+ Example - Deep Sleep with PS SysMon in Sleep Mode

$
0
0
...
/* Wake up SysOsc */
val = Xil_In32(0xFFA50908);
val &= 0xFF00;0xFF0F;
Xil_Out32(0xFFA50908, val);
}

PetaLinux Yocto Tips

$
0
0
...
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
XSCT_BUILD_DEBUG = "1"
YAML_COMPILER_FLAGS_append = " -DXPS_BOARD_ZCU102" // Enable#Enable appropriate FSBL debug flags
YAML_COMPILER_FLAGS_append = " -DXPS_BOARD_ZCU102"

EXTERNALXSCTSRC = ""
EXTERNALXSCTSRC_BUILD = ""
...
"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
YAML_COMPILER_FLAGS_append = " -DENABLE_EM" // Enable#Enable appropriate PMUFW debug flags
YAML_COMPILER_FLAGS_append = " -DENABLE_EM"

EXTERNALXSCTSRC = ""
EXTERNALXSCTSRC_BUILD = ""

OpenAMP 2017.2 (Under Construction)

$
0
0
Below are information to complement and clarify UG1186 "Getting Started Guide" for Zynq UltraScale+ MPSoC.
Quick try!
Here are the basic steps to boot Linux and run an openamp application using pre-built images.
e.g for ZCU102:
The echo-test application sends packets from Linux running on quad-core Cortex-A53 to a single cortex-R5 running FreeRTOS which send them back.
Extract files BOOT.BIN, image.ub and openamp.dtb files from a pre-built Petalinux BSP tarball to sdcard
host shell$ tar xvf xilinx-zcu102-v2017.2-final.bsp --strip-components=4 --wildcards */BOOT.BIN */image.ub */openamp.dtb
host shell$ cp BOOT.BIN image.ub openamp.dtb <your sd card>
Note: Alternatively, if you already created a Petalinux project with a provided BSP for your board, pre-built images can also be found under the <your project>/pre-built/linux/images/ directory.
Go to u-boot prompt and boot Linux from sdcard
...
Hit any key to stop autoboot: 0
ZynqMP> mmcinfo && fatload mmc 0 ${netstart} ${kernel_img} && fatload mmc 0 0x14000000 openamp.dtb
Device: sdhci@ff170000
...
reading image.ub
31514140 bytes read in 2063 ms (14.6 MiB/s)
reading openamp.dtb
38320 bytes read in 18 ms (2 MiB/s)
ZynqMP> bootm $netstart $netstart 0x14000000
...
Note: As an alternative to all steps above to sd-boot, you can jtag-boot the board. For this you need to have connected a jtag cable, installed jtag drivers and created a Petalinux project using a provided BSP. You would then go into the <your project>/pre-built/linux/images directory and replace file system.dtb by openamp.dtb, then enter: "petalinux-boot --jtag --prebuilt 3"
At Linux login prompt enter 'root' for user and 'root' for password and run echo-test demo
plnx_aarch64 login: root
Password:
root@plnx_aarch64:~# echo image_echo_test > /sys/class/remoteproc/remoteproc0/firmware
root@plnx_aarch64:~# echo start > /sys/class/remoteproc/remoteproc0/state
[ 177.375451] remoteproc remoteproc0: powering up ff9a0100.zynqmp_r5_rproc
[ 177.384705] remoteproc remoteproc0: Booting fw image image_echo_test, size 644144
[ 177.396832] remoteproc remoteproc0: registered virtio0 (type 7)
[ 177.399108] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 177.412370] zynqmp_r5_remoteproc ff9a0100.zynqmp_r5_rproc: RPU boot from TCM.
[ 17Starting application...
Try to init remoteproc resource
Init remoteproc resource succeeded
Waiting for events...
7.422089] remoteproc remoteproc0: remote processor ff9a0100.zynqmp_r5_rproc is now up
[ 177.442121] virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x1
root@plnx_aarch64:~# modprobe rpmsg_user_dev_driver
[ 188.089835] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: rpmsg_user_dev_rpmsg_drv_probe
[ 188.101250] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: new channel: 0x400 -> 0x1!
root@plnx_aarch64:~# echo_test
Echo test start
Open rpmsg dev!
[ 190.364739] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: Sent init_msg to target 0x1.
****************************************
Please enter command and press enter key
****************************************
1 - Send data to remote core, retrieve the echo and validate its integrity ..
2 - Quit this application ..
CMD>
Docs and source code:
Documents:
The following document describes libmetal APIs:
{libmetal-doc-20170418.pdf}
URLs to source code:
Xilinx Openamp related code:
The following location provide access to the code:
https://github.com/Xilinx/open-amp/tree/xilinx-v2017.2
https://github.com/Xilinx/libmetal/tree/xilinx-v2017.2
https://github.com/Xilinx/meta-openamp/tree/rel-v2017.2
https://github.com/Xilinx/linux-xlnx/tree/xilinx-v2017.2
Xilinx SDK template (which uses https://github.com/Xilinx/embeddedsw/tree/xilinx-v2017.2)
e.g for main components:
Demo Applications:
https://github.com/Xilinx/meta-openamp/tree/rel-v2017.2/recipes-openamp/rpmsg-examples
https://github.com/Xilinx/open-amp/tree/xilinx-v2017.2/apps
https://github.com/Xilinx/libmetal/tree/xilinx-v2017.2/examples/system
Xilinx SDK template for RPU firmware (echo test, matrix multiplication and rpc demo)
Libraries:
https://github.com/Xilinx/open-amp/tree/xilinx-v2017.2/lib
https://github.com/Xilinx/libmetal/tree/xilinx-v2017.2/lib
LKMs
https://github.com/Xilinx/meta-openamp/tree/rel-v2017.2/recipes-kernel/rpmsg-user-module/files
https://github.com/Xilinx/meta-openamp/tree/rel-v2017.2/recipes-kernel/rpmsg-proxy-module/files
https://github.com/Xilinx/linux-xlnx/tree/xilinx-v2017.2/drivers/rpmsg
https://github.com/Xilinx/linux-xlnx/tree/xilinx-v2017.2/drivers/remoteproc
OpenAMP framework OSS:
https://github.com/OpenAMP
FAQ:
Is there a way to reduce Petalinux build time with OpenAMP?
To reduce extra (re)-compilation time for the remote processor firmware built with Petalinux and to preserve the source code in the temporary build directory:
Edit your <petalinux-project>/project-spec/meta-user/conf/petalinuxbsp.conf file and add:
RM_WORK_EXCLUDE += "openamp-fw-echo-testd openamp-fw-mat-muld openamp-fw-rpc-demo"
Remote firmware failed to boot and now I see an error saying "failed to declare rproc mem as DMA mem", why?
This happens after an invalid image is provided to remoteproc and this one exited before freeing all allocated memory, preventing further allocation on next run.
In this situation, in order to load a new openamp image you need to reboot Linux.
The patch below will take care of fixing remoteproc so that you are not forced to reboot Linux.
{0001-remoteproc-resource_cleanup-releases-DMA-declared-me.patch}
Note this however doesn't fix the root cause of the issue, which is probably the footprint of the elf image provided to remotproc doesn't match the allocated memory in the DTS.
Additional examples:
ZynqMP Linux Master running on APU with RPMsg in kernel space and 2 RPU slaves.
Enabling Linux Drivers and other packages
Proceed as indicated in UG1186 to enable Linux remoteproc driver support and other openamp packages.
Device tree:
Add content of file openamp-overlay-split.dtsi to file:
<petalinux project>/project-spec/meta-user/recipes-bsp/device-tree/file/system-user.dtsi
rebuild the device tree
petalinux-build -c device-tree
Building remote processor demo applications to run on RPU 0 (cortex_r5_0) with Xilinx SDK
Proceed as documented in UG1186 to generate remote processor openamp applications with Xilinx SDK.
RPU 0 is also used by default for the pre-built applications provided with Petalinux BSPs.
Building remote processor demo applications to run on RPU 1 (cortex_r5_1) with Xilinx SDK
Remote processor applications (echo_test, matrix multiply, rpc demo) code is by default set to run with RPU 0 and need to be slightly modified for RPU-1.
When RPU-1 is selected in Xilinx SDK, the code generated need to be modified as follow:
Edit platform_info.h and replace IPI_IRQ_VECT_ID value 65 by 66
Edit platform_info.c and replace IPI_BASE_ADDR value 0xFF310000 by 0xFF320000
Check that the application linker script (lscript.ld) addresses match and fit the DTS zynqmp_r5_rproc memory sections.
Check that the appplication rsc_table.c address for RSC_RPROC_MEM carveout is not overlapping the linker script addresses.
Example: Running two echo_test application concurrently on Linux, each communicating to one RPU
Use Petalinux to build/boot your target and then login to Linux console serial port.
If you haven't added the remote processor firmware applications to your Linux root filesystem (see UG1186 ch. 3) you can tftp them in the target directory /lib/firmware
Check remoteproc driver is already loaded (normally it is if your device tree is properly configured):
root@plnx_aarch64:/lib/firmware# lsmod
Tainted: G
virtio_rpmsg_bus 20480 0 - Live 0xffffff800098e000
rpmsg_core 16384 1 virtio_rpmsg_bus, Live 0xffffff800097c000
zynqmp_r5_remoteproc 16384 0 - Live 0xffffff800096a000
remoteproc 40960 1 zynqmp_r5_remoteproc, Live 0xffffff8000959000
virtio 16384 2 virtio_rpmsg_bus,remoteproc, Live 0xffffff8000951000
virtio_ring 20480 2 virtio_rpmsg_bus,remoteproc, Live 0xffffff8000948000
uio_pdrv_genirq 16384 0 - Live 0xffffff8000940000
Load rpmsg_user_dev_driver LKM:
root@plnx_aarch64:/lib/firmware# modprobe rpmsg_user_dev_driver
Start RPU-0:
root@plnx_aarch64:/lib/firmware# echo image_echo_test_r5_0 > /sys/class/remoteproc/remoteproc0/firmware
root@plnx_aarch64:/lib/firmware#
root@plnx_aarch64:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
root@plnx_aarch64:/lib/firmware#
[70982.961635] remoteproc remoteproc0: powering up ff9a0100.zynqmp_r5_rproc
[70982.971366] remoteproc remoteproc0: Booting fw image image_echo_test_r5_0, size 638724
[70982.985672] virtio_rpmsg_bus virtio0: rpmsg host is online
[70982.993691] remoteproc remoteproc0: registered virtio0 (type 7)
[70983.002197] zynqmp_r5_remoteproc ff9a0100.zynqmp_r5_rproc: RPU boot from TCM.
[7Starting application...
Try to init remoteproc resource
Init remoteproc resource succeeded
Waiting for events...
0983.012367] remoteproc remoteproc0: remote processor ff9a0100.zynqmp_r5_rproc is now up
[70983.032821] virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x1
[70983.043731] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: rpmsg_user_dev_rpmsg_drv_probe
root@plnx_aarch64:/lib/firmware# [70983.055535] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: new channel: 0x400 -> 0x1!
Start RPU-1:
root@plnx_aarch64:/lib/firmware# echo image_echo_test_r5_1 > /sys/class/remoteproc/remoteproc1/firmware
root@plnx_aarch64:/lib/firmware#
root@plnx_aarch64:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc1/
[71185.157615] remoteproc remoteproc1: powering up ff9a0200.zynqmp_r5_rproc
[71185.167453] remoteproc remoteproc1: Booting fw image image_echo_test_r5_1, size 639140
[71185.182180] virtio_rpmsg_bus virtio1: rpmsg host is online
[71185.190226] remoteproc remoteproc1: registered virtio1 (type 7)
[71185.198724] zynqmp_r5_remoteproc ff9a0200.zynqmp_r5_rproc: RPU boot from TCM.
[7Starting application...
Try to init remoteproc resource
Init remoteproc resource succeeded
Waiting for events...
1185.208915] remoteproc remoteproc1: remote processor ff9a0200.zynqmp_r5_rproc is now up
[71185.229420] virtio_rpmsg_bus virtio1: creating channel rpmsg-openamp-demo-channel addr 0x1
[71185.240367] rpmsg_user_dev_driver virtio1:rpmsg-openamp-demo-channel: rpmsg_user_dev_rpmsg_drv_probe
root@plnx_aarch64:/lib/firmware# [71185.252200] rpmsg_user_dev_driver virtio1:rpmsg-openamp-demo-channel: new channel: 0x400 -> 0x1!
Run echo_test Linux application with RPU-0 using either the serial port or other telnet or ssh connection:
root@plnx_aarch64:/lib/firmware# echo_test
Echo test start
Open rpmsg dev!
[71507.962881] rpmsg_user_dev_driver virtio0:rpmsg-openamp-demo-channel: Sent init_msg to target 0x1.
****************************************
Please enter command and press enter key
****************************************
1 - Send data to remote core, retrieve the echo and validate its integrity ..
2 - Quit this application ..
CMD>
Run a concurrent echo_test Linux application with RPU-1 using another connection (telnet, ssh...):
root@plnx_aarch64:/lib/firmware# echo_test -d /dev/rpmsg1
Echo test start
Open rpmsg dev!
****************************************
Please enter command and press enter key
****************************************
1 - Send data to remote core, retrieve the echo and validate its integrity ..
2 - Quit this application ..
CMD>
__Note__: The order in which you start the RPU determines which /dev/rpmsgX device is being used with that RPU.
In the above case /dev/rpmsg0 is used for RPU-0.
If however RPU-1 was started first, it would have been associated with /dev/rpmsg0 and RPU-0 would have been using /dev/rpmsg1.
ZynqMP Linux Master running on APU with RPMsg in kernel space and only one RPU slave or RPU in lockstep.
When running with RPU in split mode and only one RPU is an OpenAMP slave, the second RPU can still run another non-openamp application.
RPU-0 slave:
Petalinux BSPs provide a default template to generate a DTB with support for OpenAMP running on RPU-0, see:
<petalinux project>/project-spec/meta-usr/recipes-bsp/device-tree/files/openamp-overlay.dtsi
Add its content to file <petalinux project>/project-spec/meta-user/recipes-bsp/device-tree/file/system-user.dtsi
RPU-1 slave:
Proceed as for the two RPU configuration above and edit your device tree to remove the unused 'zynmp_r5_rproc' entry and associated nodes (tcm, pd,...) that may not be needed any more.
RPU in lockstep:
When running with RPU in lockstep mode, the setup is almost as if running on RPU-0, however the device tree is slightly different, please see openamp-overlay-lockstep.dtsi
Note: Depending on your BSP, you may need to update the Vivado design to add RPU to the isolation configuration, mark it non-secure, and assign 4 TCMs.
ZynqMP Linux Master running on APU with RPMsg in kernel space, APU boots RPU and then later APU restart while RPU keeps running
In this use case, APU boots first into Linux, then boots the remote processor firmware on RPU with remoteproc.
The APU subsystem is then restarted while the RPU firmware keeps running.
After APU is restarted, you try to load the RPU firmware with remoteproc, this one then check:
whether RPU is running
whether firmware checksum resource type "RSC_FW_CHKSUM" is present in the resource table.
If present, it checks if the firmware checksum matches the value calculated from the loadable sections of the firmware.
If the checksum matches, remoteproc does not restart the firmware, and simply notify the RPU to reset virtio
Then both RPU and APU will initialize the RPMsg/virtio to reinitialize the communication
If the firmware is not running or checksum resource is not present or checksum does not match, the RPU will be loaded with the new firmware.
Configure and Build PetaLinux
Please follow same steps as for use case with Linux APU running remoteproc and RPMsg in kernel space to configure PetaLinux.
Additionally, check and if necessary enable ZynqMP debug FS support from kernel menuconfig:
petalinux-config -c kernel
Kernel hacking --->
Compile-time checks and compiler options --->
[*] Debug Filesystem
Device Drivers --->
SOC (System On Chip) specific Drivers ---->
[*] Xilinx Zynq MPSoC driver support ---->
[*] Enable Xilinx Zynq MPSoC Power Management API debugfs functionality
[*] Enable Zynq MPSoC generic PM domains
Building remote processor demo applications with Xilinx SDK
Proceed as documented in UG1186 to generate remote processor openamp applications with Xilinx SDK.
For this example we use the "echo test" demo for RPU-0, and we want it to ignore APU requests to shutdown generated on reboot by rpmsg_user_dev_driver LKM.
Modify echo_test.c and comment out the 'break' that is being called in the main while loop when 'evt_chnl_deleted' is received.
/* we got a shutdown request, exit */
if (evt_chnl_deleted) {
//break;
}
Running the demo step-by-step:
Log into Linux, then start RPU firmware, e.g:
echo image_echo_test > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state
modprobe rpmsg_user_dev_driver
Restart APU subsystem only:
echo system_shutdown 2 0 > /sys/kernel/debug/zynqmp_pm/power
reboot
When Linux boots again, log into Linux, then:
echo image_echo_test > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state
You shall be able to see on the console a message from remoteproc LKM saying:
"remoteproc remoteproc0: remote is already running. Do not restart"
Re-create the connection to RPU and start the Linux application:
modprobe rpmsg_user_dev_driver
echo_test
ZynqMP Linux Master running on APU Linux loads arbitrary RPU Firmware
Overview
The information below is intended to provide guidance to users who wish to set up a Linux + Bare-metal,RTOS, etc.This configuration relies on the FSBL to start the software running on the APU, and then APU Linux using remoteproc will load the RPU.
To Boot RPU Firmware via APU with Linux
These instructions assume the user has already generated firmware for the RPU and that the user is using Petalinux to create their embedded Linux solution.
1. As directed in User Guide 1186 Chapter 3, create an application inside of the Petalinux project to install the firmware into the Linux host's file system in /lib/firmware.
If creating a new application with the SDK, you may need to update the linker script DDR address to match the DTS address below (0x3ed00000).
2. Modify the device tree at project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi. For example:
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
rproc_0_reserved: rproc@3ed000000 {
no-map;
/* DDR memory reserved for RPU firmware.
* If you want to use predefined shared memory,
* you should also reserved them here.
*/
reg = <0x0 0x3ed00000 0x0 0x1000000>;
};
};
power-domains {
/* For TCM memories, you will need specify the power domain
* IDs. As APU will need to use the power domain ID to request
* access through PMU FW.
*/
pd_r5_0: pd_r5_0 {
#power-domain-cells = <0x0>;
pd-id = <0x7>;
};
pd_tcm_0_a: pd_tcm_0_a {
#power-domain-cells = <0x0>;
pd-id = <0xf>;
};
pd_tcm_0_b: pd_tcm_0_b {
#power-domain-cells = <0x0>;
pd-id = <0x10>;
};
};
amba {
/* You will need to specify the firmware memory as "mmio-sram". */
r5_0_tcm_a: tcm@ffe00000 {
compatible = "mmio-sram";
reg = <0 0xFFE00000 0x0 0x10000>;
pd-handle = <&pd_tcm_0_a>;
};
r5_0_tcm_b: tcm@ffe20000 {
compatible = "mmio-sram";
reg = <0 0xFFE20000 0x0 0x10000>;
pd-handle = <&pd_tcm_0_b>;
};
elf_ddr_0: ddr@3ed00000 {
compatible = "mmio-sram";
reg = <0 0x3ed00000 0x0 0x40000>;
};
test_r50: zynqmp_r5_rproc@0 {
compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
reg = <0x0 0xff9a0100 0 0x100>, <0x0 0xff340000 0 0x100>, <0x0 0xff9a0000 0 0x100>;
reg-names = "rpu_base", "ipi", "rpu_glbl_base";
dma-ranges;
core_conf = "split0";
/* Specify the firmware memories here */
sram_0 = <&r5_0_tcm_a>;
sram_1 = <&r5_0_tcm_b>;
sram_2 = <&elf_ddr_0>;
pd-handle = <&pd_r5_0>;
interrupt-parent = <&gic>;
interrupts = <0 29 4>;
} ;
};
};
3. Run the following to build your petalinux project.
petalinux-build
4. After booting the Petalinux project, run the following to boot the RPU firmware onto RPU.
echo <name of firmware> > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state

Viewing all 11776 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>