-
Hi, Not sure if this is the best place to ask, but here is my situation: I'm current running RPMsg on a KRIA KR260 board. The Cortex-A runs Ubuntu and communicates with FreeRTOS on the Cortex-R. The current setup is the "default" one, with a modified device tree that allows me to load the FreeRTOS firmware from the Linux. However, I'm now trying to run the same setup but in userspace, as described in the documentation page, mostly in order to compare it with my current system. Unfortunately I cannot really figure out where to start, what needs to be modified, what doesn't. According to another page on the Atlassian website, a mysterious Is there a resource or documentation out there that I missed and that I should have had follow? Any pointer or advice is very welcome! Many thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
Above reference documentation is little dated, but most of it is still correct. rpmsg-echo-ping-shared binary is built here: https://github.com/Xilinx/open-amp/blob/f9039c27a00caa7f1548ffd53d863776edc6f223/apps/examples/echo/CMakeLists.txt#L20 I located source file from above reference here: https://github.com/Xilinx/open-amp/blob/master/apps/examples/echo/rpmsg-ping.c I believe it's using shared libraries (so) in linux hence "-shared" name was appended to app name. I am not sure if the application can load firmware though as described in the documentation. That way only remoteproc part is available in kernel, and You can load firmware via remoteproc. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Any reason for not to use RPMsg in kernelspace ? RPMSG in userspace has many limitations. Also it's not actively maintained as RPMsg in kernelspace. |
Beta Was this translation helpful? Give feedback.
-
I put reference link from Xilinx open-amp repo, as petalinux is building it from there as of now. Soon all those apps will be moved out of open-amp repo to openamp-system-reference repo. |
Beta Was this translation helpful? Give feedback.
-
Okay, so the discussion here actually lead me to figure out how to use RPMsg in userspace on the KRIA board while still being able to load the firmware from a running Linux. I'll write it down here for the record: Custom device treeThe device tree was modified in order to have the vring, shared memory and IPI memory areas to be "compatible with UIO", also with matching addresses with the tutorials: --- system.dts.orig 2024-12-17 02:53:50.728339591 +0000
+++ system_uio.dts 2024-12-12 05:34:30.816562575 +0000
@@ -203,7 +203,7 @@
firmware {
- zynqmp-firmware {
+ zynqmp_firmware: zynqmp-firmware {
compatible = "xlnx,zynqmp-firmware";
#power-domain-cells = <0x01>;
method = "smc";
@@ -715,7 +715,7 @@
phandle = <0x41>;
};
- interrupt-controller@f9010000 {
+ gic: interrupt-controller@f9010000 {
compatible = "arm,gic-400";
#interrupt-cells = <0x03>;
reg = <0x00 0xf9010000 0x00 0x10000 0x00 0xf9020000 0x00 0x20000 0x00 0xf9040000 0x00 0x20000 0x00 0xf9060000 0x00 0x20000>;
@@ -1575,7 +1575,7 @@
pinctrl-names = "default";
u-boot,dm-pre-reloc;
compatible = "xlnx,zynqmp-uart\0cdns,uart-r1p12";
- status = "okay";
+ status = "disabled";
interrupt-parent = <0x05>;
interrupts = <0x00 0x16 0x04>;
reg = <0x00 0xff010000 0x00 0x1000>;
@@ -1921,18 +1921,6 @@
reg = <0x00 0x00 0x00 0x80000000 0x08 0x00 0x00 0x80000000>;
};
- reserved-memory {
- #address-cells = <0x02>;
- #size-cells = <0x02>;
- ranges;
-
- pmu@7ff00000 {
- reg = <0x00 0x7ff00000 0x00 0x100000>;
- no-map;
- phandle = <0x7a>;
- };
- };
-
gpio-keys {
compatible = "gpio-keys";
autorepeat;
@@ -1973,6 +1961,72 @@
pwms = <0x1f 0x02 0x9c40 0x00>;
};
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ rproc_0_reserved: rproc_0_reserved@3ec00000 {
+ no-map;
+ reg = <0x0 0x3ec00000 0x0 0x1000000>;
+ };
+
+ };
+ tcm_0a: tcm_0a@ffe00000 {
+ no-map;
+ reg = <0x0 0xffe00000 0x0 0x10000>;
+ status = "okay";
+ compatible = "mmio-sram";
+ power-domain = <&zynqmp_firmware 15>;
+ };
+ tcm_0b: tcm_0b@ffe20000 {
+ no-map;
+ reg = <0x0 0xffe20000 0x0 0x10000>;
+ status = "okay";
+ compatible = "mmio-sram";
+ power-domain = <&zynqmp_firmware 16>;
+ };
+
+
+ rf5ss@ff9a0000 {
+ compatible = "xlnx,zynqmp-r5-remoteproc";
+ xlnx,cluster-mode = <1>;
+ ranges;
+ reg = <0x0 0xFF9A0000 0x0 0x15000>;
+ #address-cells = <0x2>;
+ #size-cells = <0x2>;
+ r5f_0 {
+ compatible = "xilinx,r5f";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ sram = <&tcm_0a &tcm_0b>;
+ memory-region = <&rproc_0_reserved>;
+ power-domain = <&zynqmp_firmware 7>;
+ };
+ };
+
+ amba_pl: amba_pl@0 {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ compatible = "simple-bus";
+ ranges ;
+
+ vring: vring@0 {
+ compatible = "vring_uio";
+ reg = <0x0 0x3ed40000 0x0 0x40000>;
+ };
+ shm0: shm@0 {
+ compatible = "shm_uio";
+ reg = <0x0 0x3ed20000 0x0 0x0100000>;
+ };
+ ipi0: ipi@0 {
+ compatible = "ipi_uio";
+ reg = <0x0 0xff340000 0x0 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 29 4>;
+ };
+ };
+
__symbols__ {
pinctrl_usb1_default = "/firmware/zynqmp-firmware/pinctrl/usb1-default";
pinctrl_usb0_default = "/firmware/zynqmp-firmware/pinctrl/usb0-default";
OpenAMPThe library and example apps were build from source, including the libmetal. From there, test were made running the Cortex-R5F firmwareThe remotecore firmware was simply adapted by changing the addresses from what was used for kernel space mode in order to match the new device tree. This firmware is cross-compiled on another machine, moved to the KRIA board Ubuntu; then loaded to the Cortex-R core using the usual: echo kria-rpmsg-base-echo.elf > /sys/class/remoteproc/remoteproc0/firmware
echo start > /sys/class/remoteproc/remoteproc0/state Many thanks again for the help! |
Beta Was this translation helpful? Give feedback.
-
I think this can be fixed:
To:
I am not sure if you really need vring node. Only need shm0 node with vring address space. |
Beta Was this translation helpful? Give feedback.
-
I have a doubt, however, on the actual "userspace-ness" of my system. Maybe you can help me with that? However I noticed that the firmware I'm loading to the Cortex-R spins a few suspicious kernel modules after being launched. Here are the extra modules returned by
I'll look it up and see if I can disable stuff in the code of my firmware... |
Beta Was this translation helpful? Give feedback.
@sunoc
Above reference documentation is little dated, but most of it is still correct.
rpmsg-echo-ping-shared binary is built here: https://github.com/Xilinx/open-amp/blob/f9039c27a00caa7f1548ffd53d863776edc6f223/apps/examples/echo/CMakeLists.txt#L20
I located source file from above reference here: https://github.com/Xilinx/open-amp/blob/master/apps/examples/echo/rpmsg-ping.c
I believe it's using shared libraries (so) in linux hence "-shared" name was appended to app name.
I am not sure if the application can load firmware though as described in the documentation.
You might have to use debugger to load firmware. Or have only remoteproc nodes in kernel device-tree.
Do not include mbox, mbo…