UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer nvl1109
Observer
682 Views
Registered: ‎06-14-2018

Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Hi, I'm trying to run 2 R5 cores on Enclustra XU1 + PE1 board from Linux. I follow the guide at https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841990/OpenAMP+2018.2 , the device tree is configured as static split mode, Linux kernel 4.14 from Enclustra.

DTS

 

/ {
	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rproc_0_reserved: rproc@3ed000000 {
			no-map;
			reg = <0x0 0x3ed00000 0x0 0x1000000>;
		};
	};

	power-domains {
		pd_r5_0: pd_r5_0 {
			#power-domain-cells = <0x0>;
			pd-id = <0x7>;
		};
		pd_r5_1: pd_r5_1 {
			#power-domain-cells = <0x0>;
			pd-id = <0x8>;
		};
		pd_tcm_0_a: pd_tcm_0_a {
			#power-domain-cells = <0x0>;
			pd-id = <0xf>;
		};
		pd_tcm_0_b: pd_tcm_0_b {
			#power-domain-cells = <0x0>;
			pd-id = <0x10>;
		};
		pd_tcm_1_a: pd_tcm_1_a {
			#power-domain-cells = <0x0>;
			pd-id = <0x11>;
		};
		pd_tcm_1_b: pd_tcm_1_b {
			#power-domain-cells = <0x0>;
			pd-id = <0x12>;
		};
	};

	amba {
		r5_0_tcm_a: tcm@ffe00000 {
			compatible = "mmio-sram";
			reg = <0 0xFFE00000 0x0 0x10000>;
			pd-handle = <&pd_tcm_0_a>;
		};
		r5_0_tcm_b: tcm@ffe20000 {
			compatible = "mmio-sram";
			reg = <0 0xFFE20000 0x0 0x10000>;
			pd-handle = <&pd_tcm_0_b>;
		};
		r5_1_tcm_a: tcm@ffe90000 {
			compatible = "mmio-sram";
			reg = <0 0xFFE90000 0x0 0x10000>;
			pd-handle = <&pd_tcm_1_a>;
		};
		r5_1_tcm_b: tcm@ffe92000 {
			compatible = "mmio-sram";
			reg = <0 0xFFEB0000 0x0 0x10000>;
			pd-handle = <&pd_tcm_1_b>;
		};

		elf_ddr_0: ddr@3ed00000 {
			compatible = "mmio-sram";
			reg = <0 0x3ED00000 0x0 0x100000>;
		};

		elf_ddr_1: ddr@3ee00000 {
			compatible = "mmio-sram";
			reg = <0 0x3EE00000 0x0 0x100000>;
		};

		test_r50: zynqmp_r5_rproc@0 {
			compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
			reg = <0x0 0xff9a0100 0 0x100>, <0x0 0xff340000 0 0x100>, <0x0 0xff9a0000 0 0x100>;
			reg-names = "rpu_base", "ipi", "rpu_glbl_base";
			dma-ranges;
			core_conf = "split0";
			srams = <&r5_0_tcm_a &r5_0_tcm_b &elf_ddr_0>;
			pd-handle = <&pd_r5_0>;
			interrupt-parent = <&gic>;
			interrupts = <0 29 4>;

		} ;

		test_r51: zynqmp_r5_rproc@1 {
			compatible = "xlnx,zynqmp-r5-remoteproc-1.0";
			reg =<0x0 0xff9a0200 0 0x100>, <0x0 0xff340000 0 0x100>, <0x0 0xff9a0000 0 0x100>;
			reg-names = "rpu_base", "ipi", "rpu_glbl_base";
			dma-ranges;
			core_conf = "split1";
			srams = <&r5_1_tcm_a &r5_1_tcm_b &elf_ddr_1>;
			pd-handle = <&pd_r5_1>;
			interrupt-parent = <&gic>;
			interrupts = <0 29 4>;

		} ;

	};
};

 

 

R5 linker files:
Core 0

 

MEMORY
{
   psu_ddr_S_AXI_BASEADDR : ORIGIN = 0x3ED00000, LENGTH = 0x00100000
   psu_r5_tcm_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00010000
   psu_r5_tcm_ram_1_S_AXI_BASEADDR : ORIGIN = 0x00020000, LENGTH = 0x00010000
}

Core 1

 

 

MEMORY
{
   psu_ddr_S_AXI_BASEADDR : ORIGIN = 0x3EE00000, LENGTH = 0x00100000
   psu_r5_tcm_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00090000, LENGTH = 0x00010000
   psu_r5_tcm_ram_1_S_AXI_BASEADDR : ORIGIN = 0x00092000, LENGTH = 0x00010000
}

I load and run R5 code via remoteproc from Linux. The core #0 works fine. But the core #1 has error when starting:

[ 5944.887024] remoteproc remoteproc0: remote processor ff9a0100.zynqmp_r5_rproc is now up
[ 5945.466511] remoteproc remoteproc1: powering up ff9a0200.zynqmp_r5_rproc
[ 5945.473826] remoteproc remoteproc1: Booting fw image r5core1, size 488504
[ 5945.480571] remoteproc remoteproc1: bad phdr da 0x90000 mem 0x518
[ 5945.486611] remoteproc remoteproc1: Failed to load program segments: -22
[ 5945.493336] remoteproc remoteproc1: Boot failed: -22

Can you please enlighten me where am I wrong? Thank you.

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
469 Views
Registered: ‎05-10-2017

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Your linker script for core-1 is not right. Should be as below.

MEMORY
{
   psu_ddr_S_AXI_BASEADDR : ORIGIN = 0x3EE00000, LENGTH = 0x00100000
   psu_r5_tcm_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00010000
   psu_r5_tcm_ram_1_S_AXI_BASEADDR : ORIGIN = 0x00002000, LENGTH = 0x00010000
}

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
7 Replies
Moderator
Moderator
660 Views
Registered: ‎03-19-2014

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Look at UG1186 and reserve memory from Linux for your R5s.   Make sure your R5s are running from unique memory spaces or they will stomp on each other.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer nvl1109
Observer
651 Views
Registered: ‎06-14-2018

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution
@glena,
Thank you for your quickly reply.
Do you mean the remoteproc only used to load the firmware with OpenAMP is used?
My R5 firmware is just a simple hello world application :), just print hello world from both cores.
I looked at UG1186, but it doesn't mention anything about the linker file of R5 application. Or maybe I'm missing something? Thank you and have a nice weekend.
0 Kudos
Highlighted
Moderator
Moderator
646 Views
Registered: ‎03-19-2014

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Reserved memory in UG1186.   You need to not allow Linux all of the memory, or it will corrupt your R5 code.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer nvl1109
Observer
644 Views
Registered: ‎06-14-2018

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Hi glena,

I already reserved the DDR memory in linux DTS

reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;
		rproc_0_reserved: rproc@3ed000000 {
			no-map;
			reg = <0x0 0x3ed00000 0x0 0x1000000>;
		};
	};

Or I have to reserve any other memory zones?

0 Kudos
Observer nvl1109
Observer
612 Views
Registered: ‎06-14-2018

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Hi all,

Maybe more specific question is: how can I calculate the correct address of TCM memories in linker file of second R5 core?

My device tree and linker files are in my first post. Thank you so much.

0 Kudos
Moderator
Moderator
470 Views
Registered: ‎05-10-2017

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Your linker script for core-1 is not right. Should be as below.

MEMORY
{
   psu_ddr_S_AXI_BASEADDR : ORIGIN = 0x3EE00000, LENGTH = 0x00100000
   psu_r5_tcm_ram_0_S_AXI_BASEADDR : ORIGIN = 0x00000000, LENGTH = 0x00010000
   psu_r5_tcm_ram_1_S_AXI_BASEADDR : ORIGIN = 0x00002000, LENGTH = 0x00010000
}

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Observer nvl1109
Observer
442 Views
Registered: ‎06-14-2018

Re: Enclustra XU1 run 2 RPU slaves at the same time

Jump to solution

Hi @jovitac,

Thank you for your answer. You are right. I also found the answer in technical reference or embedded design tutorial documents.

At starting, it's the question because of my linker file is similar to yours, but maybe issue some where, then only R5 core #0 prints out hello world, or R5 core #0 was stopped when R5 core #1 starts.

I have just tried with SDK 2018.3, standalone applications on both R5_0 and R5_1. Both cores work fine.

0 Kudos