Zynq7000 OPENAMP 实验
前言Zynq7000 openamp实验,最近想做一个多cpu异构系统,后面会用zynqmp去做,先拿zynq7000试一下首先说明,openamp是开源异构多处理通信框架。现在cpu不再像以前单个cpu,而是越来越复杂,比如TI的TDA4芯片,4个A72、两个R5、四个DSP,再比如XILINX的ZynqMP,四个A53,两个R5。一般做法都是A72、A53跑linux或者QNX,R5跑RTOS
·
前言
Zynq7000 openamp实验,最近想做一个多cpu异构系统,后面会用zynqmp去做,先拿zynq7000试一下
首先说明,openamp是开源异构多处理通信框架。现在cpu不再像以前单个cpu,而是越来越复杂,比如TI的TDA4芯片,4个A72、两个R5、四个DSP,再比如XILINX的ZynqMP,四个A53,两个R5。一般做法都是A72、A53跑linux或者QNX,R5跑RTOS,在一些实时性较高的场景。
环境:PETALINUX2020.1
开始
首先参考官方的APP UG1186,一切都可以在里面找到答案。
LINUX配置
配置kernel:
[*] Enable loadable module support --->
Device Drivers --->
Remoteproc drivers --->
# for R5:
<M> ZynqMP_r5 remoteproc support
# for Zynq A9
<M> Support ZYNQ remoteproc
配置rootfs:
Filesystem Packages --->
-> Petalinux Package Groups
-> packagegroup-petalinux-openamp
Filesystem Packages --->
misc --->
openamp-fw-echo-testd --->
[*] openamp-fw-echo-testd
openamp-fw-mat-muld --->
[*] openamp-fw-mat-muld
openamp-fw-rpc-demo --->
[*] openamp-fw-rpc-demo
Filesystem Packages--->
misc --->
sysfsutils --->
[*] libsysfs
Libs --->
libmetal--->
[*] libmetal
Filesystem Packages --->
libs --->
libmetal-->
[*] libmetal-demos
配置设备树:
/include/ "system-conf.dtsi"
/ {
leds {
compatible = "gpio-leds";
heartbeat_led {
label = "heartbeat";
gpios = <&gpio0 0 1>;
linux,default-trigger = "heartbeat";
};
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
vdev0vring0: vdev0vring0@0e800000 {
no-map;
compatible = "shared-dma-pool";
reg = <0x0e800000 0x4000>;
};
vdev0vring1: vdev0vring1@0e804000 {
no-map;
compatible = "shared-dma-pool";
reg = <0x0e804000 0x4000>;
};
vdev0buffer: vdev0buffer@0e808000 {
no-map;compatible = "shared-dma-pool";
reg = <0x0e808000 0x100000>;
};
rproc_0_reserved: rproc@0e000000 {
no-map;compatible = "shared-dma-pool";
reg = <0x0e000000 0x800000>;
};
};
remoteproc0: remoteproc@0 {
compatible = "xlnx,zynq_remoteproc";
firmware = "firmware";
vring0 = <15>;
vring1 = <14>;
memory-region = <&rproc_0_reserved>, <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>;
};
};
配置boot cfg:
(1)我这边使用的是串口0
(2)启动命令:maxcpus=1
CPU1程序
链接脚本起始地址要和设备树对应
Shared mem也要对上
串口更换设备1
cpu flag增加 -DUSE_AMP=1
编译启动
root@joker:/lib/firmware# echo echo_test.elf > /sys/class/remoteproc/remoteproc0/firmware
root@joker:/lib/firmware# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up remoteproc@0
remoteproc remoteproc0: Booting fw image echo_test.elf, size 2904672
virtio_rpmsg_bus virtio0: rpmsg host is online
virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x0
remoteproc@0#vdev0buffer: registered virtio0 (type 7)
remoteproc remoteproc0: remote processor remoteproc@0 is now up
root@donce:/lib/firmware# cd /dev/
Echo test start
Master>probe rpmsg_char
Open rpmsg dev virtio0.rpmsg-openamp-demo-channel.-1.0!
Opening file rpmsg_ctrl0.
checking /sys/class/rpmsg/rpmsg_ctrl0/rpmsg0/name
svc_name: rpmsg-openamp-demo-channel
.
**************************************
Echo Test Round 0
**************************************
sending payload number 0 of size 9
echo test: sent : 9
received payload number 0 of size 9
sending payload number 1 of size 10
echo test: sent : 10
received payload number 1 of size 10
sending payload number 2 of size 11
echo test: sent : 11
received payload number 2 of size 11
sending payload number 3 of size 12
可以发现正常运行
更多推荐
已为社区贡献3条内容
所有评论(0)