For steps to create the Vivado Design. We are using the Vivado design from the previous project which only contains the Processor System represented by the CIPS IP and the NoC IP which include the Memory Controller to access the DDR.
In the Flow navigator, click on Generate Device Image to generate the XSA that we will then feed to AMD petalinux™
AMD Petalinux™ IntroductionTo create the Linux image, you have multiple option. You can use a generic tool like buildroot or use Yocto or Petalinux.
The AMD PetaLinux Tools offers everything necessary to customize, build and deploy Embedded Linux solutions on AMD processing systems. One thing to note is that Petalinux is based on Yocto (I might build the linux image using Yocto in a next project).
It is important to note that AMD consider Petalinux only as an evaluation tool and stated that it should not be used in production system:
AMD Petalinux™ ProjectCreate a petalinux project with Versal template using the following command
petalinux-create project --template versal --name TE0950_basic_petalinux
Then cd into the petalinux project directory
Import the hardware configuration using the XSA:
petalinux-config --get-hw-description TE0950_Designs/03_TE0950_Basic_Linux/vivado/build/TE0950_basic_DDR.xsa
In the Petalinux configuration wizard, under Image Packaging Configuration
, change the following settings to let PetaLinux generate EXT4 rootfs.
- Set
Root File System Type
toEXT4
- Set
Root filesystem formats
toext4
tar.gz - Set
Device node of SD device
to/dev/mmcblk1p2
Note: This last setting is because the SD card is connected to the second SD controller of the Processing System on the TE0950 board
To allow Linux to boot from EXT4 partition we need to change the bootargs settings. Under DT settings
> Kernel Bootargs
:
- Set
generate boot args automatically
toNo
- Set
user set kernel bootargs
toconsole=ttyAMA0 earlycon=pl011,mmio32,0xFF010000,115200n8 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait cma=512
Add the board device tree file by copying the file from https://github.com/xflorentw/TE0950_Designs/blob/main/03_TE0950_Basic_Linux/os/petalinux/src/recipes-bsp/device-tree/files/TE0950.dtsi
Note:
This device tree file contains the node for the peripherals which are on the TE095 board so Linux is aware of them
Open the file TE0950_basic_petalinux/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend
and change the following line
SRC_URI:append = "file://system-user.dtsi"
to
SRC_URI:append = "file://system-user.dtsi file://TE0950.dtsi"
With
this, the board device tree file is included in the list of source files
Open the file TE0950_basic_petalinux/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
and add the following line at the top of the file:
/include/ "TE0950.dtsi"
Build the petalinux project
petalinux-build
Package the linux boot image
petalinux-package boot --u-boot
And finally, create an SD Card image
petalinux-package wic
On Windows, use a tool to write SD Card such as Win32DiskImager and burn the SD Card using the petalinux-sdimage.wic
SD Card image file which is located under TE0950_basic_petalinux/images/linux
Insert the SD Card in the TE0950 board and ensure the boot mode is set to SD card
- S2 [1:3] - [OFF, ON, OFF] - JTAG Boot
Power On the TE0950 board and open a UART terminal (for example Tera Term) can connect to the COM port corresponding to the TE0950 board with the following settings
- Speed: 115200
- Data: 8-bit
- Parity: None
- Stop Bits: 1 bit
You will see Linux booting correctly up to the linux prompt
So we have now a working linux system we can move to the next step which will be to build an acceleration system including the AI Engine
The full project can be build from Makefile and is available on my github repository
https://github.com/xflorentw/TE0950_Designs/tree/main/03_TE0950_Basic_Linux
Disclaimers- AMD, Versal, and Vitis are trademarks or registered trademarks of Advanced Micro Devices, Inc.
- Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.
Comments