cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CobusR
Visitor
Visitor
476 Views
Registered: ‎03-15-2021

PetaLinux 2020.2 OpenAmp two RPU slaves

Jump to solution

Hi,

I want to run the OpenAmp echo test with one petalinux master and two RPU slaves, on two rpmsg channels.

I started with the zcu102-2020.2 BSP from the Xilinx website. I followed UG1186 and got the echo test working with RPU0.

I have followed this wiki, altough its is for 2019.1:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/118358017/OpenAMP+2019.1#OpenAMP2019.1-ZynqMPLinuxMasterrunningonAPUwithRPMsginkernelspaceand2RPUslaves.

I can't find something similar for the 2020.2 version.

I changed my system-user.dtsi to what is described in the wiki. I have attached it to this message.

Using the attached system-user.dtsi I no longer see any devices here: /sys/bus/rpmsg/devices where previously there was a virtio0.rpmsg-openamp-demo-channel.-1.0 device.

This resutls in the normal echo test not working anymore as the rpmsg channel does not exist anymore.

I have a few questions:

1) How is the virtio0.rpmsg-openamp-demo-channel.-1.0 channel created in the first place?

2) How can I add a second channel for RPU 1?

3) How do I create a channel that is not named the demo channel?

Thanks in advance for any help!

 

 

0 Kudos
1 Solution

Accepted Solutions
CobusR
Visitor
Visitor
422 Views
Registered: ‎03-15-2021

Ok, so I've managed to get it going.

My system_user.dtsi file:

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rpu0vdev0vring0: rpu0vdev0vring0@3ed40000 {
		no-map;
		reg = <0x0 0x3ed40000 0x0 0x4000>;
		};
		rpu0vdev0vring1: rpu0vdev0vring1@3ed44000 {
		no-map;
		reg = <0x0 0x3ed44000 0x0 0x4000>;
		};
		rpu0vdev0buffer: rpu0vdev0buffer@3ed48000 {
	        no-map;
        	reg = <0x0 0x3ed48000 0x0 0x100000>;
        	};
		rproc_0_reserved: rproc@3ed00000 {
		no-map;
		reg = <0x0 0x3ed00000 0x0 0x40000>;
		};
		rpu1vdev0vring0: rpu1vdev0vring0@3ef40000 {
		no-map;
		reg = <0x0 0x3ef40000 0x0 0x4000>;
		};
		rpu1vdev0vring1: rpu1vdev0vring1@3ef44000 {
		no-map;
		reg = <0x0 0x3ef44000 0x0 0x4000>;
		};
		rpu1vdev0buffer: rpu1vdev0buffer@3ef48000 {
	        no-map;
        	reg = <0x0 0x3ef48000 0x0 0x100000>;
        	};
		rproc_1_reserved: rproc@3ef00000{
         	no-map;
         	reg = <0x0 0x3ef00000 0x0 0x40000>;
               	};
	};

	zynqmp-rpu {
		compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		core_conf = "split";
		reg = <0x0 0xFF9A0000 0x0 0x10000>;
		r5_0: r5@0 {
			#address-cells = <2>;
			#size-cells = <2>;
			ranges;
			memory-region =   <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
			pnode-id = <0x7>;
			mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
			mbox-names = "tx", "rx";
			tcm_0_a: tcm_0@0 {
				reg = <0x0 0xFFE00000 0x0 0x10000>;
				pnode-id = <0xf>;
			};
			tcm_0_b: tcm_0@1 {
				reg = <0x0 0xFFE20000 0x0 0x10000>;
				pnode-id = <0x10>;
			};
		};
		 r5_1: r5@1 {
            		#address-cells = <2>;
            		#size-cells = <2>;
            		ranges;
		        memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
		        pnode-id = <0x8>;
	                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
            		mbox-names = "tx", "rx";
            		r5_1_tcm_a: tcm@ffe90000 {
				reg = <0x0 0xFFE90000 0x0 0x10000>;
		                pnode-id = <0x11>;
        	        };
        	        r5_1_tcm_b: tcm@ffeb0000 {
		                reg = <0x0 0xFFEB0000 0x0 0x10000>;
        		        pnode-id = <0x12>;
       		        };
        	};	
	};


	zynqmp_ipi1 {
		compatible = "xlnx,zynqmp-ipi-mailbox";
		interrupt-parent = <&gic>;
		interrupts = <0 29 4>;
		xlnx,ipi-id = <7>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		/* APU<->RPU0 IPI mailbox controller */
		ipi_mailbox_rpu0: mailbox@ff990600 {
			reg = <0xff990600 0x20>,
			      <0xff990620 0x20>,
			      <0xff9900c0 0x20>,
			      <0xff9900e0 0x20>;
			reg-names = "local_request_region",
				    "local_response_region",
				    "remote_request_region",
				    "remote_response_region";
			#mbox-cells = <1>;
			xlnx,ipi-id = <1>;
		};
	};

 zynqmp_ipi2 {
        compatible = "xlnx,zynqmp-ipi-mailbox";
        interrupt-parent = <&gic>;
        interrupts = <0 30 4>;
        xlnx,ipi-id = <8>;
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
        /* APU<->RPU1 IPI mailbox controller */
        ipi_mailbox_rpu1: mailbox@ff3f0b00 {
            reg = <0xff3f0b00 0x20>,
                  <0xff3f0b20 0x20>,
                  <0xff3f0940 0x20>,
                  <0xff3f0960 0x20>;
            reg-names = "local_request_region",
                    "local_response_region",
                    "remote_request_region",
                    "remote_response_region";
            #mbox-cells = <1>;
            xlnx,ipi-id = <2>;
        };
    };

};

 

And I had to make the following change in the echo_test software running on RPU1:

#define IPI_CHN_BITMASK 0x02000000 /* IPI channel bit mask for IPI from/to

 I also had to update the linker script with the correct address as per the system_user.dtsi file.

 

View solution in original post

1 Reply
CobusR
Visitor
Visitor
423 Views
Registered: ‎03-15-2021

Ok, so I've managed to get it going.

My system_user.dtsi file:

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rpu0vdev0vring0: rpu0vdev0vring0@3ed40000 {
		no-map;
		reg = <0x0 0x3ed40000 0x0 0x4000>;
		};
		rpu0vdev0vring1: rpu0vdev0vring1@3ed44000 {
		no-map;
		reg = <0x0 0x3ed44000 0x0 0x4000>;
		};
		rpu0vdev0buffer: rpu0vdev0buffer@3ed48000 {
	        no-map;
        	reg = <0x0 0x3ed48000 0x0 0x100000>;
        	};
		rproc_0_reserved: rproc@3ed00000 {
		no-map;
		reg = <0x0 0x3ed00000 0x0 0x40000>;
		};
		rpu1vdev0vring0: rpu1vdev0vring0@3ef40000 {
		no-map;
		reg = <0x0 0x3ef40000 0x0 0x4000>;
		};
		rpu1vdev0vring1: rpu1vdev0vring1@3ef44000 {
		no-map;
		reg = <0x0 0x3ef44000 0x0 0x4000>;
		};
		rpu1vdev0buffer: rpu1vdev0buffer@3ef48000 {
	        no-map;
        	reg = <0x0 0x3ef48000 0x0 0x100000>;
        	};
		rproc_1_reserved: rproc@3ef00000{
         	no-map;
         	reg = <0x0 0x3ef00000 0x0 0x40000>;
               	};
	};

	zynqmp-rpu {
		compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		core_conf = "split";
		reg = <0x0 0xFF9A0000 0x0 0x10000>;
		r5_0: r5@0 {
			#address-cells = <2>;
			#size-cells = <2>;
			ranges;
			memory-region =   <&rproc_0_reserved>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
			pnode-id = <0x7>;
			mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
			mbox-names = "tx", "rx";
			tcm_0_a: tcm_0@0 {
				reg = <0x0 0xFFE00000 0x0 0x10000>;
				pnode-id = <0xf>;
			};
			tcm_0_b: tcm_0@1 {
				reg = <0x0 0xFFE20000 0x0 0x10000>;
				pnode-id = <0x10>;
			};
		};
		 r5_1: r5@1 {
            		#address-cells = <2>;
            		#size-cells = <2>;
            		ranges;
		        memory-region = <&rproc_1_reserved>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
		        pnode-id = <0x8>;
	                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
            		mbox-names = "tx", "rx";
            		r5_1_tcm_a: tcm@ffe90000 {
				reg = <0x0 0xFFE90000 0x0 0x10000>;
		                pnode-id = <0x11>;
        	        };
        	        r5_1_tcm_b: tcm@ffeb0000 {
		                reg = <0x0 0xFFEB0000 0x0 0x10000>;
        		        pnode-id = <0x12>;
       		        };
        	};	
	};


	zynqmp_ipi1 {
		compatible = "xlnx,zynqmp-ipi-mailbox";
		interrupt-parent = <&gic>;
		interrupts = <0 29 4>;
		xlnx,ipi-id = <7>;
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		/* APU<->RPU0 IPI mailbox controller */
		ipi_mailbox_rpu0: mailbox@ff990600 {
			reg = <0xff990600 0x20>,
			      <0xff990620 0x20>,
			      <0xff9900c0 0x20>,
			      <0xff9900e0 0x20>;
			reg-names = "local_request_region",
				    "local_response_region",
				    "remote_request_region",
				    "remote_response_region";
			#mbox-cells = <1>;
			xlnx,ipi-id = <1>;
		};
	};

 zynqmp_ipi2 {
        compatible = "xlnx,zynqmp-ipi-mailbox";
        interrupt-parent = <&gic>;
        interrupts = <0 30 4>;
        xlnx,ipi-id = <8>;
        #address-cells = <1>;
        #size-cells = <1>;
        ranges;
        /* APU<->RPU1 IPI mailbox controller */
        ipi_mailbox_rpu1: mailbox@ff3f0b00 {
            reg = <0xff3f0b00 0x20>,
                  <0xff3f0b20 0x20>,
                  <0xff3f0940 0x20>,
                  <0xff3f0960 0x20>;
            reg-names = "local_request_region",
                    "local_response_region",
                    "remote_request_region",
                    "remote_response_region";
            #mbox-cells = <1>;
            xlnx,ipi-id = <2>;
        };
    };

};

 

And I had to make the following change in the echo_test software running on RPU1:

#define IPI_CHN_BITMASK 0x02000000 /* IPI channel bit mask for IPI from/to

 I also had to update the linker script with the correct address as per the system_user.dtsi file.

 

View solution in original post