准备通用镜像
AMD 提供预构建镜像 Common Image 封装,用于快速构建平台并进行快速评估。“common image”封装内包含一个预构建的 Linux 内核和根文件系统,可供嵌入式 Vitis 平台开发者用于任何 Zynq™、Zynq™ MP 或 Versal 开发板。此“common image”封装内包含以下镜像:
#Versal
├── bl31.elf
├── boot.scr
├── environment-setup-cortexa72-cortexa53-xilinx-linux
├── Image
├── README.txt
├── rootfs.ext4
├── rootfs.manifest
├── rootfs.tar.gz
├── sdk.sh
├── site-config-cortexa72-cortexa53-xilinx-linux
├── sysroots
├── u-boot.elf
└── version-cortexa72-cortexa53-xilinx-linux
#Zynqmp
├── bl31.elf
├── boot.scr
├── environment-setup-cortexa72-cortexa53-xilinx-linux
├── Image
├── README.txt
├── rootfs.ext4
├── rootfs.manifest
├── rootfs.tar.gz
├── sdk.sh
├── site-config-cortexa72-cortexa53-xilinx-linux
├── sysroots
├── u-boot.elf
└── version-cortexa72-cortexa53-xilinx-linux
从
AMD 下载页面下载AMD通用镜像、使用以下命令将其解压并将其置于工程文件夹内。
tar xvf xilinx-zynqmp-common-v2023.2.tar.gz -C . #. means current directory.
创建 DTB 文件
在 XSCT 工具中使用“createdts”命令生成 DTB 文件。zocl 驱动程序接口需要设备树节点才能启用中断连接。使用此命令时,请添加 -zocl 选项。以下代码显示了此命令及其选项的使用方法。
createdts -hw <full path of XSA file> -zocl -platform-name mydevice -git-branch xlnx_rel_v202X.X -board zcu104-revc -compile
system.dtb 文件位于 <mydevice/psu_cortexaXX_0/device_tree_domain/bsp> 文件夹内。
-
-name
:平台名称 -
-hw
:含路径的硬件 XSA 文件 -
-git-branch
:设备树分支 -
-board
:器件的开发板名称。您可在 /device_tree/data/kernel_dtsi 处检查开发板名称。 -
-zocl
:启用 zocl 驱动程序支持 -
-compile
:指定用于编译设备树的选项
以下提供了 zocl 器件节点的示例,供您参考。
&amba {
zyxclmm_drm {
compatible = "xlnx,zocl";
status = "okay";
interrupt-parent = <&axi_intc_0>;
interrupts = <0 4>, <1 4>, <2 4>, <3 4>,
<4 4>, <5 4>, <6 4>, <7 4>,
<8 4>, <9 4>, <10 4>, <11 4>,
<12 4>, <13 4>, <14 4>, <15 4>,
<16 4>, <17 4>, <18 4>, <19 4>,
<20 4>, <21 4>, <22 4>, <23 4>,
<24 4>, <25 4>, <26 4>, <27 4>,
<28 4>, <29 4>, <30 4>, <31 4>;
};
};
欲知详情,请参阅 XRT 文档:https://xilinx.github.io/XRT/master/html/yocto.html。