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

在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>

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
  • 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
	    };
	};
};

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"

5. 修改rootfs

petalinux-config -c rootfs
  • 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

/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
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 23
    评论
评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值