当前位置:   article > 正文

DPU on PYNQ-Z2系列—1.2 硬件准备—在Petalinux中编译DPU的驱动及Linux镜像_xilinx dpu 驱动

xilinx dpu 驱动

在Petalinux中编译DPU的驱动及Linux镜像

环境要求

Quick Way

https://download.csdn.net/download/lulugay/11986331有做好的bsp文件

步骤

1. 创建Petalinux工程

petalinux-create --type project --template zynq --name pynqz2_dpu
cd pynqz2_dpu
petalinux-config --get-hw-description=<path to pynqz2_dpu.hdf>
  • 1
  • 2
  • 3

2. 改为从SD卡启动

  • DTG Settings->Kernel Bootargs->disable generate boot args automatically and enter the following bootargs in user set kernel bootargs
console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk quiet rootfstype=ext4 rootwait cma=256M
  • 1
  • Image Packaging Configuration->Root filesystem type (SD card)

3. 修改设备树

<path to plnx project>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi 的内容改为

/include/ "system-conf.dtsi"
&amba {
	xlnk {
		compatible = "xlnx,xlnk-1.0";
	};
};
&amba{
	dpu{
	    #address-cells = <1>;
    	    #size-cells = <1>;
    	    compatible = "xilinx,dpu";
    	    base-addr = <0x4f000000>;     //CHANGE THIS ACCORDING TO YOUR DESIGN

	    dpucore {
	        compatible = "xilinx,dpucore";
	        interrupt-parent = <&intc>;
	        interrupts = <0 29 4>; //CHANGE THIS ACCORDING TO YOUR DESIGN
	        core-num = <0x1>; //CHANGE THIS ACCORDING TO YOUR DESIGN
	    };
	};
};
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

4. 添加DPU驱动

  • 将zcu102-dpu-trd-2019-1-190809/apu/dpu_petalinux_bsp/xilinx-dpu-trd-zcu102-v2019/zcu102-dpu-trd-2019-1/project-spec/meta-user下的recipes-modules文件夹复制到< path to petalinux project>/project-spec/meta-user
  • 在< path to petalinux project>/project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend最后一行添加
IMAGE_INSTALL_append = "dpu"
  • 1

5. 修改rootfs

petalinux-config -c rootfs
  • 1
  • modules -> dpu
  • Petalinux Package Groups -> petalinuxgroup-petalinux-opencv -> opencv, opencv-dev
  • Filesystem Packages -> console -> utils -> pkgconfig -> pkgconfig, pkgconfig-dev

7. 编译工程

petalinux-build
petalinux-package --boot --force --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/*.bit --u-boot
  • 1
  • 2

/images/linux/BOOT.BIN,/images/linux/image.ub,/images/linux/rootfs.tar.gz 这些文件会在后面的步骤里用到

8. *打包工程

如果有必要的话,可以将做好的petalinux工程打包成bsp

petalinux-package --bsp -p . -o xilinx-pynq-z2-v2019.1-dpu3.0.bsp
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/250413
推荐阅读
相关标签
  

闽ICP备14008679号