Closed gpresazzi closed 7 years ago
which zynq_remotperoc driver do you use? how do you probe the module and how do you specify the firmware? with 4.9 2017.1 Xilinx kernel, you can use sysfs API to specify the firmware.
There is a bug in the 2017.1 kernel remoteproc, if you failed to load the firmware for the 1st time, you will get the "failed to declare rproc mem as DMA mem" when you try to reload it without reboot.
I'm using zynq_remoteproc from : https://github.com/Xilinx/meta-xilinx/tree/rel-v2017.1
I moved the zynq_remoteproc.ko from /lib/modules into /home folder and I probe it manually "insmod zynq_remoteproc.ko
", the firmware is stored in /lib/firmware folder. I think it's successfully found.
Do you think the issue is related to DT ? Do you suggest to load the module at startup ?
DT:
amba { elf_ddr_0: ddr@3ed00000 { compatible = "mmio-sram"; reg = <0x200000 0x100000>; }; };
zynq_remoteproc@0 { compatible = "xlnx,zynq_remoteproc"; vring0 = <15>; vring1 = <14>; sram_0 = <&elf_ddr_0>; firmware = "firmware"; };
where is your kernel starts? I think it will need to start higher than "reg = <0x200000 0x100000>;"
I moved the kernel load address to 0x10000000 and it solve the previus issue, but I still have an ERROR during the module probe:
zynq_remoteproc zynq_remoteproc@0: iommu not present remoteproc remoteproc0: rsc: type 4 remoteproc remoteproc0: rsc: type 3 remoteproc remoteproc0: rsc: type 4 remoteproc remoteproc0: rsc: type 3 remoteproc remoteproc0: vdev rsc: id 7, dfeatures 0x1, cfg len 0, 2 vrings remoteproc remoteproc0: vdev rsc: vring0: da 0x8000000, qsz 256, align 4096 remoteproc remoteproc0: vdev rsc: vring1: da 0x8004000, qsz 256, align 4096 device: 'virtio0': device_add bus: 'virtio': add device virtio0 PM: Adding info for virtio:virtio0 remoteproc remoteproc0: registered virtio0 (type 7) remoteproc remoteproc0: rsc: type 4 bus: 'rpmsg': registered bus: 'virtio': add driver virtio_rpmsg_bus bus: 'virtio': driver_probe_device: matched device virtio0 with driver virtio_rpmsg_bus bus: 'virtio': really_probe: probing driver virtio_rpmsg_bus with device virtio0 virtio_rpmsg_bus virtio0: no default pinctrl state devices_kset: Moving virtio0 to end of list remoteproc remoteproc0: vring0: va b0c00000 dma 0x00200000 size 0x3000 idr 1 remoteproc remoteproc0: vring1: va b0c04000 dma 0x00204000 size 0x3000 idr 2 virtio_rpmsg_bus virtio0: rpmsg host is online driver: 'virtio_rpmsg_bus': driver_bound: bound to device 'virtio0' bus: 'virtio': really_probe: bound device virtio0 to driver virtio_rpmsg_bus remoteproc remoteproc0: rsc: type 3 remoteproc remoteproc0: bad phdr da 0x100000 mem 0x28480 remoteproc remoteproc0: Failed to load program segments: -22 device: 'virtio0': device_unregister bus: 'virtio': remove device virtio0 PM: Removing info for virtio:virtio0 __fw_free_buf: fw-firmware buf=ae4956c0 data=b0ac2000 size=522972
I'm using echo_test example.
I solved the issue changing the dts with values: reg = <0x100000 0x80000>; Thanks !
Hi. I am trying to reproduce this, but I am not able to moved the kernel load address to 0x10000000. My menuconfig is not displaying the PHYS_OFFEST option.
I am also using https://github.com/Xilinx/meta-xilinx/tree/rel-v2017.1
Any suggestion? Thanks!
you don't need to put the kernel to high address. you can use higher memory as shared memory If you want to put the kernel to 0x10000000, the newer version of kernel, you don't need to set in the kernel config, but you will need to set the UIMAGE_LOADADDR which is in: meta-xilinx/conf/machine/include/tune-zynq.inc
you will need to change to 0x10008000
@wjliang Thank you a lot! 🥇
I changed the UIMAGE_LOADADDR to 0x10008000 and I also updated my kernel to https://github.com/Xilinx/meta-xilinx/tree/rel-v2017.2 (In order to fix one issue).
My DT :
/ {
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
rproc_0_reserved: rproc@3e000000 {
no-map;
reg = <0x3e000000 0x01000000>;
};
};
amba {
elf_ddr_0: ddr@0 {
compatible = "mmio-sram";
reg = <0x3e000000 0x400000>;
};
};
remoteproc0: remoteproc@0 {
compatible = "xlnx,zynq_remoteproc";
firmware = "firmware";
vring0 = <15>;
vring1 = <14>;
srams = <&elf_ddr_0>;
};
};
Now it works perfectly!
Hi!
I'm follow the steps described by @abilbaotm and I'm getting this error:
root@zc702-zynq7:~# echo start > /sys/class/remoteproc/remoteproc0/state
remoteproc remoteproc0: powering up amba:remoteproc@0
remoteproc remoteproc0: Booting fw image image_matrix_multiply, size 2436036
remoteproc remoteproc0: registered virtio0 (type 7)
remoteproc remoteproc0: bad phdr da 0x3e000000 mem 0x1fd9c
remoteproc remoteproc0: Failed to load program segments: -22
virtio_rpmsg_bus virtio0: rpmsg host is online
remoteproc remoteproc0: Boot failed: -22
-sh: echo: write error: Invalid argument
Any idea? @wjliang
Thanks in advance!
The remoteproc driver failed to recognize the memory. You can refer to ug1186, which version of kernel did u use? If you use xilinx-v2017.1 kernel please refer to ug1186 2017.1 version. If you use xilinx-v2017.3 version of Linux kernel, please refer to ug1186 2017.3 version. The difference between the two version is the property of firmware memories. In Xilinx-v2017.1 version, the firmware memory property in dots is "sram_0", in Xilinx-v2017.3 version, the firmware memory property in dts is "srams".
@wjliang, thanks for the hints. I have updated the kernel to the v3 and now everything is working well.
Thank you!
Hi,
I'm working with yocto and meta-openamp for Microzed Zynq-7000. I've a problem when loading module zynq_remoteproc. The error is:
Do you have any advice ? Thx